summaryrefslogtreecommitdiff
path: root/apps/app_bridgewait.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2013-08-22 21:09:52 +0000
committerRichard Mudgett <rmudgett@digium.com>2013-08-22 21:09:52 +0000
commit477dea46616c0a6b79706f10349aaf9a87832e0e (patch)
tree50244a0102181406d83928d23e0ce45ff64169cf /apps/app_bridgewait.c
parent24683444ac07743e202c6f6cae0364ee4057df4c (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 'apps/app_bridgewait.c')
-rw-r--r--apps/app_bridgewait.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/app_bridgewait.c b/apps/app_bridgewait.c
index 36747056e..8e615f05f 100644
--- a/apps/app_bridgewait.c
+++ b/apps/app_bridgewait.c
@@ -48,6 +48,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/bridge.h"
#include "asterisk/musiconhold.h"
#include "asterisk/astobj2.h"
+#include "asterisk/causes.h"
/*** DOCUMENTATION
<application name="BridgeWait" language="en_US">
@@ -127,8 +128,9 @@ struct wait_bridge_wrapper {
static void wait_bridge_wrapper_destructor(void *obj)
{
struct wait_bridge_wrapper *wrapper = obj;
+
if (wrapper->bridge) {
- ast_bridge_destroy(wrapper->bridge);
+ ast_bridge_destroy(wrapper->bridge, 0);
}
}
@@ -204,7 +206,8 @@ AST_APP_OPTIONS(bridgewait_opts, {
static int bridgewait_timeout_callback(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
{
ast_verb(3, "Channel %s timed out.\n", ast_channel_name(bridge_channel->chan));
- ast_bridge_channel_leave_bridge(bridge_channel, BRIDGE_CHANNEL_STATE_END);
+ ast_bridge_channel_leave_bridge(bridge_channel, BRIDGE_CHANNEL_STATE_END,
+ AST_CAUSE_NORMAL_CLEARING);
return -1;
}
@@ -321,9 +324,8 @@ static struct wait_bridge_wrapper *wait_bridge_wrapper_alloc(const char *bridge_
bridge_wrapper = ao2_alloc_options(sizeof(*bridge_wrapper) + strlen(bridge_name) + 1,
wait_bridge_wrapper_destructor, AO2_ALLOC_OPT_LOCK_NOLOCK);
-
if (!bridge_wrapper) {
- ast_bridge_destroy(bridge);
+ ast_bridge_destroy(bridge, 0);
return NULL;
}