[Freeswitch-users] how to capture variables from lua script in xml dialplan?

Avi Marcus avi at avimarcus.net
Sat May 17 21:58:19 MSD 2014


Not sure this is your issue...if you use lua with inline, you can't touch
the media. The media is for later to be processed.

-Avi
On May 17, 2014 1:07 PM, "Vincent Xia" <gmangudai at gmail.com> wrote:

> yeah inline is the workout, just need to have the lua application written
> as below:
> <action inline="true" application="lua" data="setvar.lua" />
>
> but seems there comes another issue, session:streamFile() is no longer
> working, playback the same file in the xml dialplan is fine.
>
>
>
> 2014-05-16 19:10 GMT+08:00 <covici at ccs.covici.com>:
>
>> You would have to do inline="true" on your lua statement, but I am not
>> sure you can even do that -- inline is only good for a few things like
>> set, but maybe Brian or someone could let us know if you can do that
>> with a lua script.
>>
>> Vincent Xia <gmangudai at gmail.com> wrote:
>>
>> > the dialpan is as follow:
>> >         <extension name="Test_Extension">
>> >               <condition field="destination_number"
>> > expression="^\b(10[0-1][0-9])\b$" break="never">
>> >                       <action application="set"
>> data="continue_on_fail=true" />
>> >                       <action application="lua" data="setvar.lua" />
>> >                       <action application="log" data="INFO
>> my_lua_var=${my_lua_var}" />
>> >               </condition>
>> >               <condition field="${my_lua_var}" expression="1">
>> >                       <action application="sleep" data="1000" />
>> >               </condition>
>> >         </extension>
>> >
>> > the the xml dialplan i have a variable set inside a lua
>> > script(session:setVariable("my_lua_var", "1");), but its value is
>> > always "undefined" during the parsing stage. i need the variable to be
>> > a condition field so how can i capture it?
>> >
>> >
>> _________________________________________________________________________
>> > 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
>>
>> --
>> Your life is like a penny.  You're going to lose it.  The question is:
>> How do
>> you spend it?
>>
>>          John Covici
>>          covici at ccs.covici.com
>>
>> _________________________________________________________________________
>> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140517/23661472/attachment.html 


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