From 0e2af385ab55db11505b81cb8436bbd2ed29e56c Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Fri, 5 Dec 2008 23:26:45 +0000 Subject: [PATCH] Merged revisions 161493 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r161493 | mmichelson | 2008-12-05 17:24:38 -0600 (Fri, 05 Dec 2008) | 8 lines If the autoloop flag is set on a channel, then we need to add 1 to the priority when checking if the extension exists. Otherwise, gosubs will fail. This was discovered when investigating an asterisk-users mailing list post made by Gary Hawkins. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@161494 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_stack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/app_stack.c b/apps/app_stack.c index cd6ed55217..9fc3fe385b 100644 --- a/apps/app_stack.c +++ b/apps/app_stack.c @@ -282,7 +282,7 @@ static int gosub_exec(struct ast_channel *chan, void *data) return -1; } - if (!ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num)) { + if (!ast_exists_extension(chan, chan->context, chan->exten, ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP) ? chan->priority + 1 : chan->priority, chan->cid.cid_num)) { ast_log(LOG_ERROR, "Attempt to reach a non-existent destination for gosub: (Context:%s, Extension:%s, Priority:%d)\n", chan->context, chan->exten, chan->priority); ast_copy_string(chan->context, newframe->context, sizeof(chan->context));