param

Specifies a value to pass to a subdialog or object element.

<param 
expr = "ECMAScript_Expression"
name = "string"
value = "string"
/>

expr

A JavaScript expression assigned to the value of the parameter.

name

Required. The name of the variable to initialize within the subdialog or object element.

value

A literal string that is assigned to name (if expr is not specified).

The value and expr attributes are mutually exclusive.

The following example passes three parameters to a generic confirmation dialog. The first parameter is the path to the recorded prompt. The second parameter is the corresponding TTS prompt. The third parameter indicates whether the default prompt, "Say yes or no," should be played.

<?xml version="1.0"?>
<vxml version="2.1"
 xmlns="http://www.w3.org/2001/vxml">

   <var name="confirm_wav" expr="'cancelorder.wav'"/>
   <var name="confirm_tts" expr="'Are you sure you want to cancel this order?'"/>

   <form id="main">
   <subdialog name="oResult" src="#generic_confirm">
      <param name="wav" expr="confirm_wav"/>
      <param name="tts" expr="confirm_tts"/>
      <param name="play_yesno" value="true"/>
      <filled>
      <if cond="oResult.confirmed">
         canceling order
      <else/>
         keeping order
      </if>
      </filled>
   </subdialog>
   </form>

   <!-- generic confirmation dialog -->
   <form id="generic_confirm">
      <var name="wav"/> <!-- custom recorded prompt -->
      <var name="tts"/>  <!-- custom tts prompt -->
      <var name="play_yesno"/> <!-- play the standard prompt -->
      
      <field type="boolean" name="yesno">
         <prompt>
            <audio expr="wav"><value expr="tts"/></audio>
            <if cond="play_yesno">
               Say yes or no
            </if>
         </prompt>

         <catch event="noinput nomatch">
            Sorry. I didn't get that. Please say yes or no.
         </catch>

         <filled>
            <var name="confirmed"/>
            <if cond="yesno">
               <assign name="confirmed" expr="true"/>
            <else/>
                <assign name="confirmed" expr="false"/>          
            </if>
            <return namelist="confirmed"/>
         </filled>

      </field>
   </form>
</vxml>

Community Additions

ADD
Show: