[Freeswitch-users] unable to check hangup cause in lua

Vincent Xia gmangudai at gmail.com
Mon Jul 22 15:05:07 MSD 2013


here is the solution:
http://blog.godson.in/2010/12/use-of-returnringready-originate.html

when using freeswitch.Session(); in lua script, it works in blocked mode
and will not terminate until receives response from the called party (or
goes timeout), nevertheless i think it's a bug as the call origination
cannot terminate upon receiving message from the calling party.


2013/7/22 Ashish gautam <ashish at nms.co.in>

> Hi,
>
> Here is some question:
>
> When we use api hangup hook, the session is not alive and the hangup cause
> cannot be grabbed based upon the uuid. So in the api hangup hook, how can
> it be extracted?
>
>
>
> On Sat, Jul 20, 2013 at 5:05 AM, Brian Foster <bdfoster at davri.com> wrote:
>
>> I'm pretty sure in your case the script is terminated as soon as the call
>> is terminated. So you need to run a script outside of that bridge. You
>> could use something like api hangup hook in order to run your script.
>> Regardless of how you do it, try not to lock the thread when doing so. All
>> sorts of weird stuff can happen if your script malfunctions.
>>
>> Have fun.
>>
>> Thank you,
>>
>> Brian Foster
>> Project Manager/Owner's Representative
>> Davri Investments, Incorporated
>> P: +1-317-787-2686
>> M: +1-317-600-9753
>> Indianapolis, Indiana
>>
>>
>> On Thu, Jul 18, 2013 at 6:36 AM, Vincent Xia <gmangudai at gmail.com> wrote:
>>
>>> the scenario is Alice calls Bob and Alice hangs up before Bob answers
>>> the call,
>>> while using the default dialplan as
>>> <action application="bridge" data="user/${dialed_extension}@${domain_name}"
>>> />
>>> Bob instantly goes hangup after Alice hung up,
>>>
>>> but after change the dialplan to have a lua script process the bridging,
>>> as
>>> <action application="lua" data="bridge.lua $1" />  // $1 is the
>>> destination_number
>>> Bob will still be ringing for quite a long time, the bridge.lua is
>>> simple:
>>>
>>> dest = argv[1]
>>>
>>> session:execute("set", "hangup_after_bridge=true");
>>> dial_string = string.format('user/%s', dest)
>>> sessionB = freeswitch.Session(dial_string)
>>>
>>> if sessionB:ready() then
>>> freeswitch.bridge(session, sessionB);
>>> else
>>> freeswitch.consoleLog("info", "---session NOT ready \n ")
>>> -- ORININATOR_CANCEL can be checked here though omitted for simplicity
>>>  session:hangup();
>>> end
>>>
>>> why the bridge.lua is not able to respond to ORININATOR_CANCEL after
>>> Alice hangs up?
>>>
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> 
>>> 
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://wiki.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> 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
>>>
>>>
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> 
>> 
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>>
>> 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
>>
>>
>
>
> --
> Ashish Gautam
>
> Nucleus Microsystems (Pvt.) Ltd.
>
> Ph. 011 47574758
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> 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/20130722/ed6b6a75/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list