[Freeswitch-users] Can not pass the value from read( ) app to lua code

Michael Collins msc at freeswitch.org
Thu Jun 28 22:19:43 MSD 2012


It's because you're executing Lua in-line. Lua is getting executed *before*
all of the applications listed above it. Remove the inline="true" and
you'll be okay.
-MC

On Thu, Jun 28, 2012 at 11:10 AM, Gary Chen <Gary.Chen at lightyear.net> wrote:

> FreeSWITCH Version 1.2.0-rc2+git~20120625T160048Z~690cae5de1****
>
> ** **
>
> I am trying to validate the input from read app using lua. Here is my
> dialplan:****
>
>     ****
>
>   <extension name="account_code_setup" continue="true">****
>
>       <condition field="${use_acct_code}" expression="^YES$|^VALIDATE$">**
> **
>
>           <action application="answer"/>****
>
>           <action application="read" data="2 15
> 'tone_stream://%(10000,0,350,440)' acctcode 30000 #"/>****
>
>           <action application="log" data="username: '${user_name}'
> acctcode: '${acctcode}'"/>****
>
>           <action application="set"
> data="sip_h_X-account-code=${acctcode}"/>****
>
>           <action inline="true" application="lua"
> data="validate_acctcode.lua  ${use_acct_code}  ${acctcode_list}
>  ${acctcode}"/>****
>
>       </condition>****
>
>       <condition field="${validate}" expression="^NO$">****
>
>         <anti-action application="respond" data="406 Invalid account
> code"/>****
>
>         <anti-action application="hangup"/>****
>
>       </condition>****
>
>     </extension>****
>
> ** **
>
> I can assign ${acctcode} to sip_h_X-account-code. But it always has nil
> value when pass to lua.****
>
> What am I doing wrong?****
>
> ** **
>
> Gary  ****
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120628/698b3820/attachment.html 


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