diff options
author | matteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-03-12 06:00:18 +0000 |
---|---|---|
committer | matteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-03-12 06:00:18 +0000 |
commit | f61680257a63d31f0abcf41b5c29f4670552af2f (patch) | |
tree | 37350d3bd0d6df02129f16dc35b893e9a674e627 /apps/app_macro.c | |
parent | 9cfcee51633cfff22801dd82843f5b7c7f4fdd82 (diff) |
Wed Mar 12 07:00:01 CET 2003
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@641 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_macro.c')
-rwxr-xr-x | apps/app_macro.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/apps/app_macro.c b/apps/app_macro.c index c06fa117f..0b4a11fc4 100755 --- a/apps/app_macro.c +++ b/apps/app_macro.c @@ -184,17 +184,20 @@ out: pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority); if (save_macro_priority) free(save_macro_priority); - if (!strcasecmp(chan->context, fullmacro) && !chan->_softhangup) { + if (!strcasecmp(chan->context, fullmacro)) { /* If we're leaving the macro normally, restore original information */ chan->priority = oldpriority; - strncpy(chan->exten, oldexten, sizeof(chan->exten) - 1); strncpy(chan->context, oldcontext, sizeof(chan->context) - 1); - if ((offsets = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"))) { - /* Handle macro offset if it's set by checking the availability of step n + offset + 1, otherwise continue - normally if there is any problem */ - if (sscanf(offsets, "%d", &offset) == 1) { - if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + offset + 1, chan->callerid)) { - chan->priority += offset; + if (!chan->_softhangup) { + /* Copy the extension, so long as we're not in softhangup, where we could be given an asyncgoto */ + strncpy(chan->exten, oldexten, sizeof(chan->exten) - 1); + if ((offsets = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"))) { + /* Handle macro offset if it's set by checking the availability of step n + offset + 1, otherwise continue + normally if there is any problem */ + if (sscanf(offsets, "%d", &offset) == 1) { + if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + offset + 1, chan->callerid)) { + chan->priority += offset; + } } } } |