[Freeswitch-users] Play Credit before disconnecting call
anthony.minessale at gmail.com
Fri Nov 20 21:58:55 MSK 2015
if (originate_causes ~= nil) then
if (session:ready()) then
It will only work if the session is up, and knowing who hungup is moot.
On Fri, Nov 20, 2015 at 12:25 PM, Voxbox.io <talk at voxbox.io> wrote:
> This is my ending of the lua script.
> 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.
> originate_disposition = session:getVariable("originate_disposition");
> originate_causes = session:getVariable("originate_causes");
> -- is aleg hangup?
> if (originate_causes ~= nil) then
> last_balance = 10;
> session:set_tts_params("flite", "kal");
> session:speak("Credit remaining " .. last_balance .. " euros");
> -- when bleg?
> On 20 November 2015 at 19:06, Voxbox.io <talk at voxbox.io> wrote:
>> Hi Guys,
>> I have some subscribers connected to my FS.
>> I'm assigning each one of them some credit to place outbound calls and
>> I'm using nibblebill to update balance accordly.
>> 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.
>> 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)
>> Is this possible?
>> How can I know from which side the call has been disconnected and only
>> play TTS when is the remote party?
>> Thank you so much, I can't find any clue in previous messages.
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> Official FreeSWITCH Sites
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
Anthony Minessale II ♬ @anthmfs ♬ @FreeSWITCH ♬
☞ http://freeswitch.org/ ☞ http://cluecon.com/ ☞
☞ irc.freenode.net #freeswitch ☞ *http://freeswitch.org/g+
ClueCon Weekly Development Call
☎ sip:888 at conference.freeswitch.org ☎ +19193869900
-------------- next part --------------
An HTML attachment was scrubbed...
Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users