I&#39;m having trouble getting the channel variable state in my Lua ivr example.<div><br></div><div>I have tried both</div><div><br></div><div><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">session:getVariable(&quot;state&quot;)</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">session:getVariable(&quot;<span class="Apple-style-span" style="border-collapse: separate; font-family: -webkit-sans-serif; white-space: normal; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; line-height: 19px; ">Channel-State</span>&quot;)</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">session:getVariable(&quot;<font class="Apple-style-span" face="-webkit-sans-serif"><span class="Apple-style-span" style="border-collapse: separate; line-height: 19px; white-space: normal; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px;">answer_state</span></font>&quot;)</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">session:getVariable(&quot;<span class="Apple-style-span" style="border-collapse: separate; font-family: -webkit-sans-serif; white-space: normal; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; line-height: 19px; ">Answer-State<span class="Apple-style-span" style="font-family: arial; line-height: normal; border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">&quot;)</span></span></span></div>
<div><font class="Apple-style-span" face="-webkit-sans-serif"><span class="Apple-style-span" style="line-height: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="-webkit-sans-serif"><span class="Apple-style-span" style="line-height: 19px;">but lua reports nil for all attempts</span></font></div>
<div><font class="Apple-style-span" face="-webkit-sans-serif"><span class="Apple-style-span" style="line-height: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="-webkit-sans-serif"><span class="Apple-style-span" style="line-height: 19px;">I did a uuid_dump and it appears normal....and both Channel-State and Answer-State Variables are present...does anyone know why my Lua IVR can not get these channel variables? Thanks</span></font></div>
<div><font class="Apple-style-span" face="-webkit-sans-serif"><span class="Apple-style-span" style="line-height: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="-webkit-sans-serif"><span class="Apple-style-span" style="line-height: 19px;">--matt</span></font></div>
<div><font class="Apple-style-span" face="-webkit-sans-serif"><span class="Apple-style-span" style="line-height: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="-webkit-sans-serif"><span class="Apple-style-span" style="line-height: 19px;"><div>
uuid_dump:Event-Name: CHANNEL_DATA</div><div>Core-UUID: ed5556a8-060f-4ce4-85bb-0a70b08120cf</div><div>FreeSWITCH-Hostname: matthew-laptop</div><div>FreeSWITCH-IPv4: 192.168.2.2</div><div>FreeSWITCH-IPv6: %3A%3A1</div><div>
Event-Date-Local: 2009-09-19%2012%3A47%3A20</div><div>Event-Date-GMT: Sat,%2019%20Sep%202009%2012%3A47%3A20%20GMT</div><div>Event-Date-Timestamp: 1253364440904749</div><div>Event-Calling-File: mod_commands.c</div><div>Event-Calling-Function: uuid_dump_function</div>
<div>Event-Calling-Line-Number: 3298</div><div>Channel-State: CS_EXECUTE</div><div>Channel-State-Number: 4</div><div>Channel-Name: sofia/internal/1001</div><div>Unique-ID: 12ee98af-d76d-483c-b9a9-59e7f08ca4e9</div><div>Call-Direction: outbound</div>
<div>Presence-Call-Direction: outbound</div><div>Answer-State: answered</div><div>Channel-Read-Codec-Name: PCMU</div><div>Channel-Read-Codec-Rate: 8000</div><div>Channel-Write-Codec-Name: PCMU</div><div>Channel-Write-Codec-Rate: 8000</div>
<div>Caller-Caller-ID-Name: FreeSWITCH</div><div>Caller-Caller-ID-Number: 0000000000</div><div>Caller-Network-Addr: 192.168.2.4</div><div>Caller-Destination-Number: 1001</div><div>Caller-Unique-ID: 12ee98af-d76d-483c-b9a9-59e7f08ca4e9</div>
<div>Caller-Source: src/switch_ivr_originate.c</div><div>Caller-Context: default</div><div>Caller-Channel-Name: sofia/internal/1001</div><div>Caller-Profile-Index: 1</div><div>Caller-Profile-Created-Time: 1253364439936068</div>
<div>Caller-Channel-Created-Time: 1253364439936068</div><div>Caller-Channel-Answered-Time: 1253364440900612</div><div>Caller-Channel-Progress-Time: 1253364439976071</div><div>Caller-Channel-Progress-Media-Time: 0</div><div>
Caller-Channel-Hangup-Time: 0</div><div>Caller-Channel-Transfer-Time: 0</div><div>Caller-Screen-Bit: true</div><div>Caller-Privacy-Hide-Name: false</div><div>Caller-Privacy-Hide-Number: false</div><div>variable_channel_name: sofia/internal/1001</div>
<div>variable_sip_local_url: 1001%40192.168.2.2</div><div>variable_sip_destination_url: %22user%22%20%3Csip%3A1001%40192.168.2.4%3A5061%3Bfs_nat%3Dyes%3Bfs_path%3Dsip%253A1001%2540192.168.2.4%253A5061%3E</div><div>variable_is_outbound: true</div>
<div>variable_ignore_early_media: true</div><div>variable_originate_early_media: false</div><div>variable_sip_nat_detected: true</div><div>variable_sofia_profile_name: internal</div><div>variable_sip_call_id: 690ad846-1fbd-122d-1599-0010c6ceb785</div>
<div>variable_sip_reply_host: 192.168.2.4</div><div>variable_sip_reply_port: 5061</div><div>variable_sip_user_agent: Linksys/PAP2T-5.1.6(LS)</div><div>variable_switch_r_sdp: v%3D0%0D%0Ao%3D-%201231630%201231630%20IN%20IP4%20192.168.2.4%0D%0As%3D-%0D%0Ac%3DIN%20IP4%20192.168.2.4%0D%0At%3D0%200%0D%0Am%3Daudio%2016406%20RTP/AVP%200%20100%20101%0D%0Aa%3Drtpmap%3A0%20PCMU/8000%0D%0Aa%3Drtpmap%3A100%20NSE/8000%0D%0Aa%3Dfmtp%3A100%20192-193%0D%0Aa%3Drtpmap%3A101%20telephone-event/8000%0D%0Aa%3Dfmtp%3A101%200-15%0D%0Aa%3Dptime%3A20%0D%0A</div>
<div>variable_remote_media_ip: 192.168.2.4</div><div>variable_remote_media_port: 16406</div><div>variable_read_codec: PCMU</div><div>variable_read_rate: 8000</div><div>variable_write_codec: PCMU</div><div>variable_write_rate: 8000</div>
<div>variable_local_media_ip: 192.168.2.2</div><div>variable_local_media_port: 20442</div><div>variable_endpoint_disposition: ANSWER</div><div>variable_current_application_data: api_epik_pocket.lua</div><div>variable_current_application: lua</div>
<div><br></div></span></font></div>