<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 class="" style="white-space:pre">        </span>last_balance = 10;</font></div><div><span class="" style="white-space:pre"><font face="monospace, monospace">        </font></span></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">        </span>session:set_tts_params("flite", "kal");</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">        </span>session:speak("Credit remaining " .. last_balance .. " euros");</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">        </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><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>