summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2006-04-05 17:03:30 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2006-04-05 17:03:30 +0000
commit701b49027ddc212cc34d5d0bafe537a294f482dc (patch)
tree688cca05a172b5bdadeb3dad55c542952e6423ac /apps
parent70289466051e9b49652b9dc95ffed7238cbdb3d2 (diff)
Bug 6508 - if priority was a number, then findlabel fails
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@17626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_channelredirect.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/app_channelredirect.c b/apps/app_channelredirect.c
index de8b6abfa..00849302e 100644
--- a/apps/app_channelredirect.c
+++ b/apps/app_channelredirect.c
@@ -99,15 +99,16 @@ static int asyncgoto_exec(struct ast_channel *chan, void *data)
context = NULL;
}
- if (!(prio = ast_findlabel_extension(chan2, S_OR(context, chan2->context), S_OR(exten, chan2->exten),
- priority, chan2->cid.cid_num))) {
+ /* ast_findlabel_extension does not convert numeric priorities; it only does a lookup */
+ if (!(prio = atoi(priority)) && !(prio = ast_findlabel_extension(chan2, S_OR(context, chan2->context),
+ S_OR(exten, chan2->exten), priority, chan2->cid.cid_num))) {
ast_log(LOG_WARNING, "'%s' is not a known priority or label\n", priority);
goto chanquit;
}
- ast_log(LOG_DEBUG, "Attempting async goto (%s) to %s\n", args.channel, args.label);
+ ast_log(LOG_DEBUG, "Attempting async goto (%s) to %s|%s|%d\n", args.channel, S_OR(context, chan2->context), S_OR(exten, chan2->exten), prio);
- if (ast_async_goto_if_exists(chan2, context ? context : chan2->context, exten ? exten : chan2->exten, prio))
+ if (ast_async_goto_if_exists(chan2, S_OR(context, chan2->context), S_OR(exten, chan2->exten), prio))
ast_log(LOG_WARNING, "%s failed for %s\n", app, args.channel);
else
res = 0;