| VoiceXML 2.1 Development Guide | Home | Frameset Home |
| 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: prefetch |
Fetchhint is used to specify when the resource should be fetched during application execution. The possible values and their descriptions are:
Note that the Voxeo platform will always prefetch content, regardless of what this attribute value is set to. As such, specifying a value is somewhat redundant. | ||
| 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. | ||
| messageexpr | Data Type: CDATA | Default: Optional |
| The messageexpr attribute allows the developer to include an ECMAScript expression resolving to the message being thrown to the application. The messageexpr 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. | ||
| <?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> |
| <?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> |
| <?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> |
| <?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> |
| <?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> |
| ANNOTATIONS: EXISTING POSTS |
imightbewrong92
|
|
| 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
|
|
| 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
|
|
| 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
|
|
|
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
|
|
| 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
|
|
|
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
|
|
| 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
|
|
| 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
|
|
|
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
|
|
| 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
|
|
| 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
|
|
| 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
|
|
| 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
|
|
| 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
|
|
| 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
|
|
| 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
|
|
| 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 |
| login |