diff options
author | Richard Mudgett <rmudgett@digium.com> | 2013-08-22 21:09:52 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2013-08-22 21:09:52 +0000 |
commit | 477dea46616c0a6b79706f10349aaf9a87832e0e (patch) | |
tree | 50244a0102181406d83928d23e0ce45ff64169cf /res | |
parent | 24683444ac07743e202c6f6cae0364ee4057df4c (diff) |
Bridge API: Set a cause code on a channel when it is ejected from a bridge.
The cause code needs to be passed from the disconnecting channel to the
bridge peers if the disconnecting channel dissolves the bridge.
* Made the call to an app_agent_pool agent disconnect with the busy cause
code if the agent does not ack the call in time or hangs up before acking
the call.
(closes issue ASTERISK-22042)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2772/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397472 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/parking/parking_applications.c | 4 | ||||
-rw-r--r-- | res/parking/parking_bridge_features.c | 13 | ||||
-rw-r--r-- | res/res_parking.c | 2 | ||||
-rw-r--r-- | res/res_stasis.c | 2 |
4 files changed, 13 insertions, 8 deletions
diff --git a/res/parking/parking_applications.c b/res/parking/parking_applications.c index 29f38b4b8..e34b403e2 100644 --- a/res/parking/parking_applications.c +++ b/res/parking/parking_applications.c @@ -618,14 +618,14 @@ static int parked_call_app_exec(struct ast_channel *chan, const char *data) /* Move the parkee into the new bridge */ if (ast_bridge_move(retrieval_bridge, lot->parking_bridge, pu->chan, NULL, 0)) { - ast_bridge_destroy(retrieval_bridge); + ast_bridge_destroy(retrieval_bridge, 0); return -1; } /* Initialize our bridge features */ res = ast_bridge_features_init(&chan_features); if (res) { - ast_bridge_destroy(retrieval_bridge); + ast_bridge_destroy(retrieval_bridge, 0); ast_bridge_features_cleanup(&chan_features); return -1; } diff --git a/res/parking/parking_bridge_features.c b/res/parking/parking_bridge_features.c index 5ad0538c5..1f0237b9e 100644 --- a/res/parking/parking_bridge_features.c +++ b/res/parking/parking_bridge_features.c @@ -42,6 +42,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/stasis.h" #include "asterisk/module.h" #include "asterisk/core_local.h" +#include "asterisk/causes.h" struct parked_subscription_datastore { struct stasis_subscription *parked_subscription; @@ -483,7 +484,8 @@ static int parking_duration_callback(struct ast_bridge_channel *bridge_channel, user->resolution = PARK_TIMEOUT; ao2_unlock(user); - ast_bridge_channel_leave_bridge(bridge_channel, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE); + ast_bridge_channel_leave_bridge(bridge_channel, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, + AST_CAUSE_NORMAL_CLEARING); /* Set parking timeout channel variables */ snprintf(parking_space, sizeof(parking_space), "%d", user->parking_space); @@ -571,14 +573,17 @@ void say_parking_space(struct ast_bridge_channel *bridge_channel, const char *pa if (sscanf(payload, "%u %u", &hangup_after, &numeric_value) != 2) { /* If say_parking_space is called with a non-numeric string, we have a problem. */ ast_assert(0); - ast_bridge_channel_leave_bridge(bridge_channel, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE); + ast_bridge_channel_leave_bridge(bridge_channel, + BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, AST_CAUSE_NORMAL_CLEARING); return; } - ast_say_digits(bridge_channel->chan, numeric_value, "", ast_channel_language(bridge_channel->chan)); + ast_say_digits(bridge_channel->chan, numeric_value, "", + ast_channel_language(bridge_channel->chan)); if (hangup_after) { - ast_bridge_channel_leave_bridge(bridge_channel, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE); + ast_bridge_channel_leave_bridge(bridge_channel, + BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, AST_CAUSE_NORMAL_CLEARING); } } diff --git a/res/res_parking.c b/res/res_parking.c index 33cc56071..12893dba2 100644 --- a/res/res_parking.c +++ b/res/res_parking.c @@ -580,7 +580,7 @@ static void parking_lot_destructor(void *obj) struct parking_lot *lot = obj; if (lot->parking_bridge) { - ast_bridge_destroy(lot->parking_bridge); + ast_bridge_destroy(lot->parking_bridge, 0); } ao2_cleanup(lot->parked_users); ao2_cleanup(lot->cfg); diff --git a/res/res_stasis.c b/res/res_stasis.c index 39f6be134..963e70d9e 100644 --- a/res/res_stasis.c +++ b/res/res_stasis.c @@ -471,7 +471,7 @@ void stasis_app_bridge_destroy(const char *bridge_id) return; } ao2_unlink(app_bridges, bridge); - ast_bridge_destroy(bridge); + ast_bridge_destroy(bridge, 0); } int app_send_start_msg(struct app *app, struct ast_channel *chan, |