[Freeswitch-dev] get variable value
João Mesquita
jmesquita at freeswitch.org
Thu Oct 20 16:38:35 MSD 2011
The snippet you've sent is a whole different thing than C. You kinda have to
know these things to code on either language...
Using Ruby, the following statement DOES return an event:
@con.api("uuid_getvar", "#{@uuid} myvar")
And with that event, you implicitly call "getBody".
When you are using C, you can't use these things like that. You have to
explicitly make function calls to the correct event. Look at the ESL
examples testserver.c and testclient.c on the source and maybe you'll
understand.
When calling api on C, you need to use the handle->last_sr_reply (if I
remember correctly).
I hope that helps, otherwise, a working code would.
Regards,
João Mesquita
On Wed, Oct 19, 2011 at 9:48 PM, adam harris <admharris at gmx.com> wrote:
>
> Yes I am using ESL but don't get_header functions need to catch an event
> first.
> I was thinking if there was already a builtin function.
>
> I can't remember exacty because it was a while ago but I used something
> like this in ruby
>
> @con.api("uuid_getvar", "#{@uuid} myvar").getBody
>
> > ----- Original Message -----
> > From: João Mesquita
> > Sent: 10/19/11 10:55 PM
> > To: freeswitch-dev at lists.freeswitch.org
> > Subject: Re: [Freeswitch-dev] get variable value
> >
> > >From your email, I am assuming you are trying to get a variable using
> ESL?
> > If so, custom variables are prefixed with variable. So you would use the
> > get_header functions just as you would on other non-custom variables.
> >
> > Makes sense?
> >
> > Regards,
> > João Mesquita
> >
> >
> >
> > On Wed, Oct 19, 2011 at 7:27 PM, Michael Collins <msc at freeswitch.org>
> wrote:
> >
> > > Grep the source for "switch_channel_get_variable" and you'll see
> numerous
> > > examples...
> > >
> > > -MC
> > >
> > > On Wed, Oct 19, 2011 at 12:37 PM, adam harris <admharris at gmx.com>
> wrote:
> > >
> > >> How do I get the vaule of a custom variable. I have seen uuid_getvar
> > >> Usage: uuid_getvar <uuid> <varname> but how I use in C
> > >>
> > >> _______________________________________________
> > >> Join us at ClueCon 2011, Aug 9-11, Chicago
> > >> http://www.cluecon.com 877-7-4ACLUE
> > >>
> > >> FreeSWITCH-dev mailing list
> > >> FreeSWITCH-dev at lists.freeswitch.org
> > >> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> > >> UNSUBSCRIBE:
> http://lists.freeswitch.org/mailman/options/freeswitch-dev
> > >> http://www.freeswitch.org
> > >>
> > >
> > >
> > > _______________________________________________
> > > Join us at ClueCon 2011, Aug 9-11, Chicago
> > > http://www.cluecon.com 877-7-4ACLUE
> > >
> > > FreeSWITCH-dev mailing list
> > > FreeSWITCH-dev at lists.freeswitch.org
> > > http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> > > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> > > http://www.freeswitch.org
> > >
> > >
>
>
> _______________________________________________
> Join us at ClueCon 2011, Aug 9-11, Chicago
> http://www.cluecon.com 877-7-4ACLUE
>
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20111020/4097a289/attachment.html
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-dev
mailing list