This sample illustrates how to specify a grammar within the VoiceXML code. This kind of grammar is called "inline." This grammar is used by the Automatic Speech Recognition engine to detect specific words. On an incoming call, the service:
<meta name="en_inlinegrammar.vxml" content=""/>
<meta name="Author" content="HP"/>
<meta name="Date" content="September, 2005"/>
<meta name="Description"
content="This VoiceXML example is provided
as part of an HP OpenCall Media Platform
VoiceXML installation"/>
<meta name="Support" content="none"/>
<!-- Deactivate the barge in feature -->
<property name="bargein" value="false"/>
<form id="WhichDigit" scope="dialog">
<field name="digit">
<prompt>
Please say a digit.
</prompt>
<grammar mode="voice" version="1.0" root="root">
<rule id="root" scope="public">
<one-of>
<item> zero </item>
<item> one </item>
<item> two </item>
<item> three </item>
<item> four </item>
<item> five </item>
<item> six </item>
<item> seven </item>
<item> eight </item>
<item> nine </item>
</one-of>
</rule>
</grammar>
<filled>
<prompt>
Thanks, I think you said
<value expr="digit"/>.
</prompt>
</filled>
<!-- Message played if any error occured --> <error count="1">
An error has occured.
</error>
<!-- Message played if the caller does not say anything --> <noinput count="1">
Sorry, I did not hear anything. Try again.
<reprompt/>
</noinput>
<!-- Message played if the caller says something
that does not match --> <nomatch count="1">
Sorry, I did not understand that. Try again.
<reprompt/>
</nomatch>
</field>
</form>
</vxml>