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 /apps | |
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 'apps')
-rw-r--r-- | apps/app_agent_pool.c | 15 | ||||
-rw-r--r-- | apps/app_bridgewait.c | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/apps/app_agent_pool.c b/apps/app_agent_pool.c index 286a937d0..d4446ceb5 100644 --- a/apps/app_agent_pool.c +++ b/apps/app_agent_pool.c @@ -1202,7 +1202,7 @@ static int bridge_agent_hold_push(struct ast_bridge *self, struct ast_bridge_cha /* Add heartbeat interval hook. */ ao2_ref(agent, +1); - if (ast_bridge_interval_hook(bridge_channel->features, 1000, + if (ast_bridge_interval_hook(bridge_channel->features, 0, 1000, bridge_agent_hold_heartbeat, agent, __ao2_cleanup, AST_BRIDGE_HOOK_REMOVE_ON_PULL)) { ao2_ref(agent, -1); res = -1; @@ -1696,6 +1696,13 @@ static void agent_alert(struct ast_bridge_channel *bridge_channel, const void *p return; } + /* Change holding bridge participant role's idle mode to silence */ + ast_bridge_channel_lock_bridge(bridge_channel); + ast_bridge_channel_clear_roles(bridge_channel); + ast_channel_set_bridge_role_option(bridge_channel->chan, "holding_participant", "idle_mode", "silence"); + ast_bridge_channel_establish_roles(bridge_channel); + ast_bridge_unlock(bridge_channel->bridge); + /* Alert the agent. */ agent_lock(agent); playfile = ast_strdupa(agent->cfg->beep_sound); @@ -1724,8 +1731,8 @@ static void agent_alert(struct ast_bridge_channel *bridge_channel, const void *p static int send_alert_to_agent(struct ast_bridge_channel *bridge_channel, const char *agent_id) { - return ast_bridge_channel_queue_callback(bridge_channel, agent_alert, agent_id, - strlen(agent_id) + 1); + return ast_bridge_channel_queue_callback(bridge_channel, + AST_BRIDGE_CHANNEL_CB_OPTION_MEDIA, agent_alert, agent_id, strlen(agent_id) + 1); } static int send_colp_to_agent(struct ast_bridge_channel *bridge_channel, struct ast_party_connected_line *connected) @@ -1797,7 +1804,7 @@ static int agent_request_exec(struct ast_channel *chan, const char *data) /* Add safety timeout hook. */ ao2_ref(agent, +1); - if (ast_bridge_interval_hook(&caller_features, CALLER_SAFETY_TIMEOUT_TIME, + if (ast_bridge_interval_hook(&caller_features, 0, CALLER_SAFETY_TIMEOUT_TIME, caller_safety_timeout, agent, __ao2_cleanup, AST_BRIDGE_HOOK_REMOVE_ON_PULL)) { ao2_ref(agent, -1); ast_bridge_features_cleanup(&caller_features); diff --git a/apps/app_bridgewait.c b/apps/app_bridgewait.c index f97f5f977..36747056e 100644 --- a/apps/app_bridgewait.c +++ b/apps/app_bridgewait.c @@ -223,7 +223,7 @@ static int apply_option_timeout(struct ast_bridge_features *features, char *dura } duration *= 1000; - if (ast_bridge_interval_hook(features, duration, bridgewait_timeout_callback, + if (ast_bridge_interval_hook(features, 0, duration, bridgewait_timeout_callback, NULL, NULL, AST_BRIDGE_HOOK_REMOVE_ON_PULL)) { ast_log(LOG_ERROR, "Timeout option 'S': Could not create timer.\n"); return -1; |