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

covici at ccs.covici.com covici at ccs.covici.com
Fri May 16 15:10:15 MSD 2014


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



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