» Sign in

Choose from the following:

 » Description
 » Size of package
 » Format
 » Notes



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:
  • asks the caller to say a digit (from 0 to 9)
  • plays the recognized digit to the caller


<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml"

  <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">
        Please say a digit.
      <grammar mode="voice" version="1.0" root="root">
        <rule id="root" scope="public">
            <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>
          Thanks, I think you said
          <value expr="digit"/>.
      <!-- Message played if any error occured -->
      <error count="1">
        An error has occured.
      <!-- Message played if the caller does not say anything -->
      <noinput count="1">
        Sorry, I did not hear anything. Try again.
      <!-- Message played if the caller says something
            that does not match -->

      <nomatch count="1">
        Sorry, I did not understand that. Try again.

 » Back to top

Size of package

 » Back to top


 » Back to top


Warning: You must install and enable an English TTS engine and an English ASR engine before executing this service.
 » Back to top

Licensing and download



 » en_inlinegrammar.zip
zip file
(2.0 KB)
Aug 2007

Manage My AllianceOne Membership

 » Sign in
 » Join AllianceOne
 » Contact us