» Sign in
  

Choose from the following:

 » Description
 » Size of package
 » Format
 » Notes

Description

Scenario

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

Code


<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0" 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">

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

 » Back to top

Size of package

25KB
 » Back to top

Format

ZIP
 » Back to top

Notes

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

Size

Date

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


Manage My AllianceOne Membership

 
 » Sign in
 » Join AllianceOne
 » Contact us