This change fixes bug 7731, macros not executing more than one level deep in a hung-up situation; also increased maximum recursion depth from 7 to 20, to keep serious coders from painful toe-stubbings

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Steve Murphy 19 years ago
parent 5b5220fb77
commit 8a0b9236a7

@ -133,7 +133,7 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
s = pbx_builtin_getvar_helper(chan, "MACRO_DEPTH"); s = pbx_builtin_getvar_helper(chan, "MACRO_DEPTH");
if (s) if (s)
sscanf(s, "%d", &depth); sscanf(s, "%d", &depth);
if (depth >= 7) { if (depth >= 20) {
ast_log(LOG_ERROR, "Macro(): possible infinite loop detected. Returning early.\n"); ast_log(LOG_ERROR, "Macro(): possible infinite loop detected. Returning early.\n");
LOCAL_USER_REMOVE(u); LOCAL_USER_REMOVE(u);
return 0; return 0;
@ -254,9 +254,9 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
break; break;
} }
/* don't stop executing extensions when we're in "h" */ /* don't stop executing extensions when we're in "h" */
if (chan->_softhangup && strcasecmp(oldexten,"h")) { if (chan->_softhangup && strcasecmp(chan->macroexten,"h")) {
ast_log(LOG_DEBUG, "Extension %s, priority %d returned normally even though call was hung up\n", ast_log(LOG_DEBUG, "Extension %s, macroexten %s, priority %d returned normally even though call was hung up\n",
chan->exten, chan->priority); chan->exten, chan->macroexten, chan->priority);
goto out; goto out;
} }
chan->priority++; chan->priority++;

Loading…
Cancel
Save