Call Us Today! 877.742.2583

Page tree
Skip to end of metadata
Go to start of metadata


Play while doing speech recognition. Result is stored in the [[Variable_detect_speech_result | detect_speech_result]] channel variable.


 Click here to expand Table of Contents



  • file : file to play. See mod_dptools: playback for details.
  • engine : speech recognition module. e.g. unimrcp
  • mrcp_profile : which mrcp profile client you used(optional), what defined in the directory mrcp_profiles.
  • {param1=val1} : optional speech recognition parameters. This is specific to the speech recognition module used.
  • grammar : ASR grammar may be inline:, builtin:, session:, a URL, a filename, etc.

Channel Variables

  • detect_speech_result — FreeSWITCH sets this variable to the reason that terminated the playback or TTS. Returns "DIGIT: x" where x = the Touch Tone digit that terminated the playback or TTS sequence.
  • play_and_detect_speech_close_asr — Set this variable to true to close the speech recognition port upon completion. This returns the port license to the available pool instead of holding it for the duration of the call.
  • playback_terminator_used — FreeSWITCH sets this variable to the Touch Tone digit that terminated playback or TTS. Must be a digit specified to playback_terminators. Returns "x" where x = the Touch Tone digit that terminated the playback or TTS sequence.
  • playback_terminators — Set this variable to the string of Touch Tone digits that will end playback or TTS. If this variable is not set, then Touch Tone digits will be ignored by this app, only speech will detected.


TouchTone Digit Detection

If the caller presses '2' during the playback of a prompt file or a say TTS command, the result will be returned in detect_speech_result as "DIGIT: 2" and in playback_terminator_used as "2".

TTS in XML Dialplan

This example demonstrates using TTS and speech recognition with mod_unimrcp.

TTS dialplan



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:".

TTS play .wav dialplan


This example Lua script uses mod_unimrcp and Lumenvox

See Also


1 Comment

  1. Why  did not app play_and_detect_speech trigger DETECTED_SPEECH event like app detect_speech ?