developer_guide:voicexml_references:elements:goto

< goto >

The < goto > attribute transitions to another item in the current form, another dialog in the same document, or to a different document. Transitioning to another dialog in the current document or to a different document will cause the old dialog’s variables to be lost. Document variables are retained when transitioning to the same document with an empty URI reference.

<goto
next="URI"
expr="ECMAScript_Expression"
nextitem="String"
expritem="ECMAScript_Expression"
fetchaudio="URI"
fetchhint="prefetch" | "safe"
fetchtimeout="time_interval"
maxage="time_interval"
maxstale="time_interval"/>
nextThe next attribute is the URI in which to transition to. This attribute is required, and one of next, expr, nextitem, expritem is also required.
exprThe expr attribute is an ECMAScript Expression that yields the URI. This attribute is required, and one of next, expr, nextitem, expritem is also required.
nextitemThe nextitem attribute is the name of the next form item to visit in the current form. This attribute is required, and one of next, expr, nextitem, expritem is also required.
expritemThe expritem attribute is the ECMAScript Expression that yields the name of the next form item to visit. This attribute is required, and one of next, expr, nextitem, expritem is also required.
fetchaudioThe fetchaudio attribute is the URI of audio to play while waiting for the next document to be fetched.
fetchtimeoutThe fetchtimeout attribute is the time interval to wait for an audio file to be fetched before playing the alternate content. This attribute is optional.
fetchhintThe fetchhint attribute defines when the audio file should be retrieved. This attribute is optional.
* prefetch – the audio file may be downloaded when the page is loaded.
* safe – only loads the audio file when needed.
maxageThe maxage attribute indicates the maximum time in seconds that this document will use this file before fetching another copy. This attribute is optional.
maxstaleThe maxstale attribute indicates the maximum time in seconds that this document will use the file that exceeded the maxage time. This attribute is optional.
<block>, <catch>, <error>, <filled>, <help>, <if>, <noinput>, <nomatch>
None.
None.
None.
<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
 <form id="maindish">
  <field name="done" type="boolean">
   <prompt> Are you done here ? </prompt>
   <filled>
    <if cond="done== 'FALSE'">
     <goto nextitem="notdone" />
    </if>
   </filled>
  </field>
  <field name="whatnext">
   <prompt>
    Would like any desserts or you want me to bring your bill?
   </prompt>
   <grammar type="text/x-grammar-choice-dtmf">
    1 {bill} |
    2 {desserts}
   </grammar>
   <filled>
    <if cond="whatnext=='bill'">
     <goto nextitem="bill" />
    <elseif cond="whatnext=='desserts'" />
     <goto next="#desserts" />
    </if>
   </filled>
  </field>
  <block name="bill">
   Please wait. I am getting your bill for you.
   <disconnect/>
  </block>
  <block name="notdone">
   Oh, I am sorry. Enjoy.
   <disconnect/>
  </block>
 </form>
<form id="desserts">
  <field name="choice">
   <prompt>
<form id="desserts">
  <field name="choice">
   <prompt>
    What would you like for your desserts?
   </prompt>
  </field>
</form>
</vxml>
  • developer_guide/voicexml_references/elements/goto.txt
  • Last modified: 2015/10/27 12:38
  • by borja