[Freeswitch-users] Capture DTMF and play and detect speech in Lua
Manuel Durán Aguete
manuel at aguete.org
Mon Aug 26 14:42:55 MSD 2013
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130826/a567bafb/attachment.html
Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users
mailing list