<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi Chris<br><br>In terms of the projects you eluded too, do you use inbound or outbound event sockets?&nbsp; The reason I am asking is that it seems to me that either could be used for billing monitoring.&nbsp; At the moment I am thinking in terms of purely using inbound mode to listen to events (and controlling what freeswitch does via sendmsg).&nbsp; <br><br>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).<br><br>Cheers<br><br>Raf<br><br><hr id="stopSpelling">Date: Thu, 23 Dec 2010 18:39:19 -0500<br>From: chris@cloudtel.com<br>To: freeswitch-users@lists.freeswitch.org<br>Subject: Re: [Freeswitch-users] ESL outbound /inbound<br><br>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.<br><br>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.<br>
<br>Personally, for several large projects I chose to monitor events across multiple switches via event socket and it worked out very nicely.<br><br><div class="ecxgmail_quote">On Thu, Dec 23, 2010 at 4:07 PM, Rafqat . <span dir="ltr">&lt;<a href="mailto:rafonline@hotmail.com">rafonline@hotmail.com</a>&gt;</span> wrote:<br>
<blockquote class="ecxgmail_quote" style="padding-left: 1ex;">



<div>
Hi,<br><br>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.)<br>
<br>Cheers<br><br>Raf<br><br><hr>Date: Thu, 23 Dec 2010 12:37:26 -0800<br>From: <a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a><br>To: <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
Subject: Re: [Freeswitch-users] ESL outbound /inbound<div><div></div><div class="h5"><br><br>What is wrong with having Lua do the db lookup?&nbsp;<div>-MC<br><br><div>On Thu, Dec 23, 2010 at 9:42 AM, Rafqat . <span dir="ltr">&lt;<a href="mailto:rafonline@hotmail.com">rafonline@hotmail.com</a>&gt;</span> wrote:<br>

<blockquote style="padding-left: 1ex;">



<div>
Hi,<br><br>I am writing a calling card app using lua and java.&nbsp; <br><br>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.<br>

<br>When a call comes in, my lua script answers the call and asks the user for a pin.&nbsp; 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).&nbsp; 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.&nbsp; My lua script would then wait for an appropriate repsonse event:<br>

<br>-- Check if pin is valid<br>local event = freeswitch.Event("CUSTOM", "check_pin_request");<br>event:addHeader("pin_number", digits);<br>event:fire();<br><br>-- wait for response<br>con = freeswitch.EventConsumer("CUSTOM", "check_pin_reponse");<br>

con:pop(1);<br>print("event\n" .. e:serialize("xml"));<br><br>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:<br>

<br>session:execute("set", "pin_to_check=12345");<br>session:execute("socket", "<a href="http://192.168.0.2:8084" target="_blank">192.168.0.2:8084</a>");<br><br>Not sure how lua will be told whether the pin is valid or not in this scenario.<br>

<br>I appreciate FreeSWITCH is very flexible and would like to make sure I develop a scalable and performant application.<br><br>Any help will be much appreciated.<br><br>Cheers<br><br>Raf<br><br><br><br>                                               </div>


<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>
<br></div></div>_______________________________________________
FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>                                               </div>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>
<br>_______________________________________________
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                                               </body>
</html>