diff options
author | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-24 18:50:36 +0000 |
---|---|---|
committer | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-24 18:50:36 +0000 |
commit | 5230ed12f22c28241835a05bb926467896c83f90 (patch) | |
tree | 76bcd48c4710f93c832d8bc0d4daf1722e1ef8f6 /main | |
parent | 1900a766f78e4ef82cfe18ce7f28ebb12175d013 (diff) |
Fix erroneous hangup extension execution
ast_spawn_extension behaves differently from 1.4 in that hangups and extensions
that do not exist do not return an error, whereas in 1.6 it does. This is now
taken into account so that the AST_FLAG_BRIDGE_HANGUP_RUN flag gets set
properly.
(closes issue #16106)
Reported by: ajohnson
Tested by: ajohnson
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231095 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/features.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/main/features.c b/main/features.c index c2430a836..894b5b9a5 100644 --- a/main/features.c +++ b/main/features.c @@ -3085,6 +3085,10 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast while ((spawn_error = ast_spawn_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num, &found, 1)) == 0) { chan->priority++; } + if (spawn_error && (!ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num) || ast_check_hangup(chan))) { + /* if the extension doesn't exist or a hangup occurred, this isn't really a spawn error */ + spawn_error = 0; + } if (found && spawn_error) { /* Something bad happened, or a hangup has been requested. */ ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", chan->context, chan->exten, chan->priority, chan->name); @@ -3101,7 +3105,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast bridge_cdr = NULL; } } - if (chan->priority != 1 || !spawn_error) { + if (!spawn_error) { ast_set_flag(chan, AST_FLAG_BRIDGE_HANGUP_RUN); } ast_channel_unlock(chan); |