VoiceXML 2.1 Development Guide Home  |  Frameset Home


<choice>  element


The choice element is used in conjunction with the menu element to create robust voice menus that allow the caller multiple navigational choices without the need for traditional grammar structures. The menu tag acts as the container element, while the choice element defines the available menu items.


usage

<choice accept="(approximate|exact)" dtmf="CDATA" event="NMTOKEN" eventexpr="CDATA" expr="CDATA" fetchaudio="CDATA" fetchhint="(prefetch|safe)" fetchtimeout="CDATA" maxage="CDATA" maxstale="CDATA" message="CDATA" next="CDATA">


attributes

accept Data Type: (approximate|exact) Default: Optional
accept is a w3c compliant attribute that allows the developer to specify whether an exact or an approximate utterance will be considered a valid grammar match for the phrase contianed within the choice element. If set to 'approximate' then the caller is allowed quite a bit of leeway in regards to how exact the utterance must be, while a setting of 'exact' designates more stringent control of what is considered valid. For example, if the grammar value is the string 'david hasselhoffs self integrity', then an utterance of 'hasselhoff' will be considred a valid match if the accept setting is 'approximate', but not if set to 'exact'.

Do note that the choice accept value will override the menu accept setting; therefore, to ease confusion, it is recommended that you simply use the choice accept setting whenever possible.
dtmf Data Type: CDATA Default: Optional
The dtmf attribute indicates the dtmf key that is linked to a specific menu choice.
event Data Type: NMTOKEN Default: Optional
The event attribute specifies the catchable event to be thrown upon a choice match; this essentially functions identically to having a throw event linked to a menu choice.
eventexpr Data Type: CDATA Default: Optional
The eventexpr attribute specifies an ECMAScript expression that evaluates to the event being thrown to the application. As mentioned, either platform defined events, or user-defined events may be indicated in this attribute. Please note that either event or eventexpr may be used within the parent element, but not both.
expr Data Type: CDATA Default: Optional
The expr attribute allows us to use a variable expression rather than a static value to determine the resultant dialog or document URI that the application transitions to upon a user’s selection.
fetchaudio Data Type: CDATA Default: Optional
The fetchaudio attribute specifies the URI of the .wav file to play to the caller in the event of an extended document fetch. Essentially, while the fetch is being made, it allows the developer to play some filler music to the caller rather than presenting only silence.
fetchhint Data Type: (prefetch|safe) Default: safe
Fetchhint is used to specify when the resource should be fetched during application execution. The possible values and their descriptions are:
  • prefetch : Begin the resource fetch upon initial document execution
  • safe: Only fetch the resource when it is specifically called in the application

Note that the Voxeo platform will always *not* prefetch content by default. As such, a developer should specify a value of ''prefetch" if resources are to be made available prior to execution of application content.
fetchtimeout Data Type: CDATA Default: 5s
The ‘fetchtimeout’ attribute is used to indicate how long, (in seconds or milliseconds), the interpreter should attempt to fetch the content before throwing an error.badfetch exception. See Appendix C for further information.
maxage Data Type: CDATA Default: Optional
The maxage and maxstale attributes replace the VXML 1.0 caching attribute for compliance to the w3c vxml 2.0 specification. The value for this attribute specifies the maximum acceptable age, in seconds, of the resource in question. However, it is strongly advised not to rely on this attribute for cache-control; caching is always best controlled by the hosting server's response headers. If no headers are specified, then no cache control will be present, regardless of the value set for the maxage and maxstale attributes.
maxstale Data Type: CDATA Default: Optional
The maxage  and maxstale attributes replace the VXML 1.0 caching attribute for compliance to the w3c vxml 2.0 specification. The value for this attribute specifies the maximum acceptable staleness, in seconds, of the resource in question. However, it is strongly advised not to rely on this attribute for cache-control; caching is always best controlled by the hosting server's response headers. If no headers are specified, then no cache control will be present, regardless of the value set for the maxage and maxstale attributes.
message Data Type: CDATA Default: Optional
The message attribute allows the developer to include a descriptive message along with the event that is being thrown. The message being thrown is accessible in the catch elements shadow variable _message.
next Data Type: CDATA Default: Optional
The next attribute identifies the resultant dialog or document URI that the application transitions to upon a user’s selection.



shadow variables

none


parents

<menu>


children

<audio>   <break>   <emphasis>   <enumerate>   <grammar>   <mark>   <paragraph>   <phoneme>   <prosody>   <say-as>   <sentence>   <value>


code samples

<Choice event-fetchhint-maxage> sample
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>

  <catch event="Grobleski_event">
    <prompt> hey we caught the choice event. </prompt>
  </catch>

<menu id="M_1">
  <prompt> say choice one to trigger the event </prompt>

  <choice event="Grobleski_event" fetchhint="prefetch"
        maxage="500">

    choice one
  </choice>

</menu>

</vxml>


<Choice next-fetchtimeout-maxstale> sample
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>

<menu id="M_1">
  <prompt> say choice one to test the choice element </prompt>

  <choice next="#F1" fetchtimeout="10s" maxstale="500">
    choice one
  </choice>

</menu>

<form id="F1">

  <block>
  <prompt> test successful </prompt>
  </block>

</form>
</vxml>


<Choice fetchaudio> sample
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>

<menu id="M_1">
  <prompt> say choice one to test the choice element </prompt>
  <choice next="SomePageThatTakesForeverToLoad.vxml" fetchaudio="MySoundFile.wav">
    choice one
  </choice>
</menu>

</vxml>


<Choice expr> sample
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/> 


<var name="MyVarExpr"  expr="'#F1'"/>

<menu id="M_1">
  <prompt> say one to test the choice element </prompt>

  <choice expr="MyVarExpr">
    one
  </choice>
</menu>

<form id="F1">
  <block>
  <prompt> test successful </prompt>
  </block>
</form>
</vxml>


<Choice accept-dtmf-message> sample
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>

  <catch event="Event_1 Event_2">
  <prompt>
    <value expr="_message"/>
  </prompt>
  </catch>



  <menu id="menu">
  <prompt>
    What is the deal to the ending of the movie Magnolia?
    If you think it was a biblical theme, say biblical or press one.
    If you think it was just crazy talk, say hooey, or press two.
  </prompt>


  <choice event="Event_1" accept="approximate"
        dtmf="1"
        message="'Well, that is kind of a pretentious opinion dont you
        think?'">

          most definitely intended to be biblical
  </choice>


  <choice event="Event_2" accept="exact"
        dtmf="2"
        message="'Gesundheight'">

          hooey
  </choice>


  </menu>
</form>

</vxml>



additional links

W3C 2.0 Specification


  ANNOTATIONS: EXISTING POSTS
imightbewrong92
3/29/2006 5:18 AM (EST)
How to play a beep after the user inputs a DTMF like '*' for example.

I try :


<menu id="Confirmation">
        <prompt bargein="true">
                <audio src="./audio/ConfirmationEtoile.wav">
                        Confirmer en appuyant sur la touche étoile sinon patienter.
                </audio>
                Pour recommencer la saisie appuyer sur la touche dièse.
        </prompt>
                <choice dtmf="*" next="#F1"/>
                <choice dtmf="#" next="#main"/>
        <noinput>
                <goto next="#main"/>
        </noinput>
        <nomatch>
                <goto next="#main"/>
        </nomatch>
</menu>
<form id="F1">
<block>
<prompt>
<audio src="./audio/beep.wav" />
</prompt>
</block>
</form>



But it sounds not good. It's too long between the input and the audio file beep.wav.

Is there an attribute in the choice balise to do this ?

Thanks
mikethompson
3/29/2006 11:40 AM (EST)
Hello Jeremy,

The <audio> element is actually a valid child of the <choice> element.  So, from within the choice element you can play your beep.wav much faster than by navigating to a new form.  Give this a shot, as I think you'll find the response time much faster.

Regards,
Mike Thompson
Voxeo Extreme Support
PUNUKA
9/11/2006 6:25 AM (EDT)
hi. I have just been wondering whether a sequence of dtmf key values like "123" can be used as a single DTMF key recognition in choice. if the case then is it a standard of W3C. kindly help
MattHenry
9/11/2006 10:26 PM (EDT)


Hello Punuka,

I haven't tested this myself, but I would be very surprised if this was, in fact supported. Menu/choice is meant for simple, economical grammars, and anything that requires multi-digit dtmf entry should probably use a user-defined grammar, or one of the builtin field types.

~Matthew Henry
alexey.timofeev
7/24/2007 5:23 AM (EDT)
Hi!

First of all, great thanks for such fantastic manual. It is really very useful and convenient.

I have a question due to using <menu> and <choice> elements for emulating grammar.

If I have the structure as follows:
<?xml version="1.0"?>
<vxml version="2.1" >
 
  <menu id="q1" scope="dialog" dtmf="true">
    <prompt timeout="10s">
        Press 1 or Press 2
    </prompt>
   
    <choice dtmf="1" next="#q2"/>
    <choice dtmf="2" next="#q2"/>
   
    <noinput>
      <goto next="#q1"/>
    </noinput>
   
    <nomatch>
      <goto next="#q1"/>
    </nomatch>
   
  </menu>
 
  <form id="q2">
    <block>
    <prompt timeout="10s">
      The answer is '{here I want to reproduce the value the scripts got in the previous menu}'
    </prompt>
  </block>
  </form>

   
</vxml>

how can I get in the "q2" value the subscriber entered in the "q1" except using standart application variable?
MattHenry
7/24/2007 7:16 PM (EDT)


Hi there,


In this case, we would probably want to use a document-scoped variable instead of an application scoped variable, and change our choice handler to kick off an actual event where we can assign this variable document scoped priveleges; I'm not sure if this will fit the bill for you or not, dpending on the constraints that you are working under:

[color=blue]
<?xml version="1.0"?>
<vxml version="2.1" >

<var name="myVar" expr=""/>
 
<catch event="User_1">
<assign name="document.myVar" expr="'one'"/>
<goto next="#q2"/>
</catch>

  <menu id="q1" scope="dialog" dtmf="true">

    ... 
    <choice dtmf="1" event="User_1"/>

    ...
   
  </menu>
 
  <form id="q2">
    <block>
    <prompt timeout="10s">
      The answer is <value expr="document.myVar"/>   
    </prompt>
  </block>
  </form>
</vxml>
[/color]

Let me know if you need additional assistance,

~Matthew henry
Magician
8/2/2007 12:49 PM (EDT)
Is there a method to conditionally present menu choices. I'm looking for something similar to the "cond" attribute of the <field> element that would be used within <choice>.

It seems as though there should be something to compliment the ability of the <menu> element to <enumerate>.

Thanks for any tricks you can show me.

Magician
voxeojeremy
8/3/2007 12:12 AM (EDT)
Magician,


I believe there is a trick for this, however I have no experience with it.  I will consult with some of our senior support staff regarding this workaround.  It might require a little bit of time to track down, but once we have found it, prepare to be amazed!  Kindly stay tuned for updates.


Regards,

Jeremy McCall
Voxeo Extreme Support
MattHenry
8/3/2007 7:21 PM (EDT)


Hi there,

What you are really looking for here is a 'cond' attribute that will allow you to pick and choose what gets played and what doesn't....however, note that the menu/option/enumerate doesn't allow for this at all. However, you *can* emulate this feature by changing the code around a bit. This would involve:


1) A form/field/grammar construct

2) Storing all prompt choices in an ECMAScript array

3) Leveraging the foreach element, and assigning a 'cond' value to the prompt that it encapsulates

Hope this helps,

~Matthew Henry
boberm
2/13/2008 2:15 PM (EST)
Hi all,
I need to build dynamic menu (some of the options should not appear for 'limited' users).
How can I do it in vxml (without server side additional code)?
Is there something like 'cond' for choice element?

Thanks
VoxeoDustin
2/13/2008 4:44 PM (EST)
Hey,

The choice element does not support the cond attribute, and the if element is not a valid child of menu. Without server side, you would likely want to use field in this instance instead of menu. cond is a valid attribute of field and should get you where you want to go without server side.

Thanks,
Dustin
annuvinayak
5/21/2008 1:14 AM (EDT)
Hi,

I am trying to use "#" key as input to exit from the system. I am using it as:

<menu id="menuChoice1">
<prompt>Press hash to return to menu or press star to exit.
</prompt>
<choice dtmf="#" next="#discnct"/>
<choice dtmf="*" next="#hello"/>
</menu>

When I press *, the flow works fine. But on pressing # it says "I did not understand what you said"

Do we have to use some escape sequence type of thing to specify hash in the choice of a menu?
voxeojeremyr
5/21/2008 6:50 AM (EDT)
Hi,

Yes, as a default, the hash key (#), is set as a terminator for input.  That is why when you press just that key the system plays the no input message.  You can change the terminating character by using the <property> tag.  Here is an example:

<property name="termchar" value="">

You can find more information on the <property> element here:
http://docs.voxeo.com/voicexml/2.0/w3cprops.htm#start

Thanks,
Jeremy Richmond
Voxeo Support

yashar
5/29/2008 3:36 PM (EDT)
hi,

Actually I have a problem with <option>, I'm using <option> to submit some values from my vxml to the php page using :

<submit next="myquery.php" method="get" namelist="f2 d1"/>

thats fine...

I want to add a choice such as <option> EXIT </option> that when user says that it goes to the form1.

<option> Good </option>
<option> Bad </option>
<option> EXIT </option>

so i want to submit good or bad if is uttered but i want to move to form1 if "exit" is uttered.

I know I can do it with <menu> and <choice> but I dont know how to submit my values if I use <choice> while easily i could use <option> to submit my values to php page.

anybody could show me a way that I can use any of <choice> or <option> to perform both that i require?

Thank you very much

VoxeoDustin
5/29/2008 5:13 PM (EDT)
Hey Yashar,

You may want to do something like this:

<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1">

<form id="F1">
  <field name="F_1">
    <prompt>
      Say good, bad, or exit.
    </prompt>

    <option value="good" dtmf="1">
        good
    </option>

    <option value="bad" dtmf="2">
        bad
    </option>

    <option value="exit" dtmf="3">
        exit
    </option>

    <filled>
      <if cond="F_1 == 'good'">
          <submit next="good.php"/>
      <elseif cond="F_1 == 'bad'"/>
          <submit next="bad.php"/>
      <else/>
          <goto nextitem="#exit"/>
      </if>
    </filled>
  </field>

  <block name="exit">
      <prompt> O K. Goodbye </prompt>
      <exit/>
  </block>

</form>
</vxml>

Cheers,
Dustin
yashar
5/29/2008 7:17 PM (EDT)
Dear Dustin

Thanks for your help. indeed my point is that :

<filled>
      <if cond="F_1 == 'good'">
        <assign expr = "F_1" name = "F1" />
          <submit next="next.php" method="get" namelist="F1"/>
      <elseif cond="F_1 == 'bad'"/>
          <assign expr = "F_1" name = "F1" />
            <submit next="next.php" method="get" namelist="F1"/>
      <elseif cond="F_1 == 'Exit'"/>
          <goto nextitem="#initial_form"/>
      </if>
    </filled>

it means if the utterance is 'good' or 'bad' it will be submitted to the php page and if is 'Exit' it goes to the initial form. is that correct? Thank you very much.
mikethompson
5/30/2008 1:27 PM (EDT)
Hello,

You are correct, that snippet will submit the utterance 'good' or 'bad' to your back-end PHP script.  However, if you were to say exit, it will revisit the initial_form as specified.  Of course, within the scope of your question, it is not entirely necessary to assign the utterance value to a fresh variable.  You should be able to simply submit F_1 off in your namelist with the utterance value intact.  Regardless, either way will work and it looks like you're on the right track!

Best,
Mike Thompson
Voxeo Corporation
mtatum111
10/8/2008 4:21 PM (EDT)
I am a little confused about the following- by the way  this was in the 2.0 spec - My confusion comes in because under choice element we have a grammar element which is good.  However, why do we have the text Sports, Weather, Stargazer astrophysics under this.  I wouldn't think those were needed if we are going to the external grammar.

Thanks for any info.

<menu>
  <choice next="http://www.sports.example.com/vxml/start.vxml">
    <grammar src="sports.grxml" type="application/srgs+xml"/>
    Sports
  </choice>
  <choice next="http://www.weather.example.com/intro.vxml">
  <grammar src="weather.grxml" type="application/srgs+xml"/>
  Weather
  </choice>
  <choice next="http://www.stargazer.example.com/voice/astronews.vxml">
  <grammar src="astronews.grxml" type="application/srgs+xml"/>
  Stargazer astrophysics
  </choice>
</menu>
</vxml>
VoxeoDustin
10/8/2008 4:47 PM (EDT)
Hey Melissa,

Both do not need to be specified, however it is not incorrect as you can use both with choice, similar to using multiple grammar references within a field construct.

Cheers,
Dustin
bpcamac
11/16/2008 12:58 AM (EST)
Is there a way to use the classic menu/prompt/enumerate/choice design pattern in cases where one of the choices is to be conditionally included? 

e.g.

<menu id="menu">
  <prompt>What would you like for lunch? To choose
    <enumerate>
      <value expr="_prompt"/>, press <value expr="_dtmf"/>
    </enumerate>
  </prompt>

  <choice cond="$includeChoice1" next="#F1" dtmf="1">
          ham and cheese
  </choice>
  <choice next="#F1"  dtmf="2">
          grits
  </choice>
  <choice next="#F1"  dtmf="3">
          ham and shatner
  </choice>
  </menu>


You can see that I've included a non-standard VXML element to the first choice tag: a cond which if evaluated to true would be included in the menu.

Is there some way to achieve this? 

I think the menu/prompt/enumerate/choice design pattern is compact, elegant and safe (i.e. the dtmf value associated with a choice and the value spoken can never be different as they are defined in one place only) plus no user-level programming is required to recognize and validate the input - just use nomatch.

However, as you can see, this design pattern is only good for static structures.  Any thoughts?
voxeoAlexBring
11/16/2008 2:03 AM (EST)
Hello,
  Unfortunately, due to the structure of VoiceXML, it does not allow for a conditional statement around the [code]choice[/code] element. The best way to achieve this would be to use the standard [url=http://docs.voxeo.com/voicexml/2.0/field.htm]field[/url], [url=http://docs.voxeo.com/voicexml/2.0/grammar.htm]grammar[/url], [url=http://docs.voxeo.com/voicexml/2.0/filled.htm]filled[/url], and [url=http://docs.voxeo.com/voicexml/2.0/goto.htm]goto[/url] elements along with the [url=http://docs.voxeo.com/voicexml/2.0/if.htm]if[/url] element from within the filled to determine options. I hope this helps, if you have any other questions please be sure to let us know.

Regards,

Alex
Voxeo Support
sherriman
11/21/2008 5:12 PM (EST)
imightbewrong92 & mikethompson,
Regarding your 3/29/2006 regarding audio to play a beep.  I think that Mike's advice is incomplete.  What I am seeing in the development platform is that including <audio> as a child of <choice> the beep is either ignored.  Or when using enumerate it plays the audio too.  So in the example below you hear "For planes RING_SOUND, please press 1" and so on.

My experience is that choice only includes items relating to a grammar used for matching.  No idea how <audio> is/can be used in a grammar.

<menu id="menu" scope = "dialog" dtmf="true">
  <prompt>
      <enumerate>
      For <value expr="_prompt"/>, please press <value expr="_dtmf"/>
      </enumerate>
  </prompt>
  <choice next="#menu">
    planes
    <audio src="media/one_ring.wav" fetchhint="safe"> ring</audio>
  </choice>
  <choice next="#menu">
    trains
  </choice>
</menu>
voxeoJohn
11/22/2008 7:17 PM (EST)
Hi there,

  It is very strange you you are not seeing the audio play, in my test case (below) this worked just fine.  The data contained in the <choice> element is both grammar and content for the TTS engine.  If you do make use of <audio> tag for your choice you will have to include  nested TTS, which will reco as a valid utterance, if you intend to use ASR to fill the form.

Regards,

John D.
Customer Engineer
Voxeo Support

---
<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1">
<menu id="menu" value="approximate" scope = "dialog" dtmf="true">
  <prompt>
  <enumerate>
    For <value expr="_prompt"/>, please press <value expr="_dtmf"/>
  </enumerate>
  </prompt>
  <choice accept="approximate" next="#F1" dtmf="1">
    <audio src="Im_sorry.wav" fetchhint="safe"> Audio</audio>
  </choice>
  <choice next="#F1" dtmf="2">
    trains
  </choice>
  </menu>
----

---LOGS--
successfully initialized stream from http://k____.com/exam/Im_sorry.wav
Speech recognition result 0: | _interpretationconfidence=0.51 | _marktime=4860 | _confidence=0.51 | vmlslot0=audio | _grammar_id=0 | _inputmode=voice | _utterance=audio


Vijeth
1/12/2009 7:06 AM (EST)
hi,

I have used <submit> for hitting a particular form of a vxml file by using <submit next="/CaMTN/main.vxml#second"/>. Now i want to know how can i perform the same using choice tag. if it's possible, please let me know how i can.
voxeoJeffK
1/12/2009 7:20 AM (EST)
Hi,

Yes, you can accomplish this by using the "next" attribute of <choice>. Here's an example:

<menu id="M_1">
  <prompt> say My Form to go to the next destination. </prompt>
  <choice next="nextpage.xml#myForm" fetchaudio="MySoundFile.wav">
    My form
  </choice>
</menu>

Regards,
Jeff K.
Voxeo Support
Vijeth
1/12/2009 8:06 AM (EST)
Thank you Jeff. I used the choice as you mentioned, its working.

punkin
6/18/2009 12:29 AM (EDT)
  <choice next="#project1">
    project 1
  </choice>
  <choice next="#project2">
      project 2
  </choice>
  <choice next="#project3">
      project 3
  </choice>

TTS will speak the last option as pro-ject or pro-jack.  It only happens to the last option.  How to fix?
voxeoJeffK
6/18/2009 6:45 AM (EDT)
Hello,

Don't forget that you can use alternate spelling techniques to help customize certain pronunciations. This sounded better to my ears:

  <choice next="#project1">
    prah-ject 1
  </choice>
  <choice next="#project2">
      prah-ject 2
  </choice>
  <choice next="#project3">
      prah-ject 3
  </choice>

Regards,
Jeff Kustermann
Voxeo Support
JamesJiang
12/1/2009 7:21 PM (EST)
Is there a way that I can do the following logic? The booking number could be 10 digital number. not just a dtmf key.  Thanks so much for any helps. thanks.

<menu id="menu">
  <prompt>
  Please enter your booking number followed by the hash key or say your full name now
  </prompt>
  <choice next="#P1">
//if booking number entered 
  </choice>

  <choice next="#form_Main">
//if full name told, need a grammar here?       
  </choice>
  </menu>

<form id="P1">
  <block>
  //get the booking number and goto next
</block>
</form>
<form id="form_Main">
<block>
  //get the full name  and goto next 
  </block>
</form>
voxeojeremyr
12/1/2009 7:35 PM (EST)
Hello James,

Yes this is possible, however I see a couple of concerns.  For one, I would not use a <menu> item in this case.  Instead I would use a <field> that would have multiple grammars active, one being a DTMF grammar to accept the booking number and the other being the name grammar.  This leads us to the second issue.

The second concern I see is the successful recognition of the name.  As you may be aware, recognition depends on a grammar being defined so that it can determine what the caller will say.  Now if you need to recognize all possible names, the building of this grammar would be a very large undertaking.  Not that it can't be done, in fact we do offer a service through a third party provider called Targus that has a name grammar already created.  For more information on Targus you can take a look at this link:
https://evolution.voxeo.com/services_pro/targus/home.jsp

For more information on this type of dialog which is called a Mixed Initiative, you can view our tutorial here:
http://www.vxml.org/t_20.htm

If you have any questions or need clarification, please do not hesitate to let us know.

Regards,
Jeremy Richmond
Voxeo Support

JamesJiang
12/2/2009 8:12 PM (EST)
Hi, Jeremy
Thanks so much for your reply. I made this vxml to test it out, but still no luck, what I need is to catch either a booking number entered or a full name heard. (filled, mode='any' ?). When I tried to enter booking number on the key pad, it always said "I did not understand what you said, please try again".

any ideas. thanks in advance.

<form id="form">

<grammar type="text/gsl">  [yes] </grammar>
<initial name="init_get_celeb">
      <prompt>
        Please enter your booking number followed by the hash key or say your full name now
      </prompt>
</initial>
  <field name="KeyBookingNumber"  type="digits?length=3"> 
    <prompt>
    Please enter your booking number followed by the hash key
    </prompt>
  </field>
 
  <field name="FullName">
  <grammar type="text/gsl">  [yes] </grammar>
  <prompt>
    or say your full name now
    </prompt>
  </field>   
   
    <filled  mode="any">
  <prompt>
      right,  thanks.
      <break time="1000ms" />
    Goodbye
    </prompt>
  </filled>
 
</form>
VoxeoTony
12/2/2009 10:14 PM (EST)
Hello James,

It seems as if you started on the path to Mixed Initiative Dialogs.  However, as pointed out in the tutorial on this [link=http://www.vxml.org/t_20.htm]link[/link]:

Because our form scoped grammar is doing all of the work

In your example I see that you have a grammar at the form level, but you are still asking it to react to the built-in grammar.  Unfortunately, the browser is not listening for this built-in grammar. 

If you were to take another look at the example, you may see that the grammar in question is all inclusive and then reacting to give the mixed initiative effect.  This way the fields do not need filled as what is sent back pertains to the entire form.

I hope that this sheds some light on why you are not getting the results when pressing DTMF during your testing.  The sample grammar in the tutorial should lend itself as a nice guide to creating your own modified grammar to suit your developing needs.

Regards,

Anthony James
Customer Engineer
Voxeo

Ready to go Pro?
sales@voxeo.com

login



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