[Freeswitch-users] Check session ready after session transfer

Zvi Agmon zvi at lexifone.com
Tue Jul 7 10:35:00 MSD 2015


Thanks Anthony,

I'm trying to figure out what happens next - after the route to new dial
plan completed. Now a new lua script is executed (as a hookup to answer) -
what is the expected mode at that state - isn't it CS_EXECUTE again?
How should I validate the session is ready in my answer hookup script?

My experience is that in most cases session:ready() returns true at that
stage, but sometime it returns false although  the call continue without
any problem (2 legs are bridged and hears each other).

Thanks
Zvi Agmon
Lexifone


Best regards

Zvi Agmon
Lexifone <http://www.lexifone.com/>
email: zvi at lexifone.com
Office: +972-4-6817711
Cell: +972-54-4505109

On Tue, Jul 7, 2015 at 1:37 AM, Anthony Minessale <
anthony.minessale at gmail.com> wrote:

> As you quoted if session:ready returns false you MUST fall through to the
> end of the script and allow it to exit without trying to hang it up or do
> anything else.
> When the state machine wants to move the session state from CS_EXECUTE
> (running your script) to CS_ROUTING (new lookup in dialplan)  session ready
> will be false.
>
>
> On Mon, Jul 6, 2015 at 1:30 PM, Michael Jerris <mike at jerris.com> wrote:
>
>> What specifically are you looking for in "alive"
>>
>> On Jul 6, 2015, at 2:10 PM, Zvi Agmon <zvi at lexifone.com> wrote:
>>
>> Hi Michael,
>> Thanks for your response.
>>
>> The issues I'm facing is in this scenario:
>> - an inbound call is answered and hit the first dial plan
>> - after performing application logic the call is transferred to another
>> dial plan.
>> - in this dial plan the call is bridged to an out bound leg and a lua
>> script is run when the outbound call is answered.
>> - in this lua script I need to do some logic but want to make sure the
>> session is alive.
>>   - for that I'm calling the method* session:ready* but in some cases
>> the method returns* false although the call is alive*. Also the
>> documentation says that after transfer session:ready should return false.
>>
>> So my question is - how would you check that the session is in working
>> state at this stage?
>>
>> Thanks
>> Zvi Agmon
>>
>>
>>
>> Best regards
>>
>> Zvi Agmon
>> Lexifone <http://www.lexifone.com/>
>> email: zvi at lexifone.com
>> Office: +972-4-6817711
>> Cell: +972-54-4505109
>>
>> On Mon, Jul 6, 2015 at 6:38 PM, Michael Jerris <mike at jerris.com> wrote:
>>
>>> this is a very vague question.  you are alluding to a problem but never
>>> coming out and saying what problem you have.
>>>
>>> On Monday, July 6, 2015, Zvi Agmon <zvi at lexifone.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Can anyone help with this please?
>>>> Didn't get any response - maybe the question is not clear enough...
>>>>
>>>> I'm trying to figure out the correct way to check for session state
>>>> after it was transferred to another dial plan - meaning - a lua script is
>>>> called from the new dial plan and in it I want to know if the session is in
>>>> ready state.
>>>>
>>>> Thanks a lot
>>>>
>>>> Zvi Agmon
>>>> Lexifone <http://www.lexifone.com/>
>>>> zvi at lexifone.com
>>>>
>>>>
>>>> Best regards
>>>>
>>>> Zvi Agmon
>>>> Lexifone <http://www.lexifone.com/>
>>>> email: zvi at lexifone.com
>>>> Office: +972-4-6817711
>>>> Cell: +972-54-4505109
>>>>
>>>> On Tue, Jun 30, 2015 at 2:07 PM, Zvi Agmon <zvi at lexifone.com> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> Need some help regarding session state validation.
>>>>>
>>>>> In documentation I see this:
>>>>>
>>>>> session:ready
>>>>> - checks whether the session is still active (true anytime between
>>>>> call starts and hangup)
>>>>> - also session:ready will return false if the call is being
>>>>> transferred. Bottom line is you should always be checking session:ready on
>>>>> any loops and periodically throughout your script and exit asap if it
>>>>> returns false.
>>>>>
>>>>>
>>>>> My experience is that after transfer the return value of
>>>>> session:ready() is is not consistent - what is the correct way to check
>>>>> session state in that case?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Zvi Agmon
>>>>> Lexifone <http://www.lexifone.com/>
>>>>> email: zvi at lexifone.com
>>>>> Office: +972-4-6817711
>>>>> Cell: +972-54-4505109
>>>>>
>>>>
>>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://confluence.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://confluence.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://confluence.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
>>
>
>
>
> --
> Anthony Minessale II       ♬ @anthmfs  ♬ @FreeSWITCH  ♬
>
>http://freeswitch.org/http://cluecon.com/> http://twitter.com/FreeSWITCH
> ☞ irc.freenode.net #freeswitch ☞ *http://freeswitch.org/g+
> <http://freeswitch.org/g+>*
>
> ClueCon Weekly Development Call
> [image: ☎] sip:888 at conference.freeswitch.org  [image: ☎] +19193869900
>
> https://www.youtube.com/watch?v=9XXgW34t40s
> https://www.youtube.com/watch?v=NLaDpGQuZDA
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.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/20150707/ca20f9b9/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 3053 bytes
Desc: not available
Url : http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150707/ca20f9b9/attachment-0001.png 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list