mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user