aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-18 17:03:33 +0000
committermatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-18 17:03:33 +0000
commit8e5427fad9567d9275c83f6166ec92c236958169 (patch)
treec571d690b57639391641a2403444bade05b86976
parent15d2f7aa97d8aeb5c079eb0f8f12e34566cc25e3 (diff)
mar mar 18 18:03:23 CET 2003
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@653 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xapps/app_chanisavail.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c
index e2ad6e7e9..ff2b84e27 100755
--- a/apps/app_chanisavail.c
+++ b/apps/app_chanisavail.c
@@ -41,8 +41,9 @@ static char *descrip =
"of the requested channels are available the new priority will\n"
"be n+101 (unless such a priority does not exist, in which case\n"
"ChanIsAvail will return -1. If any of the requested channels\n"
-"are available, the next priority will be n+1 and ChanIsAvail\n"
-"will return 0.\n";
+"are available, the next priority will be n+1, the channel variable\n"
+"${CHANAVAIL} will be set to the name of the available channel and\n"
+"the ChanIsAvail app will return 0.\n";
STANDARD_LOCAL_USER;
@@ -81,6 +82,7 @@ static int chanavail_exec(struct ast_channel *chan, void *data)
*number = '\0';
number++;
if ((tempchan = ast_request(tech, chan->nativeformats, number))) {
+ pbx_builtin_setvar_helper(chan, "AVAILCHAN", tempchan->name);
ast_hangup(tempchan);
tempchan = NULL;
res = 1;
@@ -91,6 +93,7 @@ static int chanavail_exec(struct ast_channel *chan, void *data)
}
if (res < 1) {
+ pbx_builtin_setvar_helper(chan, "AVAILCHAN", "");
if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->callerid))
chan->priority+=100;
else