[asterisk-commits] file: trunk r103819 - in /trunk: CHANGES UPGRADE.txt apps/app_channelredirect.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 19 12:40:22 CST 2008


Author: file
Date: Tue Feb 19 12:40:22 2008
New Revision: 103819

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103819
Log:
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)

Modified:
    trunk/CHANGES
    trunk/UPGRADE.txt
    trunk/apps/app_channelredirect.c

Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?view=diff&rev=103819&r1=103818&r2=103819
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Tue Feb 19 12:40:22 2008
@@ -366,6 +366,9 @@
   * AMD() has a new "maximum word length" option. "show application AMD" from the CLI
      for more details
   * GotoIfTime() now may branch based on a "false" condition, like other Goto-related applications
+  * The ChannelRedirect application no longer exits the dialplan if the given channel
+     does not exist. It will now set the CHANNELREDIRECT_STATUS variable to SUCCESS upon success
+     or NOCHANNEL if the given channel was not found.
 
 Music On Hold Changes
 ---------------------

Modified: trunk/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/trunk/UPGRADE.txt?view=diff&rev=103819&r1=103818&r2=103819
==============================================================================
--- trunk/UPGRADE.txt (original)
+++ trunk/UPGRADE.txt Tue Feb 19 12:40:22 2008
@@ -77,6 +77,9 @@
 * ChanIsAvail() now has a 't' option, which allows the specified device
   to be queried for state without consulting the channel drivers. This
   performs mostly a 'ChanExists' sort of function.
+* ChannelRedirect() will not terminate the channel that fails to do a
+  channelredirect as it has done previously. Instead CHANNELREDIRECT_STATUS
+  will reflect if the attempt was successful of not.
 * SetCallerPres() has been replaced with the CALLERPRES() dialplan function
   and is now deprecated.
 * DISA()'s fifth argument is now an options argument.  If you have previously

Modified: trunk/apps/app_channelredirect.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_channelredirect.c?view=diff&rev=103819&r1=103818&r2=103819
==============================================================================
--- trunk/apps/app_channelredirect.c (original)
+++ trunk/apps/app_channelredirect.c Tue Feb 19 12:40:22 2008
@@ -39,8 +39,10 @@
 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 @@
 	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;




More information about the asterisk-commits mailing list