aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authoranthm <anthm@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-02 18:08:11 +0000
committeranthm <anthm@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-02 18:08:11 +0000
commit7742cd11fa4589649382188fe07e407c74b90029 (patch)
tree5a93a56acdd127d022d5272ea618ec54d26a1845 /pbx.c
parentee9531b3d386de2b76515d54573a59e2fe90930a (diff)
fix small goto logic issue
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4369 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pbx.c b/pbx.c
index 87f0a0db0..1351d2119 100755
--- a/pbx.c
+++ b/pbx.c
@@ -3855,13 +3855,13 @@ int ast_add_extension(const char *context, int replace, const char *extension, i
}
int ast_explicit_goto(struct ast_channel *chan, const char *context, const char *exten, int priority) {
- if(chan && !ast_check_hangup(chan)) {
+ if(chan) {
if (context && !ast_strlen_zero(context))
strncpy(chan->context, context, sizeof(chan->context) - 1);
if (exten && !ast_strlen_zero(exten))
strncpy(chan->exten, exten, sizeof(chan->context) - 1);
if (priority)
- chan->priority = priority - 1;
+ chan->priority = priority;
return 0;
}
return -1;
@@ -3874,7 +3874,7 @@ int ast_async_goto(struct ast_channel *chan, const char *context, const char *ex
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
@@ -5454,7 +5454,7 @@ static int __ast_goto_if_exists(struct ast_channel *chan, char* context, char *e
return goto_func(chan,
context ? context : chan->context,
exten ? exten : chan->exten,
- priority ? priority : chan->priority);
+ (priority ? priority : chan->priority) - 1);
} else
return -3;
}