diff options
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/audiohook.h | 11 | ||||
-rw-r--r-- | include/asterisk/framehook.h | 33 | ||||
-rw-r--r-- | include/asterisk/res_fax.h | 4 |
3 files changed, 47 insertions, 1 deletions
diff --git a/include/asterisk/audiohook.h b/include/asterisk/audiohook.h index 1a4e4696a..6b0716092 100644 --- a/include/asterisk/audiohook.h +++ b/include/asterisk/audiohook.h @@ -197,6 +197,17 @@ void ast_audiohook_detach_list(struct ast_audiohook_list *audiohook_list); */ void ast_audiohook_move_by_source(struct ast_channel *old_chan, struct ast_channel *new_chan, const char *source); +/*! \brief Move all audiohooks from one channel to another + * + * \note It is required that both old_chan and new_chan are locked prior to calling + * this function. Besides needing to protect the data within the channels, not locking + * these channels can lead to a potential deadlock. + * + * \param old_chan The source of the audiohooks being moved + * \param new_chan The destination channel for the audiohooks to be moved to + */ +void ast_audiohook_move_all(struct ast_channel *old_chan, struct ast_channel *new_chan); + /*! * \brief Detach specified source audiohook from channel * diff --git a/include/asterisk/framehook.h b/include/asterisk/framehook.h index f33927c7b..8a58323f2 100644 --- a/include/asterisk/framehook.h +++ b/include/asterisk/framehook.h @@ -212,7 +212,19 @@ typedef void (*ast_framehook_destroy_callback)(void *data); */ typedef int (*ast_framehook_consume_callback)(void *data, enum ast_frame_type type); -#define AST_FRAMEHOOK_INTERFACE_VERSION 2 +/*! + * \brief This callback is called when a masquerade occurs on a channel with a framehook + * \since 12 + * + * \param data, The data pointer provided at framehook initialization. + * \param framehook_id, The framehook ID where the framehook lives now + * \param old_chan, The channel that was masqueraded. + * \param new_chan, The channel that the masqueraded channel became. + */ +typedef void (*ast_framehook_chan_fixup_callback)(void *data, int framehook_id, + struct ast_channel *old_chan, struct ast_channel *new_chan); + +#define AST_FRAMEHOOK_INTERFACE_VERSION 3 /*! This interface is required for attaching a framehook to a channel. */ struct ast_framehook_interface { /*! framehook interface version number */ @@ -226,6 +238,13 @@ struct ast_framehook_interface { * frames of a specific type at this time. If this callback is not implemented it is assumed that the * framehook will consume frames of all types. */ ast_framehook_consume_callback consume_cb; + /*! chan_fixup_cb is optional. This function is called when the channel that a framehook is running + * on is masqueraded and should be used to move any essential framehook data onto the channel the + * old channel was masqueraded to. */ + ast_framehook_chan_fixup_callback chan_fixup_cb; + /*! disable_inheritance is optional. If set to non-zero, when a channel using this framehook is + * masqueraded, detach and destroy the framehook instead of moving it to the new channel. */ + int disable_inheritance; /*! This pointer can represent any custom data to be stored on the !framehook. This * data pointer will be provided during each event callback which allows the framehook * to store any stateful data associated with the application using the hook. */ @@ -282,6 +301,18 @@ int ast_framehook_detach(struct ast_channel *chan, int framehook_id); int ast_framehook_list_destroy(struct ast_channel *chan); /*! + * \brief This is used by the channel API during a masquerade operation + * to move all mobile framehooks from the original channel to the clone channel. + * \since 12.5.0 + * + * \pre Both channels must be locked prior to this function call. + * + * \param old_chan The channel being cloned from + * \param new_chan The channel being cloned to + */ +void ast_framehook_list_fixup(struct ast_channel *old_chan, struct ast_channel *new_chan); + +/*! * \brief This is used by the channel API push a frame read event to a channel's framehook list. * \since 1.8 * diff --git a/include/asterisk/res_fax.h b/include/asterisk/res_fax.h index 4d1ada6ef..b0a1a221b 100644 --- a/include/asterisk/res_fax.h +++ b/include/asterisk/res_fax.h @@ -181,6 +181,10 @@ struct ast_fax_session_details { int gateway_timeout; /*! the id of the faxdetect framehook for this channel */ int faxdetect_id; + /*! The timeout for this fax detect in seconds */ + int faxdetect_timeout; + /*! flags used for fax detection */ + int faxdetect_flags; }; struct ast_fax_tech; |