Speak-n-Listen Column
Q. I've specified a series of prompts in a dialog. Each prompt has its own timeout value. My observation is that the total timeout is not the sum of the individually specified timeouts but instead something much shorter. How does the VoiceXML interpreter calculate the timeout value?
A. According to section 4.1.7 of the VoiceXML 2.0 specification, "if several prompts are queued before a field input, the timeout of the last prompt is used." In the following example, the interpreter should timeout after 3 seconds if the user doesn't press a key or say something.
<vxml version="2.0" xmlns=http://www.w3.org/2001/vxml>
<form>
<field>
<prompt timeout=".5s">welcome to acme travel</prompt>
<prompt timeout=".5s">to make a reservation say
'reservations'</prompt>
<prompt timeout="3s">to check on the status of a flight, say 'flight
status'</prompt>
<noinput>
<!-- 3 second timeout occurred -->
</noinput>
<!-- rest of field (nomatch, filled) -->
</field>
</form>
</vxml>
|
Q. I'm authoring a set of fields that accept DTMF input from the user. In our user tests, we've noticed that the user will sometimes hit the pound key after entering their input for the first field and wind up in the nomatch handler of the second field. What's going on?
A. You're running into a combination of timing and buffering issues.
Let's talk about timing first. A few VoiceXML properties control the timeout behavior during DTMF recognition. These are timeout, interdigittimeout, and termtimeout.
The timeout property applies to both voice and DTMF grammars. In the case of DTMF, it is used to determine when to throw a noinput event before the user types the first DTMF digit. That's not your issue since user input for your first field is getting collected and recognized.
Once the user has typed a digit but the recognizer has determined that the grammar is not ready to terminate, the recognizer times the interval before the next digit is pressed and compares it against the value of the interdigittimeout.property. If the interdigittimeout elapses, a nomatch event is thrown. That's not your problem either.
Once the user has typed enough digits to qualify for a valid recognition, the recognizer waits for the termtimeout interval before returning control to the interpreter. It's during that interval that the user is allowed to enter the optional terminating character (termchar) defined by the termchar property. Since the default value of the termtimeout property is 0 seconds (see section 6.3.3 of the VoiceXML 2.0 specification), the recognizer doesn't wait for the user to enter the termchar and returns control to the interpreter.
So, why doesn't your user get a chance to provide input for the second field? That's where buffering comes in. According to section 4.1.8 of the VoiceXML 2.0 specification, "DTMF input should be collected and buffered in the transition state." Since the termchar doesn't get collected by the recognizer for the first field, it gets buffered instead and applied as input for the next field, barges in over the prompt (the user will never hear it), and since it's the terminating character but the grammar is not satisfied, a nomatch is thrown.
Now that you understand what's going on, you have a couple of options to alleviate the situation:
- disable the terminating character (not recommended), or
- increase the value of the termtimeout property.
Touch-tone IVR systems have been around for a long time, and many users know that they can speed through a series of menus by rapidly typing the appropriate keys interspersed with the termchar. If you disable the termchar, you run the risk of frustrating users familiar with your application or with touch-tone systems in general.
Here's a better option: try setting termtimeout to a value greater than zero, and re-run your user tests until you achieve the most desirable user experience.
If you want a precise definition of all the timing issues related to DTMF, see Appendix D of the VoiceXML 2.0 specification. If you like to learn by example, I've included an example you can play with. It consists of two fields - the first field accepts five digits; the second accepts four. The termtimeout property has been commented out so that you can experience the default behavior. Observe what happens when you type five digits followed by the pound (#) key.
- You won't hear the contents of the first field's filled element.
- You won't hear the second field's prompt.
- The contents of the second field's nomatch handler will get executed.
Uncomment the termtimeout property, and observe how this changes the behavior of the application. If you type the pound key within three seconds of having typed the fifth digit, the interpreter will execute the first field's filled and the second field's prompt.
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" >
<property name="timeout" value="2s"/>
<!-- <property name="termtimeout" value="1s"/> -->
<form>
<field name="dig5">
<grammar src="builtin:digits?length=5"/>
<prompt>
Enter 5 digits
</prompt>
<catch event="noinput nomatch">
i d <value expr="_event"/>
<reprompt/>
</catch>
<filled>
You said <value expr="String(dig5).split(/ */)"/>
</filled>
</field>
<field name="dig4">
<grammar src="builtin:digits?length=4"/>
<prompt>
Enter 4 digits
</prompt>
<catch event="noinput nomatch">
pin <value expr="_event"/>
<reprompt/>
</catch>
<filled>
You said <value expr="String(dig4).split(/ */)"/>
</filled>
</field>
<block>
<exit/>
</block>
</form>
</vxml> |
Submit VoiceXML questions for Matt and other experts at VoiceXML Review HERE
back to the top
Copyright © 2001-2002 VoiceXML Forum. All rights reserved.
The VoiceXML Forum is a program of the
IEEE Industry Standards and Technology Organization (IEEE-ISTO).
|