[svn-commits] tilghman: branch 1.4 r201828 - /branches/1.4/res/res_features.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Jun 18 19:40:44 CDT 2009
Author: tilghman
Date: Thu Jun 18 19:40:41 2009
New Revision: 201828
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=201828
Log:
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.
Modified:
branches/1.4/res/res_features.c
Modified: branches/1.4/res/res_features.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/res/res_features.c?view=diff&rev=201828&r1=201827&r2=201828
==============================================================================
--- branches/1.4/res/res_features.c (original)
+++ branches/1.4/res/res_features.c Thu Jun 18 19:40:41 2009
@@ -1991,7 +1991,7 @@
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 @@
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 @@
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) {
More information about the svn-commits
mailing list