<throw>

Description

Throws a pre-defined event or application-specific event.

Syntax


<throw
    event="event"
    eventexpr="ECMAScript_Expression"
    message="string"
    messageexpr="ECMAScript_Expression"/>

Attributes

Attribute

Description

event

The name of the event to be thrown. Exactly one of event or eventexpr must be specified.

eventexpr

An ECMAScript expression to be evaluated and used as the name of the event to be thrown. Exactly one of event or eventexpr must be specified.

message

A message string providing additional context about the event being thrown. For the pre-defined events thrown by the platform, the value of the message is platform-dependent. The message will be available as a variable within the scope of the <catch> element. Optional. (Only one of message or messageexpr can be specified.)

messageexpr

An ECMAScript expression to be evaluated and used as a message string, as documented under message, above. Optional. (Only one of message or messageexpr can be specified.)

Attribute Notes

Parents

<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>

Children

None.

Extensions

None.

Limitations/Restrictions

Example


<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
  <catch event="goodbye">
    Thank you for calling. Goodbye.
    <exit/>
  </catch>
  <form>
    <field name="field1" type="boolean">
      <dtmf> * </dtmf>
      <prompt>Please press the star.</prompt>
      <filled>
        <if cond="field1 == '*'">
          <throw event="goodbye"/>
        </if>
      </filled>
    </field>
  </form>
</vxml>