Hello,
I'm trying to capture DTMF when doing play_and_detect_speech:
function capture_dtmf(session,input_type,data,arg)
if input_type == "dtmf" then
freeswitch.consoleLog("CRIT","Key pressed: " .. data["digit"] .. "\n")
end
end
session:answer()
session:sleep(1000)
session:setInputCallback("capture_dtmf","true")
session:execute("play_and_detect_speech",
"phrase:wellcome detect:unimrcp {start-input-timers=false,no-input-timeout=5000,recognition-timeout=5000, speech-language=es-ES}builtin:grammar/digits")
xml = session:getVariable('detect_speech_result')
if xml ~= nil then
freeswitch.consoleLog("CRIT", xml .."\n")
else
freeswitch.consoleLog("CRIT", "No result!\n")
end
The asr seems to work, but when no dtmf is captured in capture_dtmf. Is DTMF capture with input callback supported by play_and_detect_speech ? Need to use detect_speech ?
Thank you. Regards.