summaryrefslogtreecommitdiff
path: root/apps/app_macro.c
diff options
context:
space:
mode:
authorMatteo Brancaleoni <mbrancaleoni@espia.it>2003-03-12 06:00:18 +0000
committerMatteo Brancaleoni <mbrancaleoni@espia.it>2003-03-12 06:00:18 +0000
commit66a57e51e328a0c0b855184c15096758401c0dac (patch)
tree37350d3bd0d6df02129f16dc35b893e9a674e627 /apps/app_macro.c
parent67fad0eab1076f82a0f50e74df6ec52b03a95735 (diff)
Wed Mar 12 07:00:01 CET 2003
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_macro.c')
-rwxr-xr-xapps/app_macro.c19
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;
+ }
}
}
}