How to capture an events by setInputCallback ?
function my_cb(s, type, obj, arg) if (arg) then print("type: " .. type .. "\n" .. "arg: " .. arg .. "\n"); else print("type: " .. type .. "\n"); end if (type == "dtmf") then print("digit: [" .. obj['digit'] .. "]\nduration: [" .. obj['duration'] .. "]\n"); else print(obj:serialize("xml")); end return true end blah="w00t"; $ local session = freeswitch.Session("sofia/internal/Dt002%172.16.0.49"); session:answer(); session:execute("enable_heartbeat", 5); session:setInputCallback("my_cb", "blah"); session:streamFile("/tmp/1.wav"); This script is work, but only for DTMF.
participants (1)
-
Чистяков Иван