]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Correctly reset the dialplan priority.
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 28 Feb 2012 21:19:39 +0000 (21:19 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 28 Feb 2012 21:19:39 +0000 (21:19 +0000)
When the stack frame is allocated, we save the address to which we should
return, when the Gosub returns.  However, if we just want to restore the
priority, then we need to subtract 1 before setting it.  Otherwise, when
a Gosub goes to a nonexistent address, it will skip a priority in the
dialplan.  This is because when we return from an application, the PBX
increments the priority for us.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@357416 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_stack.c

index 47ba10eb60f34183799bd7fc18bdc7376d346c2b..6623624d93395710d0ad4e4fbb880173891c6d16 100644 (file)
@@ -421,7 +421,7 @@ static int gosub_exec(struct ast_channel *chan, const char *data)
                                chan->context, chan->exten, ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP) ? chan->priority + 1 : chan->priority);
                ast_copy_string(chan->context, newframe->context, sizeof(chan->context));
                ast_copy_string(chan->exten, newframe->extension, sizeof(chan->exten));
-               chan->priority = newframe->priority;
+               chan->priority = newframe->priority - 1;
                ast_free(newframe);
                return -1;
        }