mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 20:56:39 +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:
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user