mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user