dtmf Element
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Used in telephony applications to specify dual tone multi-frequency (DTMF) inputs and how to handle the collected results.
Syntax
<dtmf attributes>
<grammar attributes /> // Specifies grammar resources
<bind attributes /> // Copies recognition results to page elements or calls a methods of the target element
<param attributes /> // Specifies platform configuration parameters
</dtmf>
Members
The dtmf element consists of the following members.
Content | Description |
---|---|
grammar |
Specifies input grammar resources. |
bind |
Copies one semantic element of recognition results to an HTML page element or calls a method of the target element. |
param |
Specifies a Speech Server configuration parameter. |
Attribute | Description |
---|---|
id |
Identifies the dtmf element. |
endsilence |
Specifies, in milliseconds, the time period when DTMF input matches the grammar but further input is still possible. |
initialtimeout |
Specifies, in milliseconds, the time-out period for receiving the first DTMF keypress. |
interdigittimeout |
Specifies, in milliseconds, the time-out period between DTMF keypresses after the first keypress is recognized. |
preflush |
Specifies whether to automatically flush the DTMF buffer on the underlying telephony interface card before activation. |
Property | Description |
---|---|
dtmfresult |
Contains the results of DTMF collection. |
status |
Indicates the success of a DTMF collection by the telephony platform. |
text |
Contains a string holding the DTMF digits collected. |
Method | Description |
---|---|
Start |
Starts the DTMF collection session. |
Stop |
Stops the DTMF collection session. |
Flush |
Flushes the DTMF collection buffer. |
Event | Description |
---|---|
onerror |
Occurs when the DTMF collection or recognition process encounters a serious or fatal error. |
onkeypress |
Occurs every time a user presses a grammar-defined DTMF key. |
onnoreco |
Occurs when a DTMF key is pressed that is not valid according to the DTMF grammar or when the interdigittimeout period is exceeded. |
onreco |
Occurs when a DTMF session ends with a recognition. |
onsilence |
Occurs when no DTMF keys have been pressed before the initialtimeout expires. |
Event Diagram | Description |
---|---|
dtmf Event Diagram |
Illustrates the event timelines associated with the dtmf element. |
dtmf/listen Interaction |
Illustrates the interaction timelines that occur when a dtmf element and a listen element are concurrently active. |
Remarks
The dtmf element creates an object for the recognition of DTMF touch-tone signals.
Activate the dtmf element using scripting or inline markup language syntax. When activated and a key is pressed, DTMF input can interrupt any active prompt if the bargein attribute of the prompt element is set to true.
Example
The following code demonstrates the use of the dtmf element.
<html xmlns:salt="http://www.saltforum.org/2002/SALT">
...
<body>
<input type="text" name="iptAreaCode" onFocus="dtmfAreaCode.Start()" />
<input type="text" name="iptPhoneNumber" />
...
<salt:dtmf id="dtmfAreaCode" onkeypress="dtmfKeyPressHandler()" onreco="dtmfPhoneNumber.Start()" onsilence="dtmfSilenceHandler()" onerror="dtmfErrorHandler()" onnoreco="dtmfErrorHandler()" initialtimeout="5000" interdigittimeout="2000" preflush="true">
<!-- grammar result will contain "smlAreaCode" node -->
<salt:grammar src="3digits.grxml" />
<salt:bind value="//smlAreaCode" targetelement="iptAreaCode" />
</salt:dtmf>
<salt:dtmf id="dtmfPhoneNumber" onkeypress="dtmfKeyPressHandler()" onerror="dtmfErrorHandler()" initialtimeout="5000" interdigittimeout="2000" preflush="true">
<!-- grammar result will contain "smlPhoneNumber" node -->
<salt:grammar src="7digits.grxml" />
<salt:bind value="//smlPhoneNumber" targetelement="iptPhoneNumber" />
</salt:dtmf>
<script language="jscript">
<!--
function dtmfSilenceHandler() {
...
}
function dtmfErrorHandler() {
...
}
function dtmfKeyPressHandler() {
...
}
-->
</script>
<body>
</html>