From: Jeff Peeler Date: Tue, 24 Nov 2009 18:54:01 +0000 (+0000) Subject: Merged revisions 231095 via svnmerge from X-Git-Tag: 1.6.1.12-rc1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29d1e92b103eb70c3756a299fe0137ad449d30d6;p=thirdparty%2Fasterisk.git Merged revisions 231095 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r231095 | jpeeler | 2009-11-24 12:50:36 -0600 (Tue, 24 Nov 2009) | 11 lines 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@231097 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/features.c b/main/features.c index a170514d4d..4eaf87ccd1 100644 --- a/main/features.c +++ b/main/features.c @@ -2769,6 +2769,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); @@ -2785,7 +2789,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);