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

Gary Chen Gary.Chen at lightyear.net
Thu Jun 28 22:10:59 MSD 2012


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/f0edc248/attachment.html 


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