CallXML 2.0 Development Guide Home  |  Frameset Home

This documentation is for CallXML 2, which has been superceded by CallXML 3. The CallXML 2 language is not being updated any longer. CallXML 3, however, has many new features and is actively being enhanced. If you're writing a new CallXML application, you should use CallXML 3. Click here for the CallXML 3.0 documentation.

<menu>  element


Menu is an element that combines the attributes and functionality of a <block> element with a <playAudio> element.

The intent of this element is to foster easy implementation of menus, where one key press will move the caller through an application. In the listed examples, the audio file will be played three times before "timing out" and moving on in the CallXML code. Compare the example below with the playAudio example in the element table in order to get a better understanding of this element..

Only event handler tags for the possible events listed below can exist inside this tag. Any other tags found will result in an error.


usage

<menu cache="(yes|no)" cleardigits="(true|false)" format="string - URI" label="(navigation identifier)" maxtime="(m|s|ms)" next="(navigation identifier)" repeat="(numeric value)" termdigits="(123456789*#|ABCD)" text="STRING" value="string - URI">


attributes

cache Data Type: (yes|no) Default: none - attribute is optional
Allows manual override over the caching mechanism. If this attribute is empty the default system caching is used. "yes" should force the system to use the cache all the time, "no" means that no cache should be used at all.
cleardigits Data Type: (true|false) Default: false
This attribute's value is a Boolean, indicating whether the queued digits buffer should be cleared when this action starts. "true" clears the digits buffer; "false" leaves the contents of the digit buffer alone.
format Data Type: string - URI Default: none - attribute is optional
The 'format' attribute defines the string  formatting to use for the element.  If the value is undefined, the audio file format should be determined from the file name extension, if possible, and, if necessary, override the default format.
label Data Type: (navigation identifier) Default: none - attribute is optional
This attribute designates the unique inter-document identifier of the parent element in question, and allows an easy way to navigate through applications as a destination 'anchor', as used in goto references
maxtime Data Type: (m|s|ms) Default: 30s
The maxtime attribute indicates the maximum time that the CallXML browser should wait for digits before executing any repeat instances, if present.
next Data Type: (navigation identifier) Default: none - attribute is optional
The 'next' attribute sets the URL the CallXML platform will go to when the container ends.
repeat Data Type: (numeric value) Default: 1
The value for the repeat attribute indicates the number of times to execute the content contained by the parent element. If this attribute is explicitly specified, this must be a valid number, or an error will result.  Also note that if the value is zero the content will be skipped.
termdigits Data Type: (123456789*#|ABCD) Default: none - attribute is optional
This attribute holds the list of touch-tone digits which can terminate the current caller action. Note that for each termdigit specified, there should be an <ontermdigit> handler in the code to catch the event. Allowable values are any one of "012356789*#", the ordinary DTMF (Touch-Tone) keypad possibilities, plus the special keypad tones found on some telephones "ABCD".
text Data Type: STRING Default: none - attribute is optional
The 'text' attribute allows the developer to specify backup TTS to be output in the event that the .wav file cannot be found.
value Data Type: string - URI Default: none - attribute is required
The 'value' attribute defines the audio file to play to the caller when the parent element is first entered.



possible events

onerror type="document" Document was unable to be fetched for all the reasons web servers are unavailable
onerror type="linenotactive" Trying to issue a telephony event such as <getdigits> or <playaudio> on a non-active line
onerror type="telephony" Unable to issue a telephony event such as <call> or <playaudio> or <ftp>
onhangup This event occurs when a session determines that one side of the call has hung up. A typical use for this handler is to execute any necessary clean-up code. See the onhangup element description for further details.
ontermdigit Used for catching and handling term digit events as they occur in the call flow. See the ontermdigit element description for further details.



code samples

<Menu - label - value - termdigits>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="2.0">
  <block label="B1">
    <text>
      Lets navigate to a menu, shall we?
    </text>
    <goto value="#M_1"/>
  </block>

  <menu label="M_1" value="EnterSomething.wav" termdigits="1">


  <ontermdigit value="1">
    <text>
      You must have pressed DTMF 1 to get here.
    </text>
  </ontermdigit>
</menu>

</callxml>



<Menu - repeat - cache>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="2.0">
  <block label="B1">
    <text>
      Lets navigate to a menu, shall we?
      Note that if we dont enter any digits, then the wav
      file will repeat 3 times.
    </text>
    <goto value="#M_1"/>
  </block>

  <menu label="M_1" value="EnterSomething.wav" termdigits="1"
      repeat="3" cache="yes"/>



  <ontermdigit value="1">
    <text>
      You must have pressed DTMF 1 to get here.
    </text>
  </ontermdigit>

</callxml>



<Menu - next>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="2.0">

<menu label="menu" value="entersomething.wav" termdigits="123">
    <ontermdigit value="1" next="#key1"/>
    <ontermdigit value="2" next="#key2"/>
    <ontermdigit value="3" next="#key3"/>
</menu>

  <block label="key1">
  <text> you pressed 1 </text>
  <exit/>
  </block>

  <block label="key2">
  <text> you pressed 2 </text>
  <exit/>
  </block>

  <block label="key2">
  <text> you pressed 3 </text>
  <exit/>
  </block>

</callxml>



additional links

none


  ANNOTATIONS: EXISTING POSTS
MattHenry
4/30/2004 6:08 PM (EDT)
-- 4/30/04 --

A recent platform bug has been discovered related to the 'maxtime' attribute of this element. If not specified, the default value is getting lost in the mix, and will throw the following error:

event: error "document" (Error on line XX: invalid time value)

As such, it is advised that you explicitly define this value in your code as a workaround until this behavior is rectified at the platform level.

~Matt Henry
Voxeo Corporation

login



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