From: Tilghman Lesher Date: Tue, 28 Feb 2012 21:21:14 +0000 (+0000) Subject: Correctly reset the dialplan priority. X-Git-Tag: 10.3.0~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ce4065d5eff2c252c43a3d39120a3e595a3a56e;p=thirdparty%2Fasterisk.git Correctly reset the dialplan priority. 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. ........ Merged revisions 357416 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@357421 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_stack.c b/apps/app_stack.c index c5f0b6affb..9be935a2f8 100644 --- a/apps/app_stack.c +++ b/apps/app_stack.c @@ -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; }