Real-time billing application for the FreeSWITCH (mod_lua, mod_perl or ESL)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Real-time billing application for the FreeSWITCH (mod_lua, mod_perl or ESL)

Sami Montour

Hello Everyone,

I am a long time user of OpenSIPS and have recently been tasked with developing a call control/real-time billing application for the FreeSWITCH. I would like to develop the application in either C/C++, Perl or lua (totally new to lua) in this order.

 

I have used ESL to develop some basic functionality of the application using Perl. For instance, when the call comes in, I pass over control from FreeSWITCH to the call control application using outbound TCP socket. Then the call control application listens for CHANNEL_ANSWER event to start billing process and CHANNEL_HANGUP event to stop billing. The application does some database work as well to retrieve and check user status and balance and all that stuff. My main concern is with load testing because of the TCP connection between the FreeSWITCH and call control application and also TCP connection to database to retrieve subscriber info. The basic functionality seems to work fine but haven’t tested it with high call volume, which I am about to do.

 

The last couple of days I have been experimenting with mod_lua but can’t find a method under “Session” to get information related to CHANNEL_ANSWER and CHANNEL_HANGUP events. The “session:geVariable” does not have variables related to session answer time or hangup time, something similar to “$e->getHeader("Caller-Channel-Answered-Time")”  in ESL. I must be missing something very simple here. Again, my experience with mod_lua is only a couple of days old.

 

I am new Freeswitch and thought I would seek the advice of all the experts and people with more experience with Freeswitch. For this type of application, am I better off with mod_lua, or mod_perl, or shall I stick with ESL using Perl? How about ESL with C/C++? Will I gain some performance gain there?

 

Any feedback would be appreciated. Thanks.

 

Sam

 


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Real-time billing application for the FreeSWITCH (mod_lua, mod_perl or ESL)

Michael Jerris
Administrator
<base href="x-msg://3835/">If your happy with C, go for it.  You can take a look at mod_xml_cdr and mod_nibblebill for some hints on hooks for billing.  I might use the state hooks for reporting instead and the data you get from that one as you are less time constrained to handle the data in that state.

Mike

On Aug 9, 2013, at 2:29 PM, Sami Montour <[hidden email]> wrote:

Hello Everyone,
I am a long time user of OpenSIPS and have recently been tasked with developing a call control/real-time billing application for the FreeSWITCH. I would like to develop the application in either C/C++, Perl or lua (totally new to lua) in this order.
 
I have used ESL to develop some basic functionality of the application using Perl. For instance, when the call comes in, I pass over control from FreeSWITCH to the call control application using outbound TCP socket. Then the call control application listens for CHANNEL_ANSWER event to start billing process and CHANNEL_HANGUP event to stop billing. The application does some database work as well to retrieve and check user status and balance and all that stuff. My main concern is with load testing because of the TCP connection between the FreeSWITCH and call control application and also TCP connection to database to retrieve subscriber info. The basic functionality seems to work fine but haven’t tested it with high call volume, which I am about to do.
 
The last couple of days I have been experimenting with mod_lua but can’t find a method under “Session” to get information related to CHANNEL_ANSWER and CHANNEL_HANGUP events. The “session:geVariable” does not have variables related to session answer time or hangup time, something similar to “$e->getHeader("Caller-Channel-Answered-Time")”  in ESL. I must be missing something very simple here. Again, my experience with mod_lua is only a couple of days old.
 
I am new Freeswitch and thought I would seek the advice of all the experts and people with more experience with Freeswitch. For this type of application, am I better off with mod_lua, or mod_perl, or shall I stick with ESL using Perl? How about ESL with C/C++? Will I gain some performance gain there?
 
Any feedback would be appreciated. Thanks.
 
Sam


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Real-time billing application for the FreeSWITCH (mod_lua, mod_perl or ESL)

Sami Montour
In reply to this post by Sami Montour
<base href="x-msg://3835/">

Thanks Mike. I appreciate it.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Michael Jerris
Sent: Monday, August 12, 2013 10:25 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] Real-time billing application for the FreeSWITCH (mod_lua, mod_perl or ESL)

 

If your happy with C, go for it.  You can take a look at mod_xml_cdr and mod_nibblebill for some hints on hooks for billing.  I might use the state hooks for reporting instead and the data you get from that one as you are less time constrained to handle the data in that state.

 

Mike

 

On Aug 9, 2013, at 2:29 PM, Sami Montour <[hidden email]> wrote:



Hello Everyone,

I am a long time user of OpenSIPS and have recently been tasked with developing a call control/real-time billing application for the FreeSWITCH. I would like to develop the application in either C/C++, Perl or lua (totally new to lua) in this order.

 

I have used ESL to develop some basic functionality of the application using Perl. For instance, when the call comes in, I pass over control from FreeSWITCH to the call control application using outbound TCP socket. Then the call control application listens for CHANNEL_ANSWER event to start billing process and CHANNEL_HANGUP event to stop billing. The application does some database work as well to retrieve and check user status and balance and all that stuff. My main concern is with load testing because of the TCP connection between the FreeSWITCH and call control application and also TCP connection to database to retrieve subscriber info. The basic functionality seems to work fine but haven’t tested it with high call volume, which I am about to do.

 

The last couple of days I have been experimenting with mod_lua but can’t find a method under “Session” to get information related to CHANNEL_ANSWER and CHANNEL_HANGUP events. The “session:geVariable” does not have variables related to session answer time or hangup time, something similar to “$e->getHeader("Caller-Channel-Answered-Time")”  in ESL. I must be missing something very simple here. Again, my experience with mod_lua is only a couple of days old.

 

I am new Freeswitch and thought I would seek the advice of all the experts and people with more experience with Freeswitch. For this type of application, am I better off with mod_lua, or mod_perl, or shall I stick with ESL using Perl? How about ESL with C/C++? Will I gain some performance gain there?

 

Any feedback would be appreciated. Thanks.

 

Sam

 


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: Real-time billing application for the FreeSWITCH (mod_lua, mod_perl or ESL)

jorgemariodlc
This post has NOT been accepted by the mailing list yet.
In reply to this post by Sami Montour
I actually working in it, I found it yesterday you need to add those lines (/autoload_configs/lua.conf.xml):

<configuration name="lua.conf" description="LUA Configuration">
  <settings>
   
    <hook event="CHANNEL_ANSWER" script="answer.lua"/>
    <hook event="CHANNEL_HANGUP_COMPLETE" script="hangup.lua"/>

  </settings>
</configuration>

Check this link to know what information is in each event, because it's important to handle the direction-call (Outbound, Inbound)  https://wiki.freeswitch.org/wiki/Event_List