I have following code, after five tries (wrong words like" dfasfasfb") the application stops.
After I say a wrong word, it says, "excuse me, I d开发者_Python百科idn't get it" (in my language). But then there is a default break or something like that - how can I set the default to unlimited or 20?
thanks
<?xml version="1.0" encoding="UTF-8"?>
<vxml xmlns="http://www.w3.org/2001/vxml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/vxml
http://www.w3.org/TR/voicexml20/vxml.xsd"
version="2.0">
<menu dtmf="true">
<prompt> Wilkommen. Waehlen Sie apple, short oder house </prompt>
<choice next="#apple"> apple</choice>
<choice next="#short"> short </choice>
<choice next="#house"> house </choice>
</menu>
<form id="apple">
<block>
You chose apple
<exit/>
</block>
</form>
<form id="short">
<block>
You chose short
<exit/>
</block>
</form>
<form id="house">
<block>
You chose house
<exit/>
</block>
</form>
</vxml>
Edit:
Now I use the nomatch:
<menu id="nachauswahl" dtmf="true">
<prompt>
Sagen Sie "wiederholen" oder "neue Anfrage" oder "andere Variante"
</prompt>
<choice next="#wiederholen"> wiederholen </choice>
<choice next="#neue_Anfrage"> neue Anfrage </choice>
<choice next="#andere_Variante"> andere Variante </choice>
<choice next="#Abbrechen"> Abbrechen </choice>
<choice next="#Hilfe2"> Hilfe </choice>
<nomatch>
<goto next="#nomatch_nachauswahl"/>
</nomatch>
</menu>
...
<form id="nomatch_nachauswahl">
<block>
Ich habe Sie leider nicht verstanden.
<goto next="#nachauswahl"/>
</block>
</form>
but after five tries, the program just choose an option .. I said five times a wrong word, and after the fifth time it chose the last option.
You haven't specified a nomatch catch handler so you are probably falling into your platform's built-in handler. If you want infinite retries, adding an empty nomatch block inside of the menu should work. You can also use the notation to indicate on which count you want to abort (use a goto in the catch block to the new location).
Look at the catch handler documentation and the nomatch notation.
精彩评论