diff options
author | Richard Mudgett <rmudgett@digium.com> | 2013-05-21 18:00:22 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2013-05-21 18:00:22 +0000 |
commit | 3d63833bd6c869b7efa383e8dea14be1a6eff998 (patch) | |
tree | 34957dd051b8f67c7cc58a510e24ee3873a61ad4 /include/asterisk/bridging_features.h | |
parent | e1e1cc2deefb92f8b43825f1f34e619354737842 (diff) |
Merge in the bridge_construction branch to make the system use the Bridging API.
Breaks many things until they can be reworked. A partial list:
chan_agent
chan_dahdi, chan_misdn, chan_iax2 native bridging
app_queue
COLP updates
DTMF attended transfers
Protocol attended transfers
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/bridging_features.h')
-rw-r--r-- | include/asterisk/bridging_features.h | 476 |
1 files changed, 418 insertions, 58 deletions
diff --git a/include/asterisk/bridging_features.h b/include/asterisk/bridging_features.h index 1323a6da9..bb792a815 100644 --- a/include/asterisk/bridging_features.h +++ b/include/asterisk/bridging_features.h @@ -30,10 +30,36 @@ extern "C" { /*! \brief Flags used for bridge features */ enum ast_bridge_feature_flags { - /*! Upon hangup the bridge should be discontinued */ - AST_BRIDGE_FLAG_DISSOLVE = (1 << 0), + /*! Upon channel hangup all bridge participants should be kicked out. */ + AST_BRIDGE_FLAG_DISSOLVE_HANGUP = (1 << 0), + /*! The last channel to leave the bridge dissolves it. */ + AST_BRIDGE_FLAG_DISSOLVE_EMPTY = (1 << 1), /*! Move between bridging technologies as needed. */ - AST_BRIDGE_FLAG_SMART = (1 << 1), + AST_BRIDGE_FLAG_SMART = (1 << 2), + /*! Bridge channels cannot be merged from this bridge. */ + AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM = (1 << 3), + /*! Bridge channels cannot be merged to this bridge. */ + AST_BRIDGE_FLAG_MERGE_INHIBIT_TO = (1 << 4), + /*! Bridge channels cannot be local channel swap optimized from this bridge. */ + AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM = (1 << 5), + /*! Bridge channels cannot be local channel swap optimized to this bridge. */ + AST_BRIDGE_FLAG_SWAP_INHIBIT_TO = (1 << 6), + /*! Bridge channels can be moved to another bridge only by masquerade (ConfBridge) */ + AST_BRIDGE_FLAG_MASQUERADE_ONLY = (1 << 7), + /*! Bridge does not allow transfers of channels out */ + AST_BRIDGE_FLAG_TRANSFER_PROHIBITED = (1 << 6), + /*! Bridge transfers require transfer of entire bridge rather than individual channels */ + AST_BRIDGE_FLAG_TRANSFER_BRIDGE_ONLY = (1 << 7), +}; + +/*! \brief Flags used for per bridge channel features */ +enum ast_bridge_channel_feature_flags { + /*! Upon channel hangup all bridge participants should be kicked out. */ + AST_BRIDGE_CHANNEL_FLAG_DISSOLVE_HANGUP = (1 << 0), + /*! This channel leaves the bridge if all participants have this flag set. */ + AST_BRIDGE_CHANNEL_FLAG_LONELY = (1 << 1), + /*! This channel cannot be moved to another bridge. */ + AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE = (1 << 2), }; /*! \brief Built in DTMF features */ @@ -52,32 +78,66 @@ enum ast_bridge_builtin_feature { * AST_BRIDGE_CHANNEL_STATE_END. */ AST_BRIDGE_BUILTIN_HANGUP, + /*! + * DTMF based Park + * + * \details The bridge is parked and the channel hears the + * parking slot to which it was parked. + */ + AST_BRIDGE_BUILTIN_PARKCALL, +/* BUGBUG does Monitor and/or MixMonitor require a two party bridge? MixMonitor is used by ConfBridge so maybe it doesn't. */ + /*! + * DTMF one-touch-record toggle using Monitor app. + * + * \note Only valid on two party bridges. + */ + AST_BRIDGE_BUILTIN_AUTOMON, + /*! + * DTMF one-touch-record toggle using MixMonitor app. + * + * \note Only valid on two party bridges. + */ + AST_BRIDGE_BUILTIN_AUTOMIXMON, /*! End terminator for list of built in features. Must remain last. */ AST_BRIDGE_BUILTIN_END }; +enum ast_bridge_builtin_interval { + /*! Apply Call Duration Limits */ + AST_BRIDGE_BUILTIN_INTERVAL_LIMITS, + + /*! End terminator for list of built in interval features. Must remain last. */ + AST_BRIDGE_BUILTIN_INTERVAL_END +}; + struct ast_bridge; struct ast_bridge_channel; /*! - * \brief Features hook callback type + * \brief Hook callback type * * \param bridge The bridge that the channel is part of * \param bridge_channel Channel executing the feature * \param hook_pvt Private data passed in when the hook was created * - * \retval 0 success - * \retval -1 failure + * For interval hooks: + * \retval 0 Setup to fire again at the last interval. + * \retval positive Setup to fire again at the new interval returned. + * \retval -1 Remove the callback hook. + * + * For other hooks: + * \retval 0 Keep the callback hook. + * \retval -1 Remove the callback hook. */ -typedef int (*ast_bridge_features_hook_callback)(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, void *hook_pvt); +typedef int (*ast_bridge_hook_callback)(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, void *hook_pvt); /*! - * \brief Features hook pvt destructor callback + * \brief Hook pvt destructor callback * - * \param hook_pvt Private data passed in when the hook was create to destroy + * \param hook_pvt Private data passed in when the hook was created to destroy */ -typedef void (*ast_bridge_features_hook_pvt_destructor)(void *hook_pvt); +typedef void (*ast_bridge_hook_pvt_destructor)(void *hook_pvt); /*! * \brief Talking indicator callback @@ -86,13 +146,13 @@ typedef void (*ast_bridge_features_hook_pvt_destructor)(void *hook_pvt); * to receive updates on when a bridge_channel has started and stopped * talking * - * \param bridge The bridge that the channel is part of * \param bridge_channel Channel executing the feature + * \param talking TRUE if the channel is now talking * * \retval 0 success * \retval -1 failure */ -typedef void (*ast_bridge_talking_indicate_callback)(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, void *pvt_data); +typedef void (*ast_bridge_talking_indicate_callback)(struct ast_bridge_channel *bridge_channel, void *pvt_data, int talking); typedef void (*ast_bridge_talking_indicate_destructor)(void *pvt_data); @@ -100,30 +160,68 @@ typedef void (*ast_bridge_talking_indicate_destructor)(void *pvt_data); /*! * \brief Maximum length of a DTMF feature string */ -#define MAXIMUM_DTMF_FEATURE_STRING 8 +#define MAXIMUM_DTMF_FEATURE_STRING (11 + 1) -/*! - * \brief Structure that is the essence of a features hook - */ -struct ast_bridge_features_hook { +/*! Extra parameters for a DTMF feature hook. */ +struct ast_bridge_hook_dtmf { /*! DTMF String that is examined during a feature hook lookup */ - char dtmf[MAXIMUM_DTMF_FEATURE_STRING]; - /*! Callback that is called when DTMF string is matched */ - ast_bridge_features_hook_callback callback; + char code[MAXIMUM_DTMF_FEATURE_STRING]; +}; + +/*! Extra parameters for an interval timer hook. */ +struct ast_bridge_hook_timer { + /*! Time at which the hook should actually trip */ + struct timeval trip_time; + /*! Heap index for interval hook */ + ssize_t heap_index; + /*! Interval that the hook should execute at in milliseconds */ + unsigned int interval; + /*! Sequence number for the hook to ensure expiration ordering */ + unsigned int seqno; +}; + +/* BUGBUG Need to be able to selectively remove DTMF, hangup, and interval hooks. */ +/*! \brief Structure that is the essence of a feature hook. */ +struct ast_bridge_hook { + /*! Linked list information */ + AST_LIST_ENTRY(ast_bridge_hook) entry; + /*! Callback that is called when hook is tripped */ + ast_bridge_hook_callback callback; /*! Callback to destroy hook_pvt data right before destruction. */ - ast_bridge_features_hook_pvt_destructor destructor; + ast_bridge_hook_pvt_destructor destructor; /*! Unique data that was passed into us */ void *hook_pvt; - /*! Linked list information */ - AST_LIST_ENTRY(ast_bridge_features_hook) entry; + /*! TRUE if the hook is removed when the channel is pulled from the bridge. */ + unsigned int remove_on_pull:1; + /*! Extra hook parameters. */ + union { + /*! Extra parameters for a DTMF feature hook. */ + struct ast_bridge_hook_dtmf dtmf; + /*! Extra parameters for an interval timer hook. */ + struct ast_bridge_hook_timer timer; + } parms; }; +#define BRIDGE_FEATURES_INTERVAL_RATE 10 + /*! * \brief Structure that contains features information */ struct ast_bridge_features { - /*! Attached DTMF based feature hooks */ - AST_LIST_HEAD_NOLOCK(, ast_bridge_features_hook) hooks; + /*! Attached DTMF feature hooks */ + struct ao2_container *dtmf_hooks; + /*! Attached hangup interception hooks container */ + struct ao2_container *hangup_hooks; + /*! Attached bridge channel join interception hooks container */ + struct ao2_container *join_hooks; + /*! Attached bridge channel leave interception hooks container */ + struct ao2_container *leave_hooks; + /*! Attached interval hooks */ + struct ast_heap *interval_hooks; + /*! Used to determine when interval based features should be checked */ + struct ast_timer *interval_timer; + /*! Limits feature data */ + struct ast_bridge_features_limits *limits; /*! Callback to indicate when a bridge channel has started and stopped talking */ ast_bridge_talking_indicate_callback talker_cb; /*! Callback to destroy any pvt data stored for the talker. */ @@ -132,19 +230,21 @@ struct ast_bridge_features { void *talker_pvt_data; /*! Feature flags that are enabled */ struct ast_flags feature_flags; - /*! Bit to indicate that the feature_flags and hook list is setup */ + /*! Used to assign the sequence number to the next interval hook added. */ + unsigned int interval_sequence; + /*! TRUE if feature_flags is setup */ unsigned int usable:1; - /*! Bit to indicate whether the channel/bridge is muted or not */ + /*! TRUE if the channel/bridge is muted. */ unsigned int mute:1; - /*! Bit to indicate whether DTMF should be passed into the bridge tech or not. */ + /*! TRUE if DTMF should be passed into the bridge tech. */ unsigned int dtmf_passthrough:1; - }; /*! * \brief Structure that contains configuration information for the blind transfer built in feature */ struct ast_bridge_features_blind_transfer { +/* BUGBUG the context should be figured out based upon TRANSFER_CONTEXT channel variable of A/B or current context of A/B. More appropriate for when channel moved to other bridges. */ /*! Context to use for transfers */ char context[AST_MAX_CONTEXT]; }; @@ -153,14 +253,38 @@ struct ast_bridge_features_blind_transfer { * \brief Structure that contains configuration information for the attended transfer built in feature */ struct ast_bridge_features_attended_transfer { +/* BUGBUG the context should be figured out based upon TRANSFER_CONTEXT channel variable of A/B or current context of A/B. More appropriate for when channel moved to other bridges. */ + /*! Context to use for transfers */ + char context[AST_MAX_CONTEXT]; /*! DTMF string used to abort the transfer */ char abort[MAXIMUM_DTMF_FEATURE_STRING]; /*! DTMF string used to turn the transfer into a three way conference */ char threeway[MAXIMUM_DTMF_FEATURE_STRING]; /*! DTMF string used to complete the transfer */ char complete[MAXIMUM_DTMF_FEATURE_STRING]; - /*! Context to use for transfers */ - char context[AST_MAX_CONTEXT]; +}; + +/*! + * \brief Structure that contains configuration information for the limits feature + */ +struct ast_bridge_features_limits { + /*! Maximum duration that the channel is allowed to be in the bridge (specified in milliseconds) */ + unsigned int duration; + /*! Duration into the call when warnings should begin (specified in milliseconds or 0 to disable) */ + unsigned int warning; + /*! Interval between the warnings (specified in milliseconds or 0 to disable) */ + unsigned int frequency; + + AST_DECLARE_STRING_FIELDS( + /*! Sound file to play when the maximum duration is reached (if empty, then nothing will be played) */ + AST_STRING_FIELD(duration_sound); + /*! Sound file to play when the warning time is reached (if empty, then the remaining time will be played) */ + AST_STRING_FIELD(warning_sound); + /*! Sound file to play when the call is first entered (if empty, then the remaining time will be played) */ + AST_STRING_FIELD(connect_sound); + ); + /*! Time when the bridge will be terminated by the limits feature */ + struct timeval quitting_time; }; /*! @@ -182,7 +306,7 @@ struct ast_bridge_features_attended_transfer { * This registers the function bridge_builtin_attended_transfer as the function responsible for the built in * attended transfer feature. */ -int ast_bridge_features_register(enum ast_bridge_builtin_feature feature, ast_bridge_features_hook_callback callback, const char *dtmf); +int ast_bridge_features_register(enum ast_bridge_builtin_feature feature, ast_bridge_hook_callback callback, const char *dtmf); /*! * \brief Unregister a handler for a built in feature @@ -203,13 +327,154 @@ int ast_bridge_features_register(enum ast_bridge_builtin_feature feature, ast_br int ast_bridge_features_unregister(enum ast_bridge_builtin_feature feature); /*! - * \brief Attach a custom hook to a bridge features structure + * \brief Attach interval hooks to a bridge features structure + * + * \param features Bridge features structure + * \param limits Configured limits applicable to the channel + * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge. + * + * \retval 0 on success + * \retval -1 on failure + */ +typedef int (*ast_bridge_builtin_set_limits_fn)(struct ast_bridge_features *features, struct ast_bridge_features_limits *limits, int remove_on_pull); + +/*! + * \brief Register a handler for a built in interval feature + * + * \param interval The interval feature that the handler will be responsible for + * \param callback the Callback function that will handle it + * + * \retval 0 on success + * \retval -1 on failure + * + * Example usage: + * + * \code + * ast_bridge_interval_register(AST_BRIDGE_BUILTIN_INTERVAL_LIMITS, bridge_builtin_set_limits); + * \endcode + * + * This registers the function bridge_builtin_set_limits as the function responsible for the built in + * duration limit feature. + */ +int ast_bridge_interval_register(enum ast_bridge_builtin_interval interval, ast_bridge_builtin_set_limits_fn callback); + +/*! + * \brief Unregisters a handler for a built in interval feature + * + * \param interval the interval feature to unregister + * + * \retval 0 on success + * \retval -1 on failure + * + * Example usage: + * + * \code + * ast_bridge_interval_unregister(AST_BRIDGE_BULTIN_INTERVAL_LIMITS) + * /endcode + * + * This unregisters the function that is handling the built in duration limit feature. + */ +int ast_bridge_interval_unregister(enum ast_bridge_builtin_interval interval); + +/*! + * \brief Attach a bridge channel join hook to a bridge features structure + * + * \param features Bridge features structure + * \param callback Function to execute upon activation + * \param hook_pvt Unique data + * \param destructor Optional destructor callback for hook_pvt data + * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge. + * + * \retval 0 on success + * \retval -1 on failure + * + * Example usage: + * + * \code + * struct ast_bridge_features features; + * ast_bridge_features_init(&features); + * ast_bridge_join_hook(&features, join_callback, NULL, NULL, 0); + * \endcode + * + * This makes the bridging core call join_callback when a + * channel successfully joins the bridging system. A pointer to + * useful data may be provided to the hook_pvt parameter. + */ +int ast_bridge_join_hook(struct ast_bridge_features *features, + ast_bridge_hook_callback callback, + void *hook_pvt, + ast_bridge_hook_pvt_destructor destructor, + int remove_on_pull); + +/*! + * \brief Attach a bridge channel leave hook to a bridge features structure + * + * \param features Bridge features structure + * \param callback Function to execute upon activation + * \param hook_pvt Unique data + * \param destructor Optional destructor callback for hook_pvt data + * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge. + * + * \retval 0 on success + * \retval -1 on failure + * + * Example usage: + * + * \code + * struct ast_bridge_features features; + * ast_bridge_features_init(&features); + * ast_bridge_leave_hook(&features, leave_callback, NULL, NULL, 0); + * \endcode + * + * This makes the bridging core call leave_callback when a + * channel successfully leaves the bridging system. A pointer + * to useful data may be provided to the hook_pvt parameter. + */ +int ast_bridge_leave_hook(struct ast_bridge_features *features, + ast_bridge_hook_callback callback, + void *hook_pvt, + ast_bridge_hook_pvt_destructor destructor, + int remove_on_pull); + +/*! + * \brief Attach a hangup hook to a bridge features structure + * + * \param features Bridge features structure + * \param callback Function to execute upon activation + * \param hook_pvt Unique data + * \param destructor Optional destructor callback for hook_pvt data + * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge. + * + * \retval 0 on success + * \retval -1 on failure + * + * Example usage: + * + * \code + * struct ast_bridge_features features; + * ast_bridge_features_init(&features); + * ast_bridge_hangup_hook(&features, hangup_callback, NULL, NULL, 0); + * \endcode + * + * This makes the bridging core call hangup_callback if a + * channel that has this hook hangs up. A pointer to useful + * data may be provided to the hook_pvt parameter. + */ +int ast_bridge_hangup_hook(struct ast_bridge_features *features, + ast_bridge_hook_callback callback, + void *hook_pvt, + ast_bridge_hook_pvt_destructor destructor, + int remove_on_pull); + +/*! + * \brief Attach a DTMF hook to a bridge features structure * * \param features Bridge features structure * \param dtmf DTMF string to be activated upon * \param callback Function to execute upon activation * \param hook_pvt Unique data * \param destructor Optional destructor callback for hook_pvt data + * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge. * * \retval 0 on success * \retval -1 on failure @@ -219,21 +484,48 @@ int ast_bridge_features_unregister(enum ast_bridge_builtin_feature feature); * \code * struct ast_bridge_features features; * ast_bridge_features_init(&features); - * ast_bridge_features_hook(&features, "#", pound_callback, NULL, NULL); + * ast_bridge_dtmf_hook(&features, "#", pound_callback, NULL, NULL, 0); * \endcode * * This makes the bridging core call pound_callback if a channel that has this * feature structure inputs the DTMF string '#'. A pointer to useful data may be * provided to the hook_pvt parameter. - * - * \note It is important that the callback set the bridge channel state back to - * AST_BRIDGE_CHANNEL_STATE_WAIT or the bridge thread will not service the channel. */ -int ast_bridge_features_hook(struct ast_bridge_features *features, +int ast_bridge_dtmf_hook(struct ast_bridge_features *features, const char *dtmf, - ast_bridge_features_hook_callback callback, + ast_bridge_hook_callback callback, void *hook_pvt, - ast_bridge_features_hook_pvt_destructor destructor); + ast_bridge_hook_pvt_destructor destructor, + int remove_on_pull); + +/*! + * \brief attach an interval hook to a bridge features structure + * + * \param features Bridge features structure + * \param interval The interval that the hook should execute at in milliseconds + * \param callback Function to execute upon activation + * \param hook_pvt Unique data + * \param destructor Optional destructor callback for hook_pvt data + * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge. + * + * \retval 0 on success + * \retval -1 on failure + * + * \code + * struct ast_bridge_features features; + * ast_bridge_features_init(&features); + * ast_bridge_interval_hook(&features, 1000, playback_callback, NULL, NULL, 0); + * \endcode + * + * This makes the bridging core call playback_callback every second. A pointer to useful + * data may be provided to the hook_pvt parameter. + */ +int ast_bridge_interval_hook(struct ast_bridge_features *features, + unsigned int interval, + ast_bridge_hook_callback callback, + void *hook_pvt, + ast_bridge_hook_pvt_destructor destructor, + int remove_on_pull); /*! * \brief Set a callback on the features structure to receive talking notifications on. @@ -257,6 +549,8 @@ void ast_bridge_features_set_talk_detector(struct ast_bridge_features *features, * \param feature Feature to enable * \param dtmf Optionally the DTMF stream to trigger the feature, if not specified it will be the default * \param config Configuration structure unique to the built in type + * \param destructor Optional destructor callback for config data + * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge. * * \retval 0 on success * \retval -1 on failure @@ -266,19 +560,72 @@ void ast_bridge_features_set_talk_detector(struct ast_bridge_features *features, * \code * struct ast_bridge_features features; * ast_bridge_features_init(&features); - * ast_bridge_features_enable(&features, AST_BRIDGE_BUILTIN_ATTENDEDTRANSFER, NULL); + * ast_bridge_features_enable(&features, AST_BRIDGE_BUILTIN_ATTENDEDTRANSFER, NULL, NULL, 0); * \endcode * * This enables the attended transfer DTMF option using the default DTMF string. An alternate * string may be provided using the dtmf parameter. Internally this is simply setting up a hook * to a built in feature callback function. */ -int ast_bridge_features_enable(struct ast_bridge_features *features, enum ast_bridge_builtin_feature feature, const char *dtmf, void *config); +int ast_bridge_features_enable(struct ast_bridge_features *features, + enum ast_bridge_builtin_feature feature, + const char *dtmf, + void *config, + ast_bridge_hook_pvt_destructor destructor, + int remove_on_pull); + +/*! + * \brief Constructor function for ast_bridge_features_limits + * + * \param limits pointer to a ast_bridge_features_limits struct that has been allocted, but not initialized + * + * \retval 0 on success + * \retval -1 on failure + */ +int ast_bridge_features_limits_construct(struct ast_bridge_features_limits *limits); + +/*! + * \brief Destructor function for ast_bridge_features_limits + * + * \param limits pointer to an ast_bridge_features_limits struct that needs to be destroyed + * + * This function does not free memory allocated to the ast_bridge_features_limits struct, it only frees elements within the struct. + * You must still call ast_free on the the struct if you allocated it with malloc. + */ +void ast_bridge_features_limits_destroy(struct ast_bridge_features_limits *limits); /*! - * \brief Set a flag on a bridge features structure + * \brief Limit the amount of time a channel may stay in the bridge and optionally play warning messages as time runs out * * \param features Bridge features structure + * \param limits Configured limits applicable to the channel + * \param remove_on_pull TRUE if remove the hook when the channel is pulled from the bridge. + * + * \retval 0 on success + * \retval -1 on failure + * + * Example usage: + * + * \code + * struct ast_bridge_features features; + * struct ast_bridge_features_limits limits; + * ast_bridge_features_init(&features); + * ast_bridge_features_limits_construct(&limits); + * ast_bridge_features_set_limits(&features, &limits, 0); + * ast_bridge_features_limits_destroy(&limits); + * \endcode + * + * This sets the maximum time the channel can be in the bridge to 10 seconds and does not play any warnings. + * + * \note This API call can only be used on a features structure that will be used in association with a bridge channel. + * \note The ast_bridge_features_limits structure must remain accessible for the lifetime of the features structure. + */ +int ast_bridge_features_set_limits(struct ast_bridge_features *features, struct ast_bridge_features_limits *limits, int remove_on_pull); + +/*! + * \brief Set a flag on a bridge channel features structure + * + * \param features Bridge channel features structure * \param flag Flag to enable * * \return Nothing @@ -288,13 +635,13 @@ int ast_bridge_features_enable(struct ast_bridge_features *features, enum ast_br * \code * struct ast_bridge_features features; * ast_bridge_features_init(&features); - * ast_bridge_features_set_flag(&features, AST_BRIDGE_FLAG_DISSOLVE); + * ast_bridge_features_set_flag(&features, AST_BRIDGE_CHANNEL_FLAG_DISSOLVE_HANGUP); * \endcode * - * This sets the AST_BRIDGE_FLAG_DISSOLVE feature to be enabled on the features structure - * 'features'. + * This sets the AST_BRIDGE_CHANNEL_FLAG_DISSOLVE_HANGUP feature + * to be enabled on the features structure 'features'. */ -void ast_bridge_features_set_flag(struct ast_bridge_features *features, enum ast_bridge_feature_flags flag); +void ast_bridge_features_set_flag(struct ast_bridge_features *features, unsigned int flag); /*! * \brief Initialize bridge features structure @@ -341,26 +688,39 @@ int ast_bridge_features_init(struct ast_bridge_features *features); void ast_bridge_features_cleanup(struct ast_bridge_features *features); /*! - * \brief Play a DTMF stream into a bridge, optionally not to a given channel + * \brief Allocate a new bridge features struct. + * \since 12.0.0 * - * \param bridge Bridge to play stream into - * \param dtmf DTMF to play - * \param chan Channel to optionally not play to + * Example usage: * - * \retval 0 on success - * \retval -1 on failure + * \code + * struct ast_bridge_features *features; + * features = ast_bridge_features_new(); + * ast_bridge_features_destroy(features); + * \endcode + * + * \retval features New allocated features struct. + * \retval NULL on error. + */ +struct ast_bridge_features *ast_bridge_features_new(void); + +/*! + * \brief Destroy an allocated bridge features struct. + * \since 12.0.0 + * + * \param features Bridge features structure * * Example usage: * * \code - * ast_bridge_dtmf_stream(bridge, "0123456789", NULL); + * struct ast_bridge_features *features; + * features = ast_bridge_features_new(); + * ast_bridge_features_destroy(features); * \endcode * - * This sends the DTMF digits '0123456789' to all channels in the bridge pointed to - * by the bridge pointer. Optionally a channel may be excluded by passing it's channel pointer - * using the chan parameter. + * \return Nothing */ -int ast_bridge_dtmf_stream(struct ast_bridge *bridge, const char *dtmf, struct ast_channel *chan); +void ast_bridge_features_destroy(struct ast_bridge_features *features); #if defined(__cplusplus) || defined(c_plusplus) } |