Misc. Dialplan Tools play and detect speech
From FreeSWITCH Wiki
Contents |
Description
Play while doing speech recognition. Result is stored in the detect_speech_result channel variable.
Usage
<file> detect:<engine> {param1=val1,param2=val2}<grammar>
Parameters
- file = file to play. See playback for details.
- engine = speech recognition module. e.g. unimrcp
- {param1=val1} = optional speech recognition parameters. This is specific to the speech recognition module used.
- grammar = grammar may be inline:, builtin:, session:, a URL, a filename, etc.
Examples
This example demonstrates using TTS and speech recognition with mod_unimrcp.
<extension name="play_and_detect_speech example">
<condition field="destination_number" expression="^(1888)$">
<action application="set" data="tts_engine=unimrcp"/>
<action application="set" data="tts_voice=donna"/>
<action application="play_and_detect_speech" data="say:please say yes or no. please say no or yes. please say something! detect:unimrcp {start-input-timers=false,no-input-timeout=5000,recognition-timeout=5000}builtin:grammar/boolean?language=en-US;y=1;n=2"/>
<action application="log" data="CRIT ${detect_speech_result}"/>
</condition>
</extension>
This example demonstrates playing a wav file and speech recognition with mod_unimrcp. Note: There is no space between wav and detect. As of 25 Apr 2012, any amount of whitespace is allowed between the wav file and "detect:".
<extension name="play_and_detect_speech example">
<condition field="destination_number" expression="^(1888)$">
<action application="set" data="tts_engine=unimrcp"/>
<action application="set" data="tts_voice=donna"/>
<action application="play_and_detect_speech" data="ivr/say_yes_or_no.wavdetect:unimrcp {start-input-timers=false,no-input-timeout=5000,recognition-timeout=5000}builtin:grammar/boolean?language=en-US;y=1;n=2"/>
<action application="log" data="CRIT ${detect_speech_result}"/>
</condition>
</extension>

