Platform SDK: Web Telephony Engine

Confirming the Selection

When you use SR to get a caller's menu selection, the SR engine takes the caller's spoken input and attempts to match it to one of the items in the menu. Because SR engines are not always accurate, the caller should be given an opportunity to confirm a selection before the application proceeds.

The WTE includes built-in functionality for presenting a confirmation menu to the caller. The confirmation menu typically repeats the user's selection as the SR engine "understood" it, and asks the user to confirm that the understanding was correct. For example, the confirmation menu might say, "Please confirm your selection. If you said popcorn, press 1. If this is not correct, press 9."

By using the SuggestConfirmation property of the WTEApplication object, you can control whether the WTE presents the confirmation menu. If this property is FALSE (the default value), no confirmation menu is presented and the caller's chosen item (as the SR engine understood it) is immediately selected. If it is TRUE, the WTE presents the confirmation menu, as described in the following sections.

Custom Confirmation Menus

After the user makes a selection, Web telephony calls the onselectionerror event handler, if the HTML page includes one. The onselectionerror event allows the application to customize the confirmation menu. Typically, the event handler creates the confirmation menu based on the user's probable selection. An application can determine the probable selection by examining the phrases associated with the AlternativePhrases property of the ExOM object. For more information, see the AlternativePhrases property.

Before returning, the onselectionerror event handler should set the value of the External.Event.returnValue property to FALSE. This cancels the default operation of the Web telephony confirmation menu mechanism.

Default Confirmation Menus

If the application does not define an onselectionerror event handler, or if the handler does not set the External.Event.returnValue property to FALSE, Web telephony automatically constructs the confirmation menu.

First, Web telephony plays the text or wave file defined by the ConfirmationMenuAnnouncement property of the WTEApplication object. The phrase associated with the property can be something like "Please confirm your choice." Web telephony ignores the ConfirmationMenuAnnouncement property if it is empty.

Next, Web telephony plays the text or wave file associated with the ConfirmBefore property, followed by the text or wave file associated with the item detected by the SR engine (or the recognized phrase if a voice file is not found), and then plays the text or wave file associated with the ConfirmAfter property. Finally, Web telephony plays the text or wave file associated with the RepeatMenuAnnouncement property.

For example, suppose your application includes the following section of HTML code:

    <P>What would you like to drink: Coke, Pepsi, or Sprite?
    <select>
    <option>Coke
    <option>Pepsi
    <option>Sprite
    </select>

The default confirmation menu would be something like this:

    ConfirmationMenuAnnouncement: "Please confirm your choice"
    ConfirmBefore: "If you said"
    SR-detected phrase: "Pepsi"
    ConfirmAfter: "Press 1"   
    RepeatMenuAnnouncement: "If not, press 9."

The RepeatMenuKey property specifies the key that the caller presses if the SR result is not correct. In the previous example, the RepeatMenuAnnouncement property uses the "9" key because the RepeatMenuKey property is set to "9". If the caller presses this key, Web telephony offers the entire selection again. Note that you must specify the value of the RepeatMenuKey property—you cannot use the %1 notation in the RepeatMenuAnnouncement property. For more information about the %1 notation, see Assigning Dual Tone Multi-Frequency Digits to Menu Items.