<div dir="ltr">Hello,<div><br></div><div>I'm trying to capture DTMF when doing play_and_detect_speech:</div><div><br></div><div><div>function capture_dtmf(session,input_type,data,arg)</div><div> if input_type == "dtmf" then</div>
<div> freeswitch.consoleLog("CRIT","Key pressed: " .. data["digit"] .. "\n")</div><div> end</div><div>end</div></div><div><br></div><div><div>session:answer()</div>
<div>session:sleep(1000)</div><div>session:setInputCallback("capture_dtmf","true")<br></div></div><div><br></div><div><div>session:execute("play_and_detect_speech",</div><div>"phrase:wellcome detect:unimrcp {start-input-timers=false,no-input-timeout=5000,recognition-timeout=5000, speech-language=es-ES}builtin:grammar/digits")</div>
</div><div><br></div><div><br></div><div><div>xml = session:getVariable('detect_speech_result')</div><div>if xml ~= nil then</div><div> freeswitch.consoleLog("CRIT", xml .."\n")</div><div>
else</div><div> freeswitch.consoleLog("CRIT", "No result!\n")</div><div>end</div></div><div><br></div><div>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 ?</div>
<div><br></div><div>Thank you. Regards.</div></div>