<div dir="ltr"><div><br></div><div>i have an extension in the dialplan\default.xml</div><div><br></div><div> <extension name="test_lua" continue="false"></div><div> <condition field="destination_number" expression="^(9\d{3})$"></div>
<div> <action application="answer" /></div><div> <action application="lua" data="test.lua" /></div><div> <action application="sleep" data="1000" /></div>
<div> </condition></div><div> </extension></div><div><br></div><div>the test.lua is something like:</div><div><br></div><div>if session:ready() then</div><div> freeswitch.consoleLog("info", "a leg is ready.\n" )</div>
<div>else</div><div> freeswitch.consoleLog("info", "a leg is not ready.\n" )</div><div>end</div><div><br></div><div>this works fine and info "a leg is ready." will be shown on the console.</div>
<div><br></div><div>when im trying to swap the sequence of the dialplan as</div><div><br></div><div> <action application="lua" data="test.lua" /></div><div> <action application="answer" /></div>
<div><br></div><div>the freeswitch gets down, with a windows message box prompting to debug or close the program. (a bug?)</div><div>does this mean in a lua script, "session" is only available after "answer"?</div>
<div><br></div></div>