diff options
author | Mark Spencer <markster@digium.com> | 2004-10-26 22:25:43 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2004-10-26 22:25:43 +0000 |
commit | 8a13712e45e41c4d413200e38a96898a4f1a79ab (patch) | |
tree | 8cc9a36b9066a72d36a623a08bb8779286caedf2 /apps/app_chanisavail.c | |
parent | 9efbc4630131838017b80d407fab2c3594c0a924 (diff) |
Pass concept of status back, permit "leaveempty" to work with static agents who are not loggedon (bug #2719)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_chanisavail.c')
-rwxr-xr-x | apps/app_chanisavail.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c index d61b0f1d3..91bf838b2 100755 --- a/apps/app_chanisavail.c +++ b/apps/app_chanisavail.c @@ -51,6 +51,7 @@ LOCAL_USER_DECL; static int chanavail_exec(struct ast_channel *chan, void *data) { int res=-1; + int status; struct localuser *u; char info[512], tmp[512], *peers, *tech, *number, *rest, *cur; struct ast_channel *tempchan; @@ -80,20 +81,24 @@ static int chanavail_exec(struct ast_channel *chan, void *data) } *number = '\0'; number++; - if ((tempchan = ast_request(tech, chan->nativeformats, number))) { + if ((tempchan = ast_request(tech, chan->nativeformats, number, &status))) { pbx_builtin_setvar_helper(chan, "AVAILCHAN", tempchan->name); /* Store the originally used channel too */ snprintf(tmp, sizeof(tmp), "%s/%s", tech, number); pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", tmp); + snprintf(tmp, sizeof(tmp), "%d", status); + pbx_builtin_setvar_helper(chan, "AVAILSTATUS", tmp); ast_hangup(tempchan); tempchan = NULL; res = 1; break; + } else { + snprintf(tmp, sizeof(tmp), "%d", status); + pbx_builtin_setvar_helper(chan, "AVAILSTATUS", tmp); } cur = rest; } while (cur); } - if (res < 1) { pbx_builtin_setvar_helper(chan, "AVAILCHAN", ""); pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", ""); |