VoiceXML 2.1 Development GuideHome  |  Frameset Home

  grXML DTMF grammars  |  TOC  |  grXML Grammar Slots  

Built-in Grammar Types

The W3C VoiceXML 2.0 specification defines a package of built-in grammar types that you may reference by specifying the grammar name in the 'type' attribute of the <field> element. These grammars will accept either voice or DTMF input from the user. Note that you will not need to further specify an external or inline grammar when using the field types:
...
<field name="F_1" type="digits">
  ...
  <filled>
    <prompt>
      your input was <value expr="F_1"/>.
    </prompt>
  </filled>
</field>
...


The complete listing of the supported built-in grammar types for the VoiceXML platforms are as follows:

You may also reference these built-in grammars directly with the grammar tag. Note that doing it this way requires you specify a separate grammar for voice and for DTMF input.


=grXMLbuiltins.xml</b<

<?xml version="1.0"?>
<vxml version="2.1">
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM">
<meta name="author" content="Dustin Hayre"/>
<meta name="copyright" content="2008 Voxeo Corporation"/>

<form>
<field name="F_1">
<grammar src="builtin:grammar/boolean"/>
<grammar src="builtin:dtmf/boolean"/>

  <prompt> Here you can say yes, no, true or false, or press 1 for true and 2 for false </prompt>

  <filled>
    <!-- the interpretation will always be TRUE or FALSE -->
<log expr="'**** BOOLEAN: ' + lastresult$.interpretation"/>
  </filled>
</field>
<field name="F_2">
<grammar src="builtin:grammar/digits"/>
<grammar src="builtin:dtmf/digits"/>

  <prompt> Here you can input up to 16 digits, either by voice or DTMF - example: one two three four </prompt>

  <filled>
<log expr="'**** DIGITS: ' + lastresult$.interpretation"/>
  </filled>
</field>

<field name="F_3">
<grammar src="builtin:grammar/number"/>
<grammar src="builtin:dtmf/number"/>

  <prompt> Here you can input a number by voice or DTMF - examples: one hundred fifty, one thousand two hundred  </prompt>

  <filled>
<log expr="'**** NUMBER: ' + lastresult$.interpretation"/>
  </filled>
</field>

<field name="F_4">
<grammar src="builtin:grammar/currency"/>
<grammar src="builtin:dtmf/currency"/>

  <prompt> Here you can input major currency such as Dollars, Pounds or Euros - examples: fifteen dollars and fifty cents, twenty euros </prompt>

  <filled>
<log expr="'**** CURRENCY: ' + lastresult$.interpretation"/>
  </filled>
</field>

<field name="F_5">
<grammar src="builtin:grammar/time"/>
<grammar src="builtin:dtmf/time"/>

  <prompt> Here you can enter the hour and minute by voice or DTMF - examples: half past two, twelve thirty </prompt>

  <filled>
<log expr="'**** TIME: ' + lastresult$.interpretation"/>
  </filled>
</field>

<field name="F_6>
<grammar src="builtin:grammar/date"/>
<grammar src="builtin:dtmf/date"/>

  <prompt> Here you can enter the date by voice or DTMF - example: august 20th </prompt>

  <filled>
<log expr="'**** DATE: ' + lastresult$.interpretation"/>
  </filled>
</field>
</form>
</vxml>


  Source Code.



  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login
  grXML DTMF grammars  |  TOC  |  grXML Grammar Slots  

© 2008 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site