diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-19 00:40:41 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-19 00:40:41 +0000 |
commit | d57439ae533b36405456d162cf741cff8be15583 (patch) | |
tree | b14fa2cf6514bd910eef71aad265a677dd0134c7 /res | |
parent | 0c387bb3730bd2ffc16c1345c26ff4c204b9cd7a (diff) |
If the "h" extension fails, give it another chance in main/pbx.c.
If the "h" extension fails, give it another chance in main/pbx.c, when it
returns from the bridge code. Fixes an issue where the "h" extension may
occasionally not fire, when a Dial is executed from a Macro.
Debugged in #asterisk with user tompaw.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@201828 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_features.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/res/res_features.c b/res/res_features.c index 235d46ea1..b5bd27bc0 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -1991,7 +1991,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast char savelastapp[AST_MAX_EXTENSION]; char savelastdata[AST_MAX_EXTENSION]; char save_exten[AST_MAX_EXTENSION]; - int save_prio; + int save_prio, spawn_error = 0; autoloopflag = ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP); ast_set_flag(chan, AST_FLAG_IN_AUTOLOOP); @@ -2013,7 +2013,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast chan->priority = 1; ast_channel_unlock(chan); while(ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num)) { - if (ast_spawn_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num)) { + if ((spawn_error = ast_spawn_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num))) { /* Something bad happened, or a hangup has been requested. */ if (option_debug) ast_log(LOG_DEBUG, "Spawn h extension (%s,%s,%d) exited non-zero on '%s'\n", chan->context, chan->exten, chan->priority, chan->name); @@ -2034,7 +2034,9 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast bridge_cdr = NULL; } } - ast_set_flag(chan, AST_FLAG_BRIDGE_HANGUP_RUN); + if (chan->priority != 1 || !spawn_error) { + ast_set_flag(chan, AST_FLAG_BRIDGE_HANGUP_RUN); + } ast_channel_unlock(chan); /* protect the lastapp/lastdata against the effects of the hangup/dialplan code */ if (bridge_cdr) { |