con = freeswitch.EventConsumer("all"); --enabled EventConsumer service_type= session:getVariable("service_type") or ""; callee_id= string.sub(session:getVariable("caller_id_number"),5,-1) or ""; caller_id= string.sub(session:getVariable("ANI"),5,-1) or ""; uuid= session:getVariable("uuid") or ""; session:setVariable("ObCause", ""); --[[ freeswitch.consoleLog("info","service Name="..service_type.."\n") freeswitch.consoleLog("info","uuid="..uuid.."\n") freeswitch.consoleLog("info","caller ID="..caller_id.."\n") freeswitch.consoleLog("info","callee ID="..callee_id.."\n") --]] while (session:ready()) do session:setAutoHangup(false) for e in (function() return con:pop(1,500) end) do event_name = e:getHeader("Event-Name") or "" if (event_name == "CHANNEL_ANSWER") then session:sleep(1000); session:execute("avmd_start"); session:sleep(30000); --digits = session:read(1, 1, Obprompt, 3000, "#"); session:execute("avmd_stop"); session:hangup(); session:destroy(); end end end