make 'goto' APIs aware of auto-processing loops, so they know exactly when to set the requested priority or one priority lower

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2005-04-29 15:04:26 +00:00
parent 8cd6529426
commit bced63033d
4 changed files with 65 additions and 65 deletions

View File

@@ -88,6 +88,7 @@ static int macro_exec(struct ast_channel *chan, void *data)
char *offsets;
int offset;
int setmacrocontext=0;
int autoloopflag;
char *save_macro_exten;
char *save_macro_context;
@@ -166,6 +167,8 @@ static int macro_exec(struct ast_channel *chan, void *data)
pbx_builtin_setvar_helper(chan, varname, cur);
argc++;
}
autoloopflag = ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP);
ast_set_flag(chan, AST_FLAG_IN_AUTOLOOP);
while(ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num)) {
if ((res = ast_spawn_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num))) {
/* Something bad happened, or a hangup has been requested. */
@@ -208,6 +211,7 @@ static int macro_exec(struct ast_channel *chan, void *data)
chan->priority++;
}
out:
ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
for (x=1; x<argc; x++) {
/* Restore old arguments and delete ours */
snprintf(varname, sizeof(varname), "ARG%d", x);