Use the eval API:
Hi,I have difficult to check the state of an originated session in lua script.I want to know when the originated session is ringing back or progressing or answered.I have tried with session:getState() but returns always CS_SOFT_EXECUTE.My lua test script is called from dialplan with a:<action application="lua" data="test1.lua"/>And the "test1.lua" script is:session2 = freeswitch.Session("sofia/external/xxxxxx@a.b.c.d");while (session:ready() and session2:ready()) dostate2 = session2:getVariable("channel_call_state");freeswitch.consoleLog("warning", "State2 = " .. state2 .. "\n");session:execute("sleep", "500");endif (session:ready()) thensession:hangup();endif (session2:ready()) thensession2:hangup();endThis script fails because the session:getVariable("channel_call_state") returns nil.What is the correct way to know the state of a call?Stephen
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org