0

我有以下代码,经过五次尝试(错误的词,如“dfasfasfb”),应用程序停止。

在我说错词后,它会说,“对不起,我没听懂”(用我的语言)。但是有一个默认中断或类似的东西 - 我如何将默认设置为无限制或 20?

谢谢

<?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>

编辑:

现在我使用不匹配:

<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>

但是经过五次尝试,程序只是选择了一个选项.. 我说了五次错误的单词,第五次之后它选择了最后一个选项。

4

1 回答 1

1

您尚未指定 nomatch 捕获处理程序,因此您可能陷入了平台的内置处理程序。如果您想要无限重试,在菜单内添加一个空的 nomatch 块应该可以。您还可以使用符号来指示要中止的计数(在 catch 块中使用 goto 到新位置)。

查看catch 处理程序文档nomatch 表示法

于 2010-11-23T15:03:38.257 回答