Platform SDK: Web Telephony Engine

Handling Time-outs and Non-valid Keys

Callers can make two types of errors while responding to a menu or entering data in an entry field. They can press a non-valid key, or they can cause a time-out error to occur by waiting too long before selecting a menu item or entering data. Whenever the WTE detects an error—either a time-out or non-valid key—it clears and ignores all the caller input gathered thus far for the menu or entry field, including the digit that caused an input error.

The WTEApplication object includes a number of configuration properties that specify how your application responds when the caller commits an error. The object also includes configuration properties that specify the time-out durations for your application's menus and entry fields.

The FirstTimeoutInterval property specifies the maximum amount of time that the WTE will wait for the caller to select a menu item or to begin entering data into an entry field. The InterTimeoutInterval property specifies the maximum amount of time that the WTE will wait for the caller to enter each successive digit into a multidigit entry field, or to select a menu item that was assigned a multidigit access key by the WTE (see Assigning Dual Tone Multi-Frequency Digits to Menu Items).

Default Error Handling

By default, whenever the time-out interval specified by FirstTimeoutInterval or InterTimeoutInterval expires, the WTE increments an internal error counter and then plays the text or wave file specified by the TimeoutAnnouncement property. Similarly, whenever the caller presses a non-valid key, the WTE increments the counter and then plays the text or wave file specified by the InvalidKeyAnnouncement property. After playing the TimeoutAnnouncement or InvalidKeyAnnouncement announcement, the WTE repeats the menu or re-introduces the entry field, giving the caller another chance to select an item or enter data. When the WTE detects an error—either a time-out or non-valid key—it clears and ignores all the caller input gathered thus far for the menu or entry field, including the digit that caused an input error.

When the caller successfully selects a menu item or satisfies the entry field, the internal error counter is reset to zero and the engine continues rendering the application.

The MaxRetries property specifies the maximum number of errors (time-outs and non-valid keys) that the caller is allowed to make. If the caller makes more than the specified number of errors, the WTE navigates to the application's recurring-error page, which is specified by the RecurringErrorPage property. If no recurring-error page is specified, the WTE disconnects the call.

Custom Error Handling

You can override the WTE's default error-handling procedure by including handlers for the onselectiontimeout and onselectionerror events. The engine fires these events after an error occurs, but before playing the text or wave files associated with the TimeoutAnnouncement and InvalidKeyAnnouncement properties. Your event handlers can prevent the engine from performing its default error handling procedure by setting the window.external.event.returnValue property to FALSE or by navigating to another location.

The following example shows a handler for the onselectiontimeout event. The handler sets two configuration parameters for the application before navigating to the HTML page called Timeout.htm.

<SCRIPT LANGUAGE="VBSCRIPT" FOR="account" EVENT="onselectiontimeout">
window.External.Configuration.OfferItems = TRUE
window.External.Configuration.UseSR = FALSE
window.navigate("Timeout.htm")
</SCRIPT>