aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_macro.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-29 15:04:26 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-29 15:04:26 +0000
commit1cbba5607c36e87977b265e84afa60db41560ce1 (patch)
tree30e8ea21857bedceb044494a0aeefd2d343f8bc3 /apps/app_macro.c
parent044d2218ba972a4a4ef2d2aa9a9f80f3fad9a6b9 (diff)
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: http://svn.digium.com/svn/asterisk/trunk@5529 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_macro.c')
-rwxr-xr-xapps/app_macro.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/app_macro.c b/apps/app_macro.c
index f0b37aed3..43ad36836 100755
--- a/apps/app_macro.c
+++ b/apps/app_macro.c
@@ -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);