mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-18 10:44:28 +00:00
Add ${AVAILORIGCHAN} with original channel name (bug #1793)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -43,7 +43,8 @@ static char *descrip =
|
||||
"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 @@ static int chanavail_exec(struct ast_channel *chan, void *data)
|
||||
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 @@ static int chanavail_exec(struct ast_channel *chan, void *data)
|
||||
|
||||
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
|
||||
|
Reference in New Issue
Block a user