Generating DTMF output
Most of the output that a voice application sends out through the Telephony Session service consists of prompts spoken to the caller. However, at times you may need for your application to produce DTMF output. For example, you may need to produce DTMF at the start of your VoiceXML application to perform an outbound call, or to dial a particular extension number once the system on the far end of the call answers.
You can instruct your application to play pauses and DTMF tones as part of the <audio> element of VoiceXML.
For example, to send the DTMF tone for the digit n, use the following VoiceXML:
<audio src="dtmf:n"/>
To pause x milliseconds, use the following:
<audio src="pause:x"/>
The VoiceXML form below plays four digits (1, 2, 3, and 4) with a 100 millisecond pause between each DTMF tone:
<form id="playdtmftest">
<block>
Playing DTMF
<audio src="dtmf:1"/>
<audio src="pause:100"/>
<audio src="dtmf:2"/>
<audio src="pause:100"/>
<audio src="dtmf:3"/>
<audio src="pause:100"/>
<audio src="dtmf:4"/>
<audio src="pause:100"/>
</block>
</form> <!-- playdtmftest -->
These DTMF tones are sent by the Speech Server as RFC2833 events. SIP PSTN gateways or NMS boards typically convert RFC2833 DTMF events to the equivalent DTMF tone.