mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-20 20:44:20 +00:00
Bridging: Allow channels to define bridging hooks
This patch allows the current owner of a channel to define various feature hooks to be made available once the channel has entered a bridge. This includes any hooks that are setup on the ast_bridge_features struct such as DTMF hooks, bridge event hooks (join, leave, etc.), and interval hooks. Review: https://reviewboard.asterisk.org/r/3649/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -721,6 +721,14 @@ int ast_bridge_features_set_limits(struct ast_bridge_features *features, struct
|
||||
*/
|
||||
void ast_bridge_features_set_flag(struct ast_bridge_features *features, unsigned int flag);
|
||||
|
||||
/*!
|
||||
* \brief Merge one ast_bridge_features into another
|
||||
*
|
||||
* \param into The ast_bridge_features that will be merged into
|
||||
* \param from The ast_bridge_features that will be merged from
|
||||
*/
|
||||
void ast_bridge_features_merge(struct ast_bridge_features *into, const struct ast_bridge_features *from);
|
||||
|
||||
/*!
|
||||
* \brief Initialize bridge features structure
|
||||
*
|
||||
|
@@ -4488,4 +4488,44 @@ int ast_channel_unsuppress(struct ast_channel *chan, unsigned int direction, enu
|
||||
*/
|
||||
void ast_channel_end_dtmf(struct ast_channel *chan, char digit, struct timeval start, const char *why);
|
||||
|
||||
struct ast_bridge_features;
|
||||
|
||||
/*!
|
||||
* \brief Gets the channel-attached features a channel has access to upon being bridged.
|
||||
*
|
||||
* \note The channel must be locked when calling this function.
|
||||
*
|
||||
* \param chan Which channel to get features for
|
||||
*
|
||||
* \retval non-NULL The features currently set for this channel
|
||||
* \retval NULL if the features have not been set
|
||||
*/
|
||||
struct ast_bridge_features *ast_channel_feature_hooks_get(struct ast_channel *chan);
|
||||
|
||||
/*!
|
||||
* \brief Appends to the channel-attached features a channel has access to upon being bridged.
|
||||
*
|
||||
* \note The channel must be locked when calling this function.
|
||||
*
|
||||
* \param chan Which channel to set features for
|
||||
* \param features The feature set to append to the channel's features
|
||||
*
|
||||
* \retval 0 on success
|
||||
* \retval -1 on failure
|
||||
*/
|
||||
int ast_channel_feature_hooks_append(struct ast_channel *chan, struct ast_bridge_features *features);
|
||||
|
||||
/*!
|
||||
* \brief Sets the channel-attached features a channel has access to upon being bridged.
|
||||
*
|
||||
* \note The channel must be locked when calling this function.
|
||||
*
|
||||
* \param chan Which channel to set features for
|
||||
* \param features The feature set with which to replace the channel's features
|
||||
*
|
||||
* \retval 0 on success
|
||||
* \retval -1 on failure
|
||||
*/
|
||||
int ast_channel_feature_hooks_replace(struct ast_channel *chan, struct ast_bridge_features *features);
|
||||
|
||||
#endif /* _ASTERISK_CHANNEL_H */
|
||||
|
Reference in New Issue
Block a user