[asterisk-dev] Modification to ChanisAvail to save BRIDGEDCHAN
Alexander Lopez
alex.lopez at opsys.com
Sat Jan 28 21:36:07 MST 2006
I am having a hard time with this as this is my first 'real' hack.
Index: apps/app_chanisavail.c
===================================================================
--- apps/app_chanisavail.c (revision 8848)
+++ apps/app_chanisavail.c (working copy)
@@ -61,6 +61,7 @@
" ${AVAILCHAN} - the name of the available channel, if one exists\n"
" ${AVAILORIGCHAN} - the canonical channel name that was used to create the channel\n"
" ${AVAILSTATUS} - the status code for the available channel\n"
+" ${BRIDGEDCHAN} - the canonical channel name of the Bridged channel (only with 's')\n"
" Options:\n"
" s - Consider the channel unavailable if the channel is in use at all\n"
" j - Support jumping to priority n+101 if no channel is available\n";
@@ -125,6 +126,7 @@
snprintf(trychan, sizeof(trychan), "%s/%s",cur,number);
status = inuse = ast_device_state(trychan);
+ pbx_builtin_setvar_helper(chan, "BRIDGEDCHAN", ast_bridged_channel(trychan));
}
if ((inuse <= 1) && (tempchan = ast_request(tech, chan->nativeformats, number, &status))) {
pbx_builtin_setvar_helper(chan, "AVAILCHAN", tempchan->name);
I got no output on the BRIDGEDCHAN variable and I get the following when I compile:
app_chanisavail.c: In function âchanavail_execâ:
app_chanisavail.c:129: warning: passing argument 1 of âast_bridged_channelâ from incompatible pointer type
app_chanisavail.c:129: warning: passing argument 3 of âpbx_builtin_setvar_helperâ from incompatible pointer type
gcc -shared -Xlinker -x -o app_chanisavail.so app_chanisavail.o
Any Ideas on what I am missing???
More information about the asterisk-dev
mailing list