I am looking at some sample vxml scripts from vxml.org. When i call the script the prompts play, but it doesnt pick up any of my inputs at all. when i speak it responds "no input". could i be missing some tag that indicates input from the user. this is the example script from the website:
<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1">
<link next="#MainMenu">
<grammar type="text/gsl">[main back begin]</grammar>
</link>
<form id="MainMenu">
<block>
<prompt bargein="false">
This is the Hello World Main Menu.
</prompt>
</block>
<field name="MeatOrPlant">
<prompt>
Are you a "Carnivore" or "Vegetarian".
</p开发者_如何学运维rompt>
<grammar type="text/gsl">
<![CDATA[[
[vegetarian plant veggie] {<MeatOrPlant "plant">}
[meat carnivore flesh animal] {<MeatOrPlant "meat">}
]]]>
</grammar>
<noinput>
<prompt>
I did not hear anything. Please try again.
</prompt>
<reprompt/>
</noinput>
<nomatch>
<prompt>
I did not recognize that lifestyle choice. Please try again.
</prompt>
<reprompt/>
</nomatch>
</field>
<filled>
<if cond="MeatOrPlant == 'meat'">
<goto next="#Meat"/>
<elseif cond="MeatOrPlant == 'plant'"/>
<goto next="#Plant"/>
</if>
</filled>
</form>
<form id="Meat">
<field name="BackToMain">
<prompt>
PETA is coming for you, be afraid.
If you wish to try again, please say Main.
</prompt>
</field>
<filled>
<!-- no way this will get hit -->
</filled>
</form>
<form id="Plant">
<field name="BackToMain">
<prompt>
Protein is the spawn of the devil.
If you wish to try again, please say "Main".
</prompt>
</field>
<filled>
<!-- no way this will get hit -->
</filled>
</form>
</vxml>
Anyone have a clue? TIA
You didn't mention the platform being used. Since you're using inline GSL, my first guess for platform would be TellMe or NVP, but I think there were others that supported inline GSL.
In any case, make sure you aren't getting a compilation error. I've seen a few platforms just ignore grammars that didn't compile. The snippets look correct, but given you aren't using the standard syntax (SRGS) I'm guessing this is an older implementation and the older the implementation, the more quirks and caveats you typically see.
Generally, I don't see anything wrong with the VoiceXML portion of your syntax to explain the behavior. While it's not associated with your symptoms, your destination forms may cause issues on some platforms given the lack of grammars and defined exits (your relying on default catch handlers). To just play information, the field sections should be blocks. And note, if the block just played audio and exited the link grammars may or may not be active (the specification would imply they are, but must platforms switch between processing and queuing audio and performing recognition. Recognition and the continuous switching in and out of active grammars is rare...
精彩评论