[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freeswitch-dev
Subject:    Re: [Freeswitch-dev] get variable value
From:       Joćo_Mesquita <jmesquita () freeswitch ! org>
Date:       2011-10-20 12:38:35
Message-ID: CABH8QX0Y9QEti0n3NOcizZU2vajFDBGF4wLUFSifDLYB-heYQA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


The snippet you've sent is a whole different thing than C. You kinda have t=
o
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=E3o Mesquita



On Wed, Oct 19, 2011 at 9:48 PM, adam harris <admharris@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=E3o Mesquita
> > Sent: 10/19/11 10:55 PM
> > To: freeswitch-dev@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 th=
e
> > get_header functions just as you would on other non-custom variables.
> >
> > Makes sense?
> >
> > Regards,
> > Jo=E3o Mesquita
> >
> >
> >
> > On Wed, Oct 19, 2011 at 7:27 PM, Michael Collins <msc@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@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@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@lists.freeswitch.org
> > > http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> > > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-de=
v
> > > 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@lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>

[Attachment #5 (text/html)]

The snippet you&#39;ve sent is a whole different thing than C. You kinda have to know \
these things to code on either language...<div><br></div><div>Using Ruby, the \
following statement DOES return an event:</div><div><br></div> \
<div>@con.api(&quot;uuid_getvar&quot;, &quot;#{@uuid} \
myvar&quot;)</div><div><br></div><div>And with that event, you implicitly call \
&quot;getBody&quot;.</div><div><br></div><div>When you are using C, you can&#39;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&#39;ll understand.</div> <div><br></div><div>When calling api on C, you need to \
use the handle-&gt;last_sr_reply (if I remember \
correctly).</div><div><br></div><div>I hope that helps, otherwise, a working code \
would.</div><div><br></div><div>Regards,<br clear="all"> Joćo Mesquita<br><br>
<br><br><div class="gmail_quote">On Wed, Oct 19, 2011 at 9:48 PM, adam harris <span \
dir="ltr">&lt;<a href="mailto:admharris@gmx.com">admharris@gmx.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex;"> <br>
Yes I am using ESL but don&#39;t  get_header functions need to catch an event \
first.<br> I was thinking if there was already a builtin function.<br>
<br>
I can&#39;t remember exacty because it was a while ago but I used something like this \
in ruby<br> <br>
@con.api(&quot;uuid_getvar&quot;, &quot;#{@uuid} myvar&quot;).getBody<br>
<div><div></div><div class="h5"><br>
&gt; ----- Original Message -----<br>
&gt; From: Joćo Mesquita<br>
&gt; Sent: 10/19/11 10:55 PM<br>
&gt; To: <a href="mailto:freeswitch-dev@lists.freeswitch.org">freeswitch-dev@lists.freeswitch.org</a><br>
 &gt; Subject: Re: [Freeswitch-dev] get variable value<br>
&gt;<br>
&gt; &gt;From your email, I am assuming you are trying to get a variable using \
ESL?<br> &gt; If so, custom variables are prefixed with variable. So you would use \
the<br> &gt; get_header functions just as you would on other non-custom \
variables.<br> &gt;<br>
&gt; Makes sense?<br>
&gt;<br>
&gt; Regards,<br>
&gt; Joćo Mesquita<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Oct 19, 2011 at 7:27 PM, Michael Collins &lt;<a \
href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>&gt; wrote:<br> &gt;<br>
&gt; &gt; Grep the source for &quot;switch_channel_get_variable&quot; and you&#39;ll \
see numerous<br> &gt; &gt; examples...<br>
&gt; &gt;<br>
&gt; &gt; -MC<br>
&gt; &gt;<br>
&gt; &gt; On Wed, Oct 19, 2011 at 12:37 PM, adam harris &lt;<a \
href="mailto:admharris@gmx.com">admharris@gmx.com</a>&gt; wrote:<br> &gt; &gt;<br>
&gt; &gt;&gt; How do I get the vaule of a custom variable. I have seen \
uuid_getvar<br> &gt; &gt;&gt; Usage: uuid_getvar &lt;uuid&gt; &lt;varname&gt; but how \
I use in C<br> &gt; &gt;&gt;<br>
&gt; &gt;&gt; _______________________________________________<br>
&gt; &gt;&gt; Join us at ClueCon 2011, Aug 9-11, Chicago<br>
&gt; &gt;&gt; <a href="http://www.cluecon.com" \
target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br> &gt; &gt;&gt;<br>
&gt; &gt;&gt; FreeSWITCH-dev mailing list<br>
&gt; &gt;&gt; <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
 &gt; &gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" \
target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br> \
&gt; &gt;&gt; UNSUBSCRIBE:<a \
href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" \
target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br> \
&gt; &gt;&gt; <a href="http://www.freeswitch.org" \
target="_blank">http://www.freeswitch.org</a><br> &gt; &gt;&gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Join us at ClueCon 2011, Aug 9-11, Chicago<br>
&gt; &gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> \
877-7-4ACLUE<br> &gt; &gt;<br>
&gt; &gt; FreeSWITCH-dev mailing list<br>
&gt; &gt; <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
 &gt; &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" \
target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br> \
&gt; &gt; UNSUBSCRIBE:<a \
href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" \
target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br> \
&gt; &gt; <a href="http://www.freeswitch.org" \
target="_blank">http://www.freeswitch.org</a><br> &gt; &gt;<br>
&gt; &gt;<br>
<br>
<br>
_______________________________________________<br>
Join us at ClueCon 2011, Aug 9-11, Chicago<br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> \
877-7-4ACLUE<br> <br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
 <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" \
target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br> \
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" \
target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br> <a \
href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br> \
</div></div></blockquote></div><br></div>



_______________________________________________
Join us at ClueCon 2011, Aug 9-11, Chicago
http://www.cluecon.com 877-7-4ACLUE

FreeSWITCH-dev mailing list
FreeSWITCH-dev@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
http://www.freeswitch.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic