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: https://origsvn.digium.com/svn/asterisk/trunk@172318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Olle Johansson
2009-01-29 17:08:22 +00:00
parent b3ab95317c
commit 7ecda45482
5 changed files with 52 additions and 8 deletions

View File

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