<div dir="ltr"><div style="font-size:12.8px"><font face="monospace, monospace">Change:</font></div><div style="font-size:12.8px"><font face="monospace, monospace"><br></font></div><div style="font-size:12.8px"><font face="monospace, monospace">if (originate_causes ~= nil) then</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">To:</font></div><div><font face="monospace, monospace"><br></font></div><div><div style="font-size:12.8px"><font face="monospace, monospace">if (session:ready()) then</font></div></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">It will only work if the session is up, and knowing who hungup is moot.</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 20, 2015 at 12:25 PM, Voxbox.io <span dir="ltr"><<a href="mailto:talk@voxbox.io" target="_blank">talk@voxbox.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>This is my ending of the lua script.</div><div>I'm very confused regarding who is the actor that hang up the call and how to detect side and most of all if this code can remain into my general LUA or if I have to use any hangup hook..any way, I'm pasting my code, hoping someone can help me.</div><div><br></div><div><br></div><div><br></div><div><div><font face="monospace, monospace">originate_disposition = session:getVariable("originate_disposition");</font></div><div><font face="monospace, monospace">originate_causes = session:getVariable("originate_causes");</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">-- is aleg hangup?</font></div><div><font face="monospace, monospace">if (originate_causes ~= nil) then</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">        </span>last_balance = 10;</font></div><div><span style="white-space:pre-wrap"><font face="monospace, monospace">        </font></span></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">        </span>session:set_tts_params("flite", "kal");</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">        </span>session:speak("Credit remaining " .. last_balance .. " euros");</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">        </span>session:hangup();</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">end</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">-- when bleg?</font></div></div><div><div class="h5"><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><br><div class="gmail_extra"><br><div class="gmail_quote">On 20 November 2015 at 19:06, Voxbox.io <span dir="ltr"><<a href="mailto:talk@voxbox.io" target="_blank">talk@voxbox.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Hi Guys,</div><div>I have some subscribers connected to my FS.</div><div>I'm assigning each one of them some credit to place outbound calls and I'm using nibblebill to update balance accordly.</div><div>I'm rather familiar with LUA, as I'm using a script to make my logic decision on who is calling, which is the remote gateway to use and the tariff to give to nibblebill before bridging the call, and so on.</div><div><br></div><div>Now, I would like the user to let know the remaining balance at the end of each call playing a TTS message (of course only played when the remote party hang-up)</div><div>Is this possible?</div><div>How can I know from which side the call has been disconnected and only play TTS when is the remote party?</div><div><br></div><div>Thank you so much, I can't find any clue in previous messages.</div><div><br></div><div>Cheers</div><div>Max</div><div><br></div></div>
</blockquote></div><br></div></div></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><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" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Anthony Minessale II ♬ @anthmfs ♬ @FreeSWITCH ♬<div><br><div>☞ <a href="http://freeswitch.org/" target="_blank">http://freeswitch.org/</a> ☞ <a href="http://cluecon.com/" target="_blank">http://cluecon.com/</a> ☞ <a href="http://twitter.com/FreeSWITCH" target="_blank">http://twitter.com/FreeSWITCH</a></div><div><div>☞ <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch ☞ <u><a href="http://freeswitch.org/g+" target="_blank">http://freeswitch.org/g+</a></u><br><br></div><div>ClueCon Weekly Development Call <br></div><div>☎ <a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a> ☎ +19193869900 </div><div><br></div></div></div><div><a href="https://www.youtube.com/watch?v=9XXgW34t40s" style="color:rgb(17,85,204);font-size:12.8000001907349px" target="_blank">https://www.youtube.com/watch?v=9XXgW34t40s</a></div><div><a href="https://www.youtube.com/watch?v=NLaDpGQuZDA" target="_blank">https://www.youtube.com/watch?v=NLaDpGQuZDA</a><br></div></div></div></div></div></div></div>
</div>