aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_channelredirect.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-19 18:40:22 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-19 18:40:22 +0000
commit9fc8ecd73b3c9c4c779987c606f7ea568b23037d (patch)
treedcd2c4d01cd03090e7b60a73557c946002194fe7 /apps/app_channelredirect.c
parent50b88d15e198df9808a4c8d2a03bccf655fc5aaa (diff)
Add CHANNELREDIRECT_STATUS variable to ChannelRedirect() dialplan application. This will either be set to NOCHANNEL if the given channel was not found or SUCCESS if it worked.
(closes issue #11553) Reported by: johan Patches: UPGRADE.txt.channelredirect.patch uploaded by johan (license 334) CHANGES.channelredirect.patch uploaded by johan (license 334) app_channelredirect-20080219.patch uploaded by johan (license 334) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103819 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_channelredirect.c')
-rw-r--r--apps/app_channelredirect.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/app_channelredirect.c b/apps/app_channelredirect.c
index 462942724..ed7f2e43e 100644
--- a/apps/app_channelredirect.c
+++ b/apps/app_channelredirect.c
@@ -39,8 +39,10 @@ static char *app = "ChannelRedirect";
static char *synopsis = "Redirects given channel to a dialplan target.";
static char *descrip =
"ChannelRedirect(channel,[[context,]extension,]priority)\n"
-" Sends the specified channel to the specified extension priority\n";
-
+" Sends the specified channel to the specified extension priority\n"
+"This application sets the following channel variables upon completion:\n"
+" CHANNELREDIRECT_STATUS - Are set to the result of the redirection\n"
+" either NOCHANNEL or SUCCESS\n";
static int asyncgoto_exec(struct ast_channel *chan, void *data)
{
@@ -69,11 +71,12 @@ static int asyncgoto_exec(struct ast_channel *chan, void *data)
chan2 = ast_get_channel_by_name_locked(args.channel);
if (!chan2) {
ast_log(LOG_WARNING, "No such channel: %s\n", args.channel);
- return -1;
+ pbx_builtin_setvar_helper(chan, "CHANNELREDIRECT_STATUS", "NOCHANNEL");
+ return 0;
}
res = ast_async_parseable_goto(chan2, args.label);
-
+ pbx_builtin_setvar_helper(chan, "CHANNELREDIRECT_STATUS", "SUCCESS");
ast_channel_unlock(chan2);
return res;