diff options
author | Richard Mudgett <rmudgett@digium.com> | 2013-08-21 15:51:19 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2013-08-21 15:51:19 +0000 |
commit | d213dfa30ffbc834dcc643beb46a8ba0b0f49f01 (patch) | |
tree | 2e9641ff56b0a301ecb4e312654392142800abbe /include/asterisk | |
parent | 25e38dfc9b8a0dd96851f5de970e6a293e37dda6 (diff) |
Fix several interrelated issues dealing with the holding bridge technology.
* Added an option flags parameter to interval hooks. Interval hooks now
can specify if the callback will affect the media path or not.
* Added an option flags parameter to the bridge action custom callback.
The action callback now can specify if the callback will affect the media
path or not.
* Made the holding bridge technology reexamine the participant idle mode
option whenever the entertainment is restarted.
* Fixed app_agent_pool waiting agents needlessly starting and stopping MOH
every second by specifying the heartbeat interval hook as not affecting
the media path.
* Fixed app_agent_pool agent alert from restarting the MOH after the alert
beep. The agent entertainment is now changed from MOH to silence after
the alert beep.
* Fixed holding bridge technology to defer starting the entertainment. It
was previously a mixture of immediate and deferred.
* Fixed holding bridge technology to immediately stop the entertainment.
It was previously a mixture of immediate and deferred. If the channel
left the bridging system, any deferred stopping was discarded before
taking effect.
* Miscellaneous holding bridge technology rework coding improvements.
Review: https://reviewboard.asterisk.org/r/2761/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/bridge_channel.h | 15 | ||||
-rw-r--r-- | include/asterisk/bridge_features.h | 9 |
2 files changed, 22 insertions, 2 deletions
diff --git a/include/asterisk/bridge_channel.h b/include/asterisk/bridge_channel.h index 39526611a..2d1dfd4f0 100644 --- a/include/asterisk/bridge_channel.h +++ b/include/asterisk/bridge_channel.h @@ -530,11 +530,17 @@ int ast_bridge_channel_queue_playfile(struct ast_bridge_channel *bridge_channel, */ typedef void (*ast_bridge_custom_callback_fn)(struct ast_bridge_channel *bridge_channel, const void *payload, size_t payload_size); +enum ast_bridge_channel_custom_callback_option { + /*! The callback temporarily affects media. (Like a custom playfile.) */ + AST_BRIDGE_CHANNEL_CB_OPTION_MEDIA = (1 << 0), +}; + /*! * \brief Write a bridge action custom callback frame into the bridge. * \since 12.0.0 * * \param bridge_channel Which channel is putting the frame into the bridge + * \param flags Custom callback option flags. * \param callback Custom callback run on a bridge channel. * \param payload Data to pass to the callback. (NULL if none). * \param payload_size Size of the payload if payload is non-NULL. A number otherwise. @@ -546,13 +552,16 @@ typedef void (*ast_bridge_custom_callback_fn)(struct ast_bridge_channel *bridge_ * \retval 0 on success. * \retval -1 on error. */ -int ast_bridge_channel_write_callback(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size); +int ast_bridge_channel_write_callback(struct ast_bridge_channel *bridge_channel, + enum ast_bridge_channel_custom_callback_option flags, + ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size); /*! * \brief Queue a bridge action custom callback frame onto the bridge channel. * \since 12.0.0 * * \param bridge_channel Which channel to put the frame onto. + * \param flags Custom callback option flags. * \param callback Custom callback run on a bridge channel. * \param payload Data to pass to the callback. (NULL if none). * \param payload_size Size of the payload if payload is non-NULL. A number otherwise. @@ -564,7 +573,9 @@ int ast_bridge_channel_write_callback(struct ast_bridge_channel *bridge_channel, * \retval 0 on success. * \retval -1 on error. */ -int ast_bridge_channel_queue_callback(struct ast_bridge_channel *bridge_channel, ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size); +int ast_bridge_channel_queue_callback(struct ast_bridge_channel *bridge_channel, + enum ast_bridge_channel_custom_callback_option flags, + ast_bridge_custom_callback_fn callback, const void *payload, size_t payload_size); /*! * \brief Have a bridge channel park a channel in the bridge diff --git a/include/asterisk/bridge_features.h b/include/asterisk/bridge_features.h index ba3cee4e9..2f89be9b2 100644 --- a/include/asterisk/bridge_features.h +++ b/include/asterisk/bridge_features.h @@ -208,6 +208,11 @@ struct ast_bridge_hook_dtmf { struct ast_bridge_hook_dtmf_parms dtmf; }; +enum ast_bridge_hook_timer_option { + /*! The timer temporarily affects media. (Like a custom playfile.) */ + AST_BRIDGE_HOOK_TIMER_OPTION_MEDIA = (1 << 0), +}; + /*! Extra parameters for an interval timer hook. */ struct ast_bridge_hook_timer_parms { /*! Time at which the hook should actually trip */ @@ -218,6 +223,8 @@ struct ast_bridge_hook_timer_parms { unsigned int interval; /*! Sequence number for the hook to ensure expiration ordering */ unsigned int seqno; + /*! Option flags determining how callback is called. */ + unsigned int flags; }; /*! Timer specific hook. */ @@ -553,6 +560,7 @@ int ast_bridge_dtmf_hook(struct ast_bridge_features *features, * \brief Attach an interval hook to a bridge features structure * * \param features Bridge features structure + * \param flags Interval timer callback option flags. * \param interval The interval that the hook should execute at in milliseconds * \param callback Function to execute upon activation * \param hook_pvt Unique data @@ -572,6 +580,7 @@ int ast_bridge_dtmf_hook(struct ast_bridge_features *features, * data may be provided to the hook_pvt parameter. */ int ast_bridge_interval_hook(struct ast_bridge_features *features, + enum ast_bridge_hook_timer_option flags, unsigned int interval, ast_bridge_hook_callback callback, void *hook_pvt, |