diff options
author | Kinsey Moore <kmoore@digium.com> | 2012-06-05 14:41:43 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2012-06-05 14:41:43 +0000 |
commit | 571445ab9c9f268abfa7cdea1f80d199686c5fac (patch) | |
tree | bcaac031cac910fbc4aa613cb62700bcca8f8a48 /channels/chan_local.c | |
parent | d210685a20c950e418b84e3c6f085e2f7f19f299 (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 'channels/chan_local.c')
-rw-r--r-- | channels/chan_local.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index bed9eebdc..3c5fca5de 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -37,6 +37,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include <sys/signal.h> #include "asterisk/lock.h" +#include "asterisk/causes.h" #include "asterisk/channel.h" #include "asterisk/config.h" #include "asterisk/module.h" @@ -909,9 +910,9 @@ static int local_call(struct ast_channel *ast, const char *dest, int timeout) ast_channel_cc_params_init(chan, ast_channel_get_cc_config_params(owner)); - /* Make sure we inherit the ANSWERED_ELSEWHERE flag if it's set on the queue/dial call request in the dialplan */ - if (ast_test_flag(ast_channel_flags(ast), AST_FLAG_ANSWERED_ELSEWHERE)) { - ast_set_flag(ast_channel_flags(chan), AST_FLAG_ANSWERED_ELSEWHERE); + /* Make sure we inherit the AST_CAUSE_ANSWERED_ELSEWHERE if it's set on the queue/dial call request in the dialplan */ + if (ast_channel_hangupcause(ast) == AST_CAUSE_ANSWERED_ELSEWHERE) { + ast_channel_hangupcause_set(chan, AST_CAUSE_ANSWERED_ELSEWHERE); } /* copy the channel variables from the incoming channel to the outgoing channel */ @@ -1028,9 +1029,9 @@ static int local_hangup(struct ast_channel *ast) isoutbound = IS_OUTBOUND(ast, p); /* just comparing pointer of ast */ - if (p->chan && ast_test_flag(ast_channel_flags(ast), AST_FLAG_ANSWERED_ELSEWHERE)) { - ast_set_flag(ast_channel_flags(p->chan), AST_FLAG_ANSWERED_ELSEWHERE); - ast_debug(2, "This local call has the ANSWERED_ELSEWHERE flag set.\n"); + if (p->chan && ast_channel_hangupcause(ast) == AST_CAUSE_ANSWERED_ELSEWHERE) { + ast_channel_hangupcause_set(p->chan, AST_CAUSE_ANSWERED_ELSEWHERE); + ast_debug(2, "This local call has AST_CAUSE_ANSWERED_ELSEWHERE set.\n"); } if (isoutbound) { |