[Freeswitch-users] in a lua script, is "session" available only after "answer"?
Ashish gautam
ashish at nms.co.in
Wed Jun 12 10:20:36 MSD 2013
You cannot use session object until you answer the call. Thats where the
problem is.
On Wed, Jun 12, 2013 at 9:15 AM, Jayesh Nambiar <jayesh1017 at gmail.com>wrote:
> Hi,
> Ideally a session is available when a session starts which means it should
> also be available when early media starts.
>
> --- Jayesh
> On Jun 12, 2013 6:23 AM, "Vincent Xia" <gmangudai at gmail.com> wrote:
>
>>
>> i have an extension in the dialplan\default.xml
>>
>> <extension name="test_lua" continue="false">
>> <condition field="destination_number" expression="^(9\d{3})$">
>> <action application="answer" />
>> <action application="lua" data="test.lua" />
>> <action application="sleep" data="1000" />
>> </condition>
>> </extension>
>>
>> the test.lua is something like:
>>
>> if session:ready() then
>> freeswitch.consoleLog("info", "a leg is ready.\n" )
>> else
>> freeswitch.consoleLog("info", "a leg is not ready.\n" )
>> end
>>
>> this works fine and info "a leg is ready." will be shown on the console.
>>
>> when im trying to swap the sequence of the dialplan as
>>
>> <action application="lua" data="test.lua" />
>> <action application="answer" />
>>
>> the freeswitch gets down, with a windows message box prompting to debug
>> or close the program. (a bug?)
>> does this mean in a lua script, "session" is only available after
>> "answer"?
>>
>>
>> _________________________________________________________________________
>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130612/ee87a6f1/attachment.html
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list