Using DTMF in Voice Platform

In VoiceXML, the inputmodes property controls the input modalities (voice and DTMF). Both voice and DTMF are enabled by default, so if you use DTMF in your application you do not need to set this property explicitly. However, if you needed to for some reason, you could set it in an application as follows:

<property name="inputmodes" value="voice dtmf"/>

The DTMF type-ahead buffer

Voice Platform includes an automatic type-ahead feature for DTMF input. Whenever a complete set of tones for the current recognition state is entered, any subsequent tones are added to the buffer. The system uses the current grammar to determine when the set of tones is complete for that state. When the next state begins, the system checks the DTMF buffer. If the buffer is not empty, the system skips the initial prompt and live recognition portion and tries to execute the state by interpreting tones from the buffer against the current grammar.

Flushing the buffer

The DTMF buffer is automatically flushed in the following situations:

  • At the end of a call
  • At the end of a non-barge-in prompt
  • When the VoiceXML inputmodes property is set to "voice"
  • When a recognition rejection occurs
  • When a recognition timeout occurs
  • At the end of a recording
  • When an exception occurs
  • If a recognition operation is aborted by the application

DTMF termination character

Depending on your configuration, the optional termination character may be buffered and used to try to process the subsequent recognition state. This can occur if the VoiceXML property termtimeout is set to zero (0) and the user enters the termination character. In this scenario, because the termination character is not included in the set of tones sent to the grammar, it is buffered instead. This typically causes a recognition rejection in the recognition state that follows.

Note: For details on the termtimeout property, see Timeouts in DTMF.

To work around this problem, you can do one of the following:

  • In the prompt before the DTMF input, do not ask the user to enter the termination character (most users do not enter it unless asked to).
  • Be sure that termtimeout is not set to 0 if a terminal character is supported.
  • Include the character as an optional terminal character in your grammar.

Timeouts in DTMF

The timeout property applies to all input after a prompt, whether it’s speech or DTMF. However, you can specify two additional timeouts that apply only for DTMF input.

  • Similar to incompletetimeout, the interdigittimeout property controls the timeout period between the entry of individual DTMF tones. The default value is five seconds.
  • The termtimeout property controls the timeout period after the final tone in a DTMF sequence. The final tone is determined by the current DTMF grammar. For example, if the grammar expects a sequence of 3 DTMF tones, then the third tone is treated as the final tone. Some notes:
    • The default value is five seconds.
    • If you set this property to a value greater than the interdigittimeout property, the value of the interdigittimeout property is used instead.
    • If the DTMF type-ahead feature is disabled, the termtimeout feature will not work.

As with other timeouts, these timeout values can be expressed in seconds (s) or milliseconds (ms).

For more information on timeouts, see Recognition timeouts.