diff options
author | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-05 20:51:50 +0000 |
---|---|---|
committer | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-05 20:51:50 +0000 |
commit | ae263a6d91fd3f2aa533b4ff5ac219607b87ff90 (patch) | |
tree | e5366cadee68933b082c463cce3c3e47d727776d /main/pbx.c | |
parent | ce381f753a25fb5ee4aa0c38abe78d4cb56c5e0d (diff) |
Change where priority of a goto is adjusted.
Partially reverts 102272.
Closes issue #11929
(credit to file for fix suggestion - we still <3 you)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@102500 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c index c3ba34335..4578b32c2 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -5853,8 +5853,12 @@ int ast_explicit_goto(struct ast_channel *chan, const char *context, const char ast_copy_string(chan->context, context, sizeof(chan->context)); if (!ast_strlen_zero(exten)) ast_copy_string(chan->exten, exten, sizeof(chan->exten)); - if (priority > -1) + if (priority > -1) { chan->priority = priority; + /* see flag description in channel.h for explanation */ + if (ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP)) + chan->priority--; + } ast_channel_unlock(chan); @@ -5868,7 +5872,7 @@ int ast_async_goto(struct ast_channel *chan, const char *context, const char *ex ast_channel_lock(chan); if (chan->pbx) { /* This channel is currently in the PBX */ - ast_explicit_goto(chan, context, exten, priority); + ast_explicit_goto(chan, context, exten, priority + 1); ast_softhangup_nolock(chan, AST_SOFTHANGUP_ASYNCGOTO); } else { /* In order to do it when the channel doesn't really exist within |