# <menu>

Description

A menu is a shorthand for a form containing a single anonymous field that prompts the user to make a choice and transitions to different places based on that choice. Menus can rely purely on speech, purely on DTMF, or both in combination.

Syntax

    <menu
        id="string"
        scope="dialog" | "document"
        accept="exact" | "approximate"
        dtmf="boolean"
        wakeupword="boolean">
      child elements
    </menu>

Attributes

Attribute | Description
id | The name of this menu. If specified, it can be referenced within the same document or from another document. For example, `<menu id="hello">` can be referenced by `<goto next="#hello"/>`. Optional.
scope | The scope of the menu's grammars. Optional. (Defaults to dialog.) dialog - The menu's grammars are only active within the menu. document - The menu's grammars are active throughout the document. If the current page is an application root document, then the menu grammars are active throughout the application.
dtmf | Enables DTMF input for all menu choices. See Limitation, below. Optional. (Defaults to true.) true - The interpreter assigns DTMF sequence "1", "2", "3"... to the first nine choices in document order for menu choices that do not explicitly define a DTMF sequence. false - The interpreter does not implicitly assign DTMF sequences.
accept | Specifies how to generate the default grammar for each `<choice>` element. Optional. (Defaults to exact.) exact - The text contained in the `<choice>` element defines the exact phrase to be recognized. approximate - The text contained in the `<choice>` element defines an approximate recognition phrase. A subset of the words in the phrase expression can be matched. For example, "hello world" can be matched with "hello world", "hello", or "world".
wakeupword | Specifies whether or not Wakeup Word Spotting should be used for input in this menu. Overrides the value of the `com.voicegenie.wakeupword` property. (Only supported with SpeechWorks OSR.) Optional. (Defaults to false.)

Parents

<vxml>

Children

<audio>, <catch>, <choice>, <data>, <enumerate>, <error>, <help>, <noinput>, <nomatch>, <prompt>, <property>, <value>, #PCDATA

Extensions

- Added `wakeupword` attribute.

Limitations/Restrictions

- Currently, the default value for the `dtmf` attribute is "true", and the interpreter-assigned dtmf inputs take precedence over any dtmf inputs defined by grammars in the `<choice>`s.

Example

    <?xml version="1.0"?>
    <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
      <menu>
        <prompt> What do you want to drink, coffee or tea? </prompt>
        <choice next="#getcoffee"> coffee </choice>
        <choice next="#gettea"> tea </choice>
      </menu>
      <form id="getcoffee">
        <block>
          Ok, here's your coffee.
        </block>
      </form>
      <form id="gettea">
        <block>
          Ok, here's your tea.
        </block>
      </form>
    </vxml>