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
This commit is contained in:
Kinsey Moore
2012-06-05 14:41:43 +00:00
parent d210685a20
commit 571445ab9c
8 changed files with 24 additions and 29 deletions

View File

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