[Asterisk-cvs] asterisk/apps app_chanisavail.c,1.5,1.6

markster at lists.digium.com markster at lists.digium.com
Sat Jun 5 13:40:55 CDT 2004


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv11542/apps

Modified Files:
	app_chanisavail.c 
Log Message:
Add ${AVAILORIGCHAN} with original channel name (bug #1793)


Index: app_chanisavail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_chanisavail.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- app_chanisavail.c	2 Mar 2004 17:49:33 -0000	1.5
+++ app_chanisavail.c	5 Jun 2004 18:42:59 -0000	1.6
@@ -43,7 +43,8 @@
 "case ChanIsAvail will return -1).  If any of the requested channels\n"
 "are available, the next priority will be n+1, the channel variable\n"
 "${AVAILCHAN} will be set to the name of the available channel and\n"
-"the ChanIsAvail app will return 0.\n";
+"the ChanIsAvail app will return 0.  ${AVAILORIGCHAN} is\n"
+"the canonical channel name that was used to create the channel.\n";
 
 STANDARD_LOCAL_USER;
 
@@ -83,6 +84,9 @@
 			number++;
 			if ((tempchan = ast_request(tech, chan->nativeformats, number))) {
 					pbx_builtin_setvar_helper(chan, "AVAILCHAN", tempchan->name);
+					/* Store the originally used channel too */
+					snprintf(info, sizeof(info), "%s/%s", tech, number);
+					pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", info);
 					ast_hangup(tempchan);
 					tempchan = NULL;
 					res = 1;
@@ -94,6 +98,7 @@
 
 	if (res < 1) {
 		pbx_builtin_setvar_helper(chan, "AVAILCHAN", "");
+		pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", "");
 		if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->callerid))
 			chan->priority+=100;
 		else




More information about the svn-commits mailing list