[Freeswitch-users] Couple of questions

João Mesquita jmesquita at gmail.com
Sun Aug 23 21:27:16 PDT 2009


Hey there, FsGui uses ESL a lot and I had to go through the code to document
it so here is a few hints inline ...

Don't hesitate to keep the questions coming. I will fill in whenever I can.

jmesquita

On Sun, Aug 23, 2009 at 8:50 PM, Brian West <brian at freeswitch.org> wrote:

>
> On Aug 23, 2009, at 6:27 PM, Matt Riddell wrote:
>
> > Hi,
> >
> > I don't see how I can read some responses to command using esl.
> >
> > I.E. esl_send_recv(&handle, "api show calls count\n\n");
> >
> > and
> >
> > printf("Header Test %s\n", esl_event_get_header(event, "API-
> > Command"));
> > printf("Body Test %s\n", esl_event_get_body(event));
> >
> > the header details are returned.
> >
> > The body is null.
>

Body is null on every event that does not use headers to output information.
A good example would be console logs. I haven't seen too many default events
besides log that have body besides a application custom events.


>
>
> I'm not too sure about using ESL in C, I have used it pretty much
> exclusively in perl.
>
> > Also, I can originate a call and set the account code for it, but
> > how do
> > I get a list of calls with their account codes?
>
> originate {account_code=1234}sofia/profile/target at ip ....
>
> You can get the list of the channels via "show channels" or bridged
> calls with "show calls"
>
>  From there you have the UUID's you can call uuid_dump on them to get
> all the variables.


>
> > Do I get a list of calls then go through them one by one and get the
> > variables for those calls by uuid?
>

All ESL does is output events to socket and expose the API commands. It does
not maintain any kind of list of calls or anything like that so it is up to
you to maintain that yourself if you don't want to parse API output every
time.


>
>
> You could do this or setup a listener to get the events as they happen
> and keep the info you need.
>
> > Does anyone have any documentation for the esl api?
>
> http://docs.freeswitch.org/ (this should help, its under files list
> see esl.h)
>

I need to work a little bit more on that documentation as well.. I saw a few
conflicts with the core documentation too. Will get there once I have some
more time left.


>
> > Even if I could read some comments from a usage of it would be useful.
>
> I just find it interesting you're doing this with C.
>
> > --
> > Cheers,
> >
> > Matt Riddell
> > Director
> > _______________________________________________
> >
> > http://www.venturevoip.com/news.php (Daily Asterisk News)
> > http://www.venturevoip.com/st.php (SmoothTorque Predictive Dialer)
> > http://www.venturevoip.com/c3.php (ConduIT3 PABX Systems)
> >
> > _______________________________________________
> > FreeSWITCH-users mailing list
> > FreeSWITCH-users at lists.freeswitch.org
> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> > http://www.freeswitch.org
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090824/701dc8fe/attachment-0002.html 


More information about the FreeSWITCH-users mailing list