[asterisk-dev] Modification to ChanisAvail to save BRIDGEDCHAN

BJ Weschke bweschke at gmail.com
Sun Jan 29 04:40:43 MST 2006


 You're looking for chan->name instead of the return of
ast_bridged_channel(..) which is the entire channel structure.

On 1/28/06, Alexander Lopez <alex.lopez at opsys.com> wrote:
>
> 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???
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>


--
Bird's The Word Technologies, Inc.
http://www.btwtech.com/



More information about the asterisk-dev mailing list