However, I cannot get the script to quit after 3 invalid numbers.
It quits after 3 nomatch or noinput fine. It also works fine if you enter a valid number.
What is wrong here?
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vxml PUBLIC "-//The Plum Group//Voice Markup Language 2.0//EN" "http://vxml.plumgroup.com/vxml-221.dtd">
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<form id="id" scope="dialog">
<block>
hello
</block>
<field name="fieldPin" type="digits">
<catch event="invalid" count="1">
<reprompt/>
</catch>
<catch event="invalid nomatch noinput" count="3">
<prompt bargein="false">
<audio src="/vxml/audio/dummy.wav">
The application only permits 3 invalid PIN attempts.
Please call 800-555-1212 to make sure you have a valid
PIN number.
</audio>
</prompt>
<var name="msgReference" expr="'3_101730'" />
<submit next="http://website/vxml/goodbye.xml"
namelist=" msgReference"
method="get"
enctype="application/x-www-form-urlencoded" />
</catch>
<prompt bargein="true">
<audio src="/vxml/audio/dummy.wav">
Please enter your pin number.</audio>
</prompt>
<filled>
<if cond="fieldPin!=1234">
The value<value expr="fieldPin" /> is not valid
<clear namelist="fieldPin"/>
<throw event="invalid"/>
</if>
</filled>
</field>
<field name="field90" type="number">
<prompt bargein="true">
<audio src="/vxml/audio/dummy.wav">
What is your weight in pounds?
</audio>
</prompt>
<filled>
</filled>
<nomatch>
<audio src="/vxml/audio/sorry.wav">
Sorry I didn't understand
</audio>
<audio src="/vxml/audio/useKeyboard.wav">
You can also enter the value using the keypad.
</audio>
<reprompt />
</nomatch>
</field>
<field name="confirm90">
<grammar type="application/x-jsgf">(yes|1) {yes} | (no | 2) {no}</grammar>
<prompt bargein="false">
<audio src="/vxml/audio/dummy.wav">
You entered <value expr="field90" />
</audio>
<audio src="/vxml/audio/isCorrect.wav">
Is this correct?
</audio>
</prompt>
<filled>
<if cond="confirm90=='no'">
<clear namelist="field90 confirm90" />
<goto nextitem="field90" />
</if>
</filled>
</field>
<var name="msgReference" expr="'3_101730'" />
<block>
<submit next="http://website/receive"
namelist="field90"confirm90 msgReference"
method="get"
enctype="application/x-www-form-urlencoded"/>
</block>
</form>
</vxml>