[Freeswitch-users] ESL outbound /inbound

Chris Burns chris at cloudtel.com
Fri Dec 24 23:20:00 MSK 2010


I use inbound to monitor switches as a socket client and mod_xml_curl to
direct call flow from a seperate web app. This allows me to receive events
across multiple channels across multiple switches without worrying about
call flow, which is a good design for what I am doing in this example ...
monitoring call flow and conferencing events for realtime display in a UI.
Our call flow systems are critical and monitoring is non-critical so it
works well to seperate them. As a calling card app your system will probably
require tighter integration of call flow and billing, so combining them
could make sense.

The main benefit of outbound is you can use a socket server and each of your
clients represents a distinct channel on one of your switches. It can make
directing call flow easy and it is simple to require your socket server or
play an "oops we are busy" message when it is down ... and it helped
everyone quickly port their FAGI apps to this project :)

You are correct that you can just use event socket and sendmsg to control
call flow and not use lua at all. Yes there is overlap of functionality
between inbound/outbound because both allow you to do basically the same
thing, but as different roles in the socket connection.

On Fri, Dec 24, 2010 at 6:55 AM, Rafqat . <rafonline at hotmail.com> wrote:

>  Hi Chris
>
> In terms of the projects you eluded too, do you use inbound or outbound
> event sockets?  The reason I am asking is that it seems to me that either
> could be used for billing monitoring.  At the moment I am thinking in terms
> of purely using inbound mode to listen to events (and controlling what
> freeswitch does via sendmsg).
>
> I would appreciate it if you could clarify this point for me as I am
> failing to understand the true difference between inbound and outbound mode
> and when each should be used (there seems to be alot of overlap imo -
> correct me if i am wrong).
>
> Cheers
>
> Raf
>
> ------------------------------
> Date: Thu, 23 Dec 2010 18:39:19 -0500
> From: chris at cloudtel.com
>
> To: freeswitch-users at lists.freeswitch.org
> Subject: Re: [Freeswitch-users] ESL outbound /inbound
>
> Billing is not so much a question of scalability, but accuracy. Inline lua
> can verify the PIN against the DB, but it cant accurately calculate billing.
>
> Anything making a calculation on how much money your customer just spent on
> minutes should not be done inline, as many tricks can happen and channels
> have their own state (CS_REPORTING) when the optimal information for
> accounting is available. For prompting the user for their calling card PIN,
> there is nothing wrong with lua connecting to your database. For subtracting
> minutes from an account while the user is on call then event socket or a
> module listening to events is a better method. The latter is how
> mod_nibblebill works.
>
> Personally, for several large projects I chose to monitor events across
> multiple switches via event socket and it worked out very nicely.
>
> On Thu, Dec 23, 2010 at 4:07 PM, Rafqat . <rafonline at hotmail.com> wrote:
>
>  Hi,
>
> I could get lua to do the lookup, I was wondering i guess where does one
> draw the line between when to do stuff inline and when to do stuff outside
> of freeswitch (in terms of load and scalability of solution etc.)
>
> Cheers
>
> Raf
>
> ------------------------------
> Date: Thu, 23 Dec 2010 12:37:26 -0800
> From: msc at freeswitch.org
> To: freeswitch-users at lists.freeswitch.org
> Subject: Re: [Freeswitch-users] ESL outbound /inbound
>
>
> What is wrong with having Lua do the db lookup?
> -MC
>
> On Thu, Dec 23, 2010 at 9:42 AM, Rafqat . <rafonline at hotmail.com> wrote:
>
>  Hi,
>
> I am writing a calling card app using lua and java.
>
> As advised, Java will predominatley do all the billing side of things (via
> ESL) leaving lua do simple things like asking for the calling card pin
> number etc.
>
> When a call comes in, my lua script answers the call and asks the user for
> a pin.  Instead of querying the DB inline from within lua, I would like my
> app server to do this (please let me know if this should be done inline
> instead).  I understand my app server (Java ESL inbound socket) can register
> for a pin checking custom event and I can generate such an event from within
> my lua script.  My lua script would then wait for an appropriate repsonse
> event:
>
> -- Check if pin is valid
> local event = freeswitch.Event("CUSTOM", "check_pin_request");
> event:addHeader("pin_number", digits);
> event:fire();
>
> -- wait for response
> con = freeswitch.EventConsumer("CUSTOM", "check_pin_reponse");
> con:pop(1);
> print("event\n" .. e:serialize("xml"));
>
> I was wondering if the above is the right way of doing things, or should I
> be using ESLOutboundSocket and have lua script do something like this
> instead:
>
> session:execute("set", "pin_to_check=12345");
> session:execute("socket", "192.168.0.2:8084");
>
> Not sure how lua will be told whether the pin is valid or not in this
> scenario.
>
> I appreciate FreeSWITCH is very flexible and would like to make sure I
> develop a scalable and performant application.
>
> Any help will be much appreciated.
>
> Cheers
>
> Raf
>
>
>
>
> _______________________________________________
> 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
>
> _______________________________________________
> 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
>
> _______________________________________________
> 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/20101224/d4a8fdfe/attachment.html 


More information about the FreeSWITCH-users mailing list