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. 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? Do I get a list of calls then go through them one by one and get the variables for those calls by uuid? Does anyone have any documentation for the esl api? Even if I could read some comments from a usage of it would be useful. -- 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)
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.
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@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?
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)
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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On 24/08/09 11:50 AM, Brian West wrote:
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.
:) The rest of the application is in C, so it makes sense to use FreeSwitch's esl in C. Thanks for your help man will let you know if I have any other questions :) -- 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)
On Aug 23, 2009, at 6:57 PM, Matt Riddell wrote:
:) The rest of the application is in C, so it makes sense to use FreeSwitch's esl in C.
I'm a perl monkey when it comes to using ESL :P I like reusing all the modules already out there plus I'm a little lazy :P
Thanks for your help man will let you know if I have any other questions :)
kewl. /b
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@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@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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On 24/08/09 4:27 PM, João Mesquita wrote:
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.
Awesome man - thanks for these. So, one more question - in the show calls (or show channels) api response, which header would I use to retrieve the response? -- 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)
For api responses you have to use body. I should have reminded that as well, sorry... Jmesquita On 8/24/09, Matt Riddell <matt@venturevoip.com> wrote:
On 24/08/09 4:27 PM, João Mesquita wrote:
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.
Awesome man - thanks for these.
So, one more question - in the show calls (or show channels) api response, which header would I use to retrieve the response?
-- 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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Sent from my mobile device
I updated testclient.c so you can see how now. #include <stdio.h> #include <stdlib.h> #include <esl.h> int main(void) { esl_handle_t handle = {{0}}; esl_connect(&handle, "localhost", 8021, "ClueCon"); esl_send_recv(&handle, "api status\n\n"); if (handle.last_sr_event && handle.last_sr_event->body) { printf("%s\n", handle.last_sr_event->body); } else { // this is unlikely to happen with api or bgapi (which is hardcoded above) but prefix but may be true for other commands printf("%s\n", handle.last_sr_reply); } esl_disconnect(&handle); return 0; } On Mon, Aug 24, 2009 at 1:07 AM, Matt Riddell <matt@venturevoip.com> wrote:
On 24/08/09 4:27 PM, João Mesquita wrote:
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.
Awesome man - thanks for these.
So, one more question - in the show calls (or show channels) api response, which header would I use to retrieve the response?
-- 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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
On 25/08/09 2:05 AM, Anthony Minessale wrote:
I updated testclient.c so you can see how now.
Awesome awesome awesome! Thanks heaps man - everybody here has been great! -- 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)
participants (5)
-
Anthony Minessale
-
Brian West
-
João Mesquita
-
João Mesquita
-
Matt Riddell