summaryrefslogtreecommitdiff
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-06-05 14:41:43 +0000
committerKinsey Moore <kmoore@digium.com>2012-06-05 14:41:43 +0000
commit571445ab9c9f268abfa7cdea1f80d199686c5fac (patch)
treebcaac031cac910fbc4aa613cb62700bcca8f8a48 /apps/app_dial.c
parentd210685a20c950e418b84e3c6f085e2f7f19f299 (diff)
Convert AST_FLAG_ANSWERED_ELSEWHERE usage to AST_CAUSE_ANSWERED_ELSEWHERE
This was essentially duplicated functionality where normal channels used AST_CAUSE_ANSWERED_ELSEWHERE while local channels and queues used AST_FLAG_ANSWERED_ELSEWHERE. This removes the flag and converts that usage into AST_CAUSE_ANSWERED_ELSEWHER usage. Review: https://reviewboard.asterisk.org/r/1944 (closes issue ASTERISK-19865) Patch-by: Birger Harzenetter git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index e6eebbec7..1ebad3412 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -133,8 +133,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
<para>Reset the call detail record (CDR) for this call.</para>
</option>
<option name="c">
- <para>If the Dial() application cancels this call, always set the flag to tell the channel
- driver that the call is answered elsewhere.</para>
+ <para>If the Dial() application cancels this call, always set HANGUPCAUSE to 'answered elsewhere'</para>
</option>
<option name="d">
<para>Allow the calling user to dial a 1 digit extension while waiting for
@@ -727,8 +726,6 @@ static void hanguptree(struct dial_head *out_chans, struct ast_channel *exceptio
/* Hangup any existing lines we have open */
if (outgoing->chan && (outgoing->chan != exception)) {
if (answered_elsewhere) {
- /* The flag is used for local channel inheritance and stuff */
- ast_set_flag(ast_channel_flags(outgoing->chan), AST_FLAG_ANSWERED_ELSEWHERE);
/* This is for the channel drivers */
ast_channel_hangupcause_set(outgoing->chan, AST_CAUSE_ANSWERED_ELSEWHERE);
}
@@ -2515,12 +2512,12 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
if (outbound_group)
ast_app_group_set_channel(tc, outbound_group);
/* If the calling channel has the ANSWERED_ELSEWHERE flag set, inherit it. This is to support local channels */
- if (ast_test_flag(ast_channel_flags(chan), AST_FLAG_ANSWERED_ELSEWHERE))
- ast_set_flag(ast_channel_flags(tc), AST_FLAG_ANSWERED_ELSEWHERE);
+ if (ast_channel_hangupcause(chan) == AST_CAUSE_ANSWERED_ELSEWHERE)
+ ast_channel_hangupcause_set(tc, AST_CAUSE_ANSWERED_ELSEWHERE);
/* Check if we're forced by configuration */
if (ast_test_flag64(&opts, OPT_CANCEL_ELSEWHERE))
- ast_set_flag(ast_channel_flags(tc), AST_FLAG_ANSWERED_ELSEWHERE);
+ ast_channel_hangupcause_set(tc, AST_CAUSE_ANSWERED_ELSEWHERE);
/* Inherit context and extension */
@@ -3079,11 +3076,11 @@ out:
}
ast_channel_early_bridge(chan, NULL);
- hanguptree(&out_chans, NULL, 0); /* In this case, there's no answer anywhere */
+ hanguptree(&out_chans, NULL, ast_channel_hangupcause(chan)==AST_CAUSE_ANSWERED_ELSEWHERE ? 1 : 0 ); /* forward 'answered elsewhere' if we received it */
pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
senddialendevent(chan, pa.status);
ast_debug(1, "Exiting with DIALSTATUS=%s.\n", pa.status);
-
+
if ((ast_test_flag64(peerflags, OPT_GO_ON)) && !ast_check_hangup(chan) && (res != AST_PBX_INCOMPLETE)) {
if (!ast_tvzero(calldurationlimit))
memset(ast_channel_whentohangup(chan), 0, sizeof(*ast_channel_whentohangup(chan)));