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
This commit is contained in:
Richard Mudgett
2013-08-22 21:09:52 +00:00
parent 24683444ac
commit 477dea4661
17 changed files with 184 additions and 112 deletions

View File

@@ -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);
}
}