Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Couple of questions


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
matt at venturevoip.com
Guest





PostPosted: Sun Aug 23, 2009 6:31 pm    Post subject: [Freeswitch-users] Couple of questions Reply with quote

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)

_______________________________________________
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
Back to top
brian at freeswitch.org
Guest





PostPosted: Sun Aug 23, 2009 6:54 pm    Post subject: [Freeswitch-users] Couple of questions Reply with quote

On Aug 23, 2009, at 6:27 PM, Matt Riddell wrote:

Quote:
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.

Quote:
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.

Quote:
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.

Quote:
Does anyone have any documentation for the esl api?

http://docs.freeswitch.org/ (this should help, its under files list
see esl.h)

Quote:
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.

Quote:
--
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
Back to top
matt at venturevoip.com
Guest





PostPosted: Sun Aug 23, 2009 7:03 pm    Post subject: [Freeswitch-users] Couple of questions Reply with quote

On 24/08/09 11:50 AM, Brian West wrote:

Quote:
Quote:
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.

Smile 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 Smile

--
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
Back to top
brian at freeswitch.org
Guest





PostPosted: Sun Aug 23, 2009 8:01 pm    Post subject: [Freeswitch-users] Couple of questions Reply with quote

On Aug 23, 2009, at 6:57 PM, Matt Riddell wrote:

Quote:
Smile 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 Razz I like reusing all
the modules already out there plus I'm a little lazy Razz

Quote:
Thanks for your help man will let you know if I have any other
questions Smile

kewl.

/b


_______________________________________________
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
Back to top
jmesquita at gmail.com
Guest





PostPosted: Sun Aug 23, 2009 11:31 pm    Post subject: [Freeswitch-users] Couple of questions Reply with quote

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 (brian@freeswitch.org)> wrote:
Quote:

On Aug 23, 2009, at 6:27 PM, Matt Riddell wrote:

Quote:
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.
 
Quote:



I'm not too sure about using ESL in C, I have used it pretty much
exclusively in perl.

Quote:
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. 

Quote:
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.
 
Quote:



You could do this or setup a listener to get the events as they happen
and keep the info you need.

Quote:
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.
 
Quote:

Quote:
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.


Quote:
--
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 (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 (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


Back to top
matt at venturevoip.com
Guest





PostPosted: Mon Aug 24, 2009 1:13 am    Post subject: [Freeswitch-users] Couple of questions Reply with quote

On 24/08/09 4:27 PM, Joćo Mesquita wrote:
Quote:

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
Back to top
jmesquita at freeswitc...
Guest





PostPosted: Mon Aug 24, 2009 9:09 am    Post subject: [Freeswitch-users] Couple of questions Reply with quote

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:
Quote:
On 24/08/09 4:27 PM, Joćo Mesquita wrote:
Quote:

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

_______________________________________________
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
Back to top
anthony.minessale at g...
Guest





PostPosted: Mon Aug 24, 2009 9:11 am    Post subject: [Freeswitch-users] Couple of questions Reply with quote

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 (matt@venturevoip.com)> wrote:
Quote:
On 24/08/09 4:27 PM, Joćo Mesquita wrote:
Quote:

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 (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 ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
matt at venturevoip.com
Guest





PostPosted: Mon Aug 24, 2009 3:52 pm    Post subject: [Freeswitch-users] Couple of questions Reply with quote

On 25/08/09 2:05 AM, Anthony Minessale wrote:
Quote:
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)

_______________________________________________
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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services