diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-29 17:08:22 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-29 17:08:22 +0000 |
commit | 10712d118c170020a39fe18f2394bb0172c9f5f5 (patch) | |
tree | de5917bbd7b2b261e6caa93c380ee86afd42f892 /channels/chan_local.c | |
parent | 28cfff1ebc779edec3ffdd581f8b5e8f35e68a8c (diff) |
Fix "cancel answered elsewhere" through app_queue with members in chan_local.
Also, implement a private cause code (as suggested by Tilghman). This works with
chan_sip, but doesn't propagate through chan_local.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@172318 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r-- | channels/chan_local.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index 754f49b8c..71994c20b 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -532,6 +532,11 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout) return -1; } + /* 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, AST_FLAG_ANSWERED_ELSEWHERE)) { + ast_set_flag(p->chan, AST_FLAG_ANSWERED_ELSEWHERE); + } + /* copy the channel variables from the incoming channel to the outgoing channel */ /* Note that due to certain assumptions, they MUST be in the same order */ AST_LIST_TRAVERSE(&p->owner->varshead, varptr, entries) { @@ -567,9 +572,14 @@ static int local_hangup(struct ast_channel *ast) ast_mutex_lock(&p->lock); - if (p->chan && ast_test_flag(ast, AST_FLAG_ANSWERED_ELSEWHERE)) - ast_set_flag(p->chan, AST_FLAG_ANSWERED_ELSEWHERE); isoutbound = IS_OUTBOUND(ast, p); + + if (p->chan && ast_test_flag(ast, AST_FLAG_ANSWERED_ELSEWHERE)) { + ast_set_flag(p->chan, AST_FLAG_ANSWERED_ELSEWHERE); + ast_debug(2, "This local call has the ANSWERED_ELSEWHERE flag set.\n"); + } + /* Make sure the hangupcause follows down the chain of channels */ + if (isoutbound) { const char *status = pbx_builtin_getvar_helper(p->chan, "DIALSTATUS"); if ((status) && (p->owner)) { @@ -600,6 +610,7 @@ static int local_hangup(struct ast_channel *ast) DEADLOCK_AVOIDANCE(&p->lock); } if (p->chan) { + p->chan->hangupcause = ast->hangupcause; ast_queue_hangup(p->chan); ast_channel_unlock(p->chan); } |