PowerMedia XMS VoiceXML Reference Guide

PowerMedia XMS VoiceXML Reference Guide
Dialogic® PowerMedia™ XMS VoiceXML
Reference Guide
February 2013
05-2710-001
www.dialogic.com
Copyright and Legal Notice
Copyright © 2012-2013 Dialogic Inc. All Rights Reserved. You may not reproduce this document in whole or in part
without permission in writing from Dialogic Inc. at the address provided below.
All contents of this document are furnished for informational use only and are subject to change without notice and
do not represent a commitment on the part of Dialogic Inc. and its affiliates or subsidiaries ("Dialogic"). Reasonable
effort is made to ensure the accuracy of the information contained in the document. However, Dialogic does not
warrant the accuracy of this information and cannot accept responsibility for errors, inaccuracies or omissions that
may be contained in this document.
INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH DIALOGIC® PRODUCTS. NO LICENSE,
EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY
THIS DOCUMENT. EXCEPT AS PROVIDED IN A SIGNED AGREEMENT BETWEEN YOU AND DIALOGIC, DIALOGIC
ASSUMES NO LIABILITY WHATSOEVER, AND DIALOGIC DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY,
RELATING TO SALE AND/OR USE OF DIALOGIC PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO
FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY INTELLECTUAL PROPERTY
RIGHT OF A THIRD PARTY.
Dialogic products are not intended for use in certain safety-affecting situations. Please see
http://www.dialogic.com/company/terms-of-use.aspx for more details.
Due to differing national regulations and approval requirements, certain Dialogic products may be suitable for use
only in specific countries, and thus may not function properly in other countries. You are responsible for ensuring
that your use of such products occurs only in the countries where such use is suitable. For information on specific
products, contact Dialogic Inc. at the address indicated below or on the web at www.dialogic.com.
It is possible that the use or implementation of any one of the concepts, applications, or ideas described in this
document, in marketing collateral produced by or on web pages maintained by Dialogic may infringe one or more
patents or other intellectual property rights owned by third parties. Dialogic does not provide any intellectual
property licenses with the sale of Dialogic products other than a license to use such product in accordance with
intellectual property owned or validly licensed by Dialogic and no such licenses are provided except pursuant to a
signed agreement with Dialogic. More detailed information about such intellectual property is available from
Dialogic's legal department at 6700 de la Cote-de-Liesse Road, Suite 100, Borough of Saint-Laurent, Montreal,
Quebec, Canada H4T 2B5. Dialogic encourages all users of its products to procure all necessary
intellectual property licenses required to implement any concepts or applications and does not condone
or encourage any intellectual property infringement and disclaims any responsibility related thereto.
These intellectual property licenses may differ from country to country and it is the responsibilit y of
those who develop the concepts or applications to be aware of and comply with different national
license requirements.
Dialogic, Dialogic Pro, Dialogic Blue, Veraz, Brooktrout, Diva, BorderNet, PowerMedia, ControlSwitch, I-Gate, Mobile
Experience Matters, Network Fuel, Video is the New Voice, Making Innovation Thrive, Diastar, Cantata, TruFax,
SwitchKit, Eiconcard, NMS Communications, SIPcontrol, Exnet, EXS, Vision, inCloud9, NaturalAccess and Shiva,
among others as well as related logos, are either registered trademarks or trademarks of Dialogic Inc. and its
affiliates or subsidiaries. Dialogic's trademarks may be used publicly only with permission from Dialogic. Such
permission may only be granted by Dialogic's legal department at 6700 de la Cote-de-Liesse Road, Suite 100,
Borough of Saint-Laurent, Montreal, Quebec, Canada H4T 2B5. Any authorized use of Dialogic's trademarks will be
subject to full respect of the trademark guidelines published by Dialogic from time to time and any use of Dialogic's
trademarks requires proper acknowledgement.
The names of actual companies and products mentioned herein are the trademarks of their respective owners.
This document discusses one or more open source products, systems and/or releases. Dialogic is not responsible
for your decision to use open source in connection with Dialogic products (including without limitation those
referred to herein), nor is Dialogic responsible for any present or future effects such usage might have, including
without limitation effects on your products, your business, or your intellectual property rights.
Table of Contents
1.
Welcome ........................................................................................................ 6
2.
Alphabetical VoiceXML Reference .................................................................. 7
<assign> ............................................................................................................... 7
<audio>................................................................................................................. 8
<block> ............................................................................................................... 13
<break> .............................................................................................................. 14
<catch> ............................................................................................................... 16
<choice> ............................................................................................................. 18
<clear> ............................................................................................................... 21
<content> ............................................................................................................ 22
<data> ................................................................................................................ 23
<desc> ................................................................................................................ 26
<disconnect> ....................................................................................................... 27
<else>................................................................................................................. 28
<elseif> ............................................................................................................... 28
<emphasis> ......................................................................................................... 29
<enumerate> ....................................................................................................... 30
<error> ............................................................................................................... 31
<example> .......................................................................................................... 32
<exit> ................................................................................................................. 33
<field> ................................................................................................................ 34
<filled>................................................................................................................ 38
<foreach> ............................................................................................................ 40
<form>................................................................................................................ 41
<font>................................................................................................................. 43
<goto> ................................................................................................................ 44
<grammar> ......................................................................................................... 47
<help> ................................................................................................................ 51
<if> .................................................................................................................... 53
<initial>............................................................................................................... 54
<item> ................................................................................................................ 56
<lexicon> ............................................................................................................ 57
<link> ................................................................................................................. 58
<log> .................................................................................................................. 62
<mark> ............................................................................................................... 63
<media>.............................................................................................................. 64
<menu> .............................................................................................................. 68
<meta> ............................................................................................................... 70
<metadata> ......................................................................................................... 71
<noinput>............................................................................................................ 72
<nomatch> .......................................................................................................... 74
<object>.............................................................................................................. 75
<one-of> ............................................................................................................. 77
<option> ............................................................................................................. 78
<overlay> ............................................................................................................ 79
<overlaydescription>............................................................................................. 82
<overlaytemplate>................................................................................................ 83
<p> .................................................................................................................... 83
<par>.................................................................................................................. 84
3
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
<param> ............................................................................................................. 86
<phoneme> ......................................................................................................... 87
<prompt> ............................................................................................................ 88
<property> .......................................................................................................... 90
<prosody> ........................................................................................................... 92
<record> ............................................................................................................. 95
<reprompt> ......................................................................................................... 98
<return>.............................................................................................................. 99
<rule> ............................................................................................................... 100
<ruleref> ........................................................................................................... 101
<s> ................................................................................................................... 102
<say-as> ........................................................................................................... 103
<scroll> ............................................................................................................. 104
<script>............................................................................................................. 105
<speak> ............................................................................................................ 107
<sub> ............................................................................................................... 109
<subdialog> ....................................................................................................... 109
<submit> ........................................................................................................... 112
<tag> ................................................................................................................ 115
<throw> ............................................................................................................ 116
<token> ............................................................................................................ 117
<transfer> ......................................................................................................... 118
<value> ............................................................................................................. 123
<var> ................................................................................................................ 123
<voice> ............................................................................................................. 124
<vxml> ............................................................................................................. 125
3.
Application Reference ................................................................................ 128
Application Properties .......................................................................................... 128
Usage ............................................................................................................. 128
Supported Properties ........................................................................................ 128
SSML Support ..................................................................................................... 134
Session Variables ................................................................................................ 135
Usage ............................................................................................................. 135
Connection Protocol Subobjects .......................................................................... 136
Application Variables ............................................................................................ 137
4
Revision History
Revision
Release Date
Notes
05-2710-001
February 2013
Updated to support PowerMedia XMS Release 2.0.
05-2710-00101
October 2012
Initial release of this document.
Last modified: February 2013
Refer to www.dialogic.com for product updates and for information about support policies,
warranty information, and service offerings.
5
1.
Welcome
This Reference Guide provides a Voice Extensible Markup Language (also referred to herein
as "VoiceXML" or "VXML") dictionary for users of the Dialogic® PowerMedia™ Extended
Media Server (also referred to herein as "PowerMedia XMS" or "XMS"). It contains an
alphabetical reference of supported VoiceXML elements and provides information about
application properties, SSML support, session variables, and application variables.
For installation and configuration instructions, refer to the Dialogic® PowerMedia™ XMS
Installation and Configuration Guide.
6
2.
Alphabetical VoiceXML Reference
<assign>
Assigns a value to a variable.
Syntax
<assign
expr = "PCDATA"
name = "identifier"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
expr
PCDATA
yes
NA
ECMAScript expression to
evaluate and assign to the
named variable.
name
identifier
yes
NA
Name of the variable. This must
be a legal ECMAScript identifier.
By default, the variable is
resolved within the closest
enclosing scope of the currently
active element. To remove
ambiguity, prefix the variable
name with a scope name.
Details
You must explicitly declare a variable using a <var> element or <var> statement within a
<script> element. Attempting to assign a value to an undeclared variable causes the
VoiceXML Interpreter to return an error.semantic error.
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>
Children
None.
7
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<var name="number"/>
<var name="month" expr="'March'"/>
<form>
<block>
Month is <value expr="month"/>
<assign name="month" expr="'July'"/>
Now month is <value expr="month"/>
<assign name="number" expr="2*5"/>
Number is <value expr="number"/>
</block>
</form>
</vxml>
See Also
<script>, <var>
<audio>
Plays the media file at the specified location.
Syntax
<audio
src = "URI"
expr = "CDATA"
fetchhint = "{prefetch | safe}"
fetchtimeout = "CDATA"
maxage = "CDATA"
maxstale = "CDATA"
offset = "CDATA"
offsetexpr = "CDATA"
type = "CDATA"
/>
8
Alphabetical VoiceXML Reference
Attributes
Attribute
Data Type
Required?
Default
Description
expr
CDATA
no
NA
ECMAScript expression that
evaluates to the URI of the
media file. Programmable
Media Platform proprietary.
Use the v_ovl_def parameter
following the media file to
specify:
fetchhint
fetchtimeout
{prefetch |
safe}
CDATA
no
no
NA
NA

a URI (in http:// or
file:/// format) to an
XML file that defines a
text overlay or image
overlay.

an XML string that
defines a text overlay
or image overlay inline.
Specifies when the VoiceXML
Interpreter context should
retrieve content from the
server. Valid values:

prefetch = Fetch the
resource when the
page is loaded.

safe = Fetch the
resource when it is
specifically called by
the application.
Interval to wait for the
content to be returned before
throwing an error.badfetch
event. Use s for seconds (for
example, 1s) and ms for
milliseconds (for example,
1ms).
9
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
maxage
CDATA
no
NA
Maximum acceptable age, in
seconds, of a resource being
fetched from the cache.
Setting maxage to 0 means
that a cached version is never
considered fresh. If no
maxage or maxstale values
are set, the VoiceXML
Interpreter:

Uses the cached resource,
if the resource remains in
the cache.

Performs a normal fetch,
if the resource is not in
the cache.
maxstale
CDATA
no
NA
Maximum acceptable
staleness, in seconds, of the
resource being fetched, if the
fetched resource is cached
and expired.
offset
CDATA
no
NA
Programmable Media Platform
proprietary. The offset (in s or
ms) at which to play the
media file. This attribute is
supported for:

HTTP or local files that
reference a 3GP file

HTTP or local audioonly files

Audio-only files
streamed by an RTSP
server

Video files streamed by
an RTSP server
The behavior of the offset
attribute for HTTP or local files
that reference a 3GP video file
differs, depending on the
presence of a sync point table
and a matching I-frame. For
information, see Details.
Note: The offset attribute is
not supported for live RTSP
presentations.
10
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
offsetexpr
CDATA
no
NA
An ECMAScript expression
that evaluates to the offset.
This can be used in
conjunction with the
lastresult$.bargeintime
variable to let the application
play a media file from the
point at which the user barged
in, and not have to restart the
media file. This is especially
useful for long media files.
src
URI
no
NA
URI of the media file. Use the
v_ovl_def parameter following
the media file to specify:
type
CDATA
no
NA

a URI (in http:// or
file:/// format) to an
XML file that defines a
text overlay or image
overlay.

an XML string that
defines a text overlay
or image overlay inline.
Preferred media type of the
requested resource. This can
differ from the actual media
type of the resource. The
VoiceXML Interpreter currently
ignores this attribute,
determining the media type
during HTTP content
negotiation or content
introspection.
Details
The <audio> element can contain child content (alternate content) that is played if the
media file specified by the src or expr attributes is either not found or cannot be played. The
<audio> element can reference an HTTP, file, builtin, or RTSP URI in its src attribute. For
example:

http://video.example.com/intro.3gp

file://c:/audio/beep.wav

builtin:audio/nomatch

rtsp://stream.example.com:554/live.sdp
11
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Valid source file types are:

3GP (.3gp)

Raw/headerless (.raw)

RIFF (.wav)

Sphere (.wav)

Sun audio (.au)
The offset attribute works as follows for HTTP or local files that reference 3GP video files:
If the Referenced 3GP
Video File...
And...
Then the VoiceXML
Interpreter...
Contains a sync point
table.
There is an I-frame that
corresponds to the specified
offset.
Plays the file from that Iframe.
The specified offset does
not match an I-frame.
Plays the file from the next
I-frame after the specified
offset.
There is no next I-frame.
Does not play the file.
NA
Ignores the offset attribute
and plays the file from the
beginning.
Does not contain a sync
point table.
Parents
<audio>, <block>, <catch>, <choice>, <enumerate>, <error>, <field>, <filled>,
<foreach>, <help>, <if>, <initial>, <media>, <menu>, <noinput>, <nomatch>,
<object>, <prompt>, <record>, <subdialog>, <transfer>
Children
<audio>, <break>, <desc>, <emphasis>, <enumerate>, <mark>, <media>, <p>,
<phoneme>, <prompt>, <prosody>, <s>, <say-as>, <sub>, <value>, <voice>
Examples
The following example plays a .wav file:
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<prompt>
<audio src="../audio/test.wav" maxage="0"/>
</prompt>
<prompt>
<audio src="http://www.webserver.com/doesNotExist.wav"
fetchtimeout="1s">
Audio does not exist
</audio>
</prompt>
</block>
</form>
</vxml>
12
Alphabetical VoiceXML Reference
The following example plays a .3gp file:
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<prompt>
<audio src="../video/test.3gp" maxage="0"/>
</prompt>
<prompt>
<audio src="http://www.vision.com/doesNotExist.3gp"
fetchtimeout="1s">
</audio>
</prompt>
</block>
</form>
</vxml>
The following example plays an RTSP video stream using an offset.
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<property name="inputmodes" value="dtmf"/>
<var name="nAbsOffsetMS" expr="0"/>
<form>
<field name="VCRControl" type="digits?length=1">
<prompt>
<audio src="rtsp://www.example.org:554/3gp/myfile.3gp"
offsetexpr="nAbsOffsetMS + 'ms'"/>
</prompt>
<filled>
<script>
// Determine the new offset based in the input
var nRelOffsetMS = 0;
nRelOffsetMS = (0 == VCRControl) ? -10000 : 10000;
nAbsOffsetMS = nAbsOffsetMS + lastresult$.bargeintime + nRelOffsetMS;
if (nAbsOffsetMS &lt; 0) nAbsOffsetMS = 0;
</script>
<clear/>
</filled>
</field>
</form>
</vxml>
See Also
<prompt>
<block>
A form item specifying a sequence of items to execute (executable content).
Syntax
<block
cond = "CDATA"
expr = "CDATA"
name = "identifier"
/>
13
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attributes
Attribute
Data Type
Required?
Default
Description
cond
CDATA
no
ECMAScript
undefined
Boolean expression that must
evaluate to ECMAScript true
for the block to execute.
expr
CDATA
no
NA
Initial value of the named
form item variable. If
initialized to a value, then the
form item is not visited unless
the form item variable is
cleared.
name
identifier
no
NA
Name of the form item
variable. This must be a legal
ECMAScript identifier.
Details
The contained items are executed if:

form item variable of the block is undefined, and

cond attribute, if specified, evaluates to true
The form item variable is automatically set to true just before the block is entered.
Parents
<form>
Children
<assign>, <audio>, <clear>, <data>, <disconnect>, <enumerate>, <exit>, <foreach>,
<goto>, <if>, <log>, <prompt>, <return>, <script>, <submit>, <throw>, <value>,
<var>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<var name="bCond" expr="false"/>
<form id="form1">
<block name="block1" cond="bCond">
<prompt>Currently in block one</prompt>
</block>
<block name="block2">
<prompt>Now in block two</prompt>
</block>
</form>
</vxml>
See Also
<form>
<break>
Inserts a pause or prosodic boundary between words.
14
Alphabetical VoiceXML Reference
Syntax
<break
strength = "{x-weak | weak | medium | strong | x-strong | none}"
time = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
strength
identifier
no
medium
Strength of the prosodic break in
the speech output. Valid values:
time
CDATA
no
NA

medium

none

strong

x-strong

x-weak

weak
Duration to pause. Specify s for
seconds and ms for milliseconds.
Details
If a <break> element is not used with strength or time attributes, the VoiceXML Interpreter
produces a break with a prosodic strength greater than that which the processor would
otherwise have used if no break element was supplied.
Parents
<audio>, <choice>, <emphasis>, <enumerate>, <option>, <p>, <prompt>, <prosody>,
<s>, <voice>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<prompt>
This is a default medium pause:
<break/>
This is a ten millisecond pause:
<break time="10ms"/>
This is an extra-strong break:
<break strength="x-strong"/>
</prompt>
</block>
</form>
</vxml>
15
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
See Also
<audio>, <prompt>
<catch>
Defines an event handler to catch events raised by the application.
Syntax
<catch
event = "identifiers"
cond= "CDATA"
count = "integer"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
event
identifiers
yes
NA
Event to handle. Multiple
events can be caught in a
single catch statement using a
space-separated namelist.
cond
CDATA
no
NA
Boolean expression that must
evaluate to ECMAScript true for
the catch to execute.
count
integer
yes
NA
Numerical occurrence of the
caught event, such as 2 for the
second occurrence. This allows
you to handle different
occurrences of the caught
event in different ways.
Details
A catch contains executable content to run when a specific event is raised. Use the following
shorthand elements catch common events:
Element
Equivalent <catch> Syntax
<error>
<catch event="error">
<help>
<catch event="help">
<noinput>
<catch event="noinput">
<nomatch>
<catch event="nomatch">
16
Alphabetical VoiceXML Reference
The <catch> element includes two variables in anonymous scope:

_event contains the name of the event that was raised.

_message contains the message accompanying the raised event.
Parents
<field>, <form>, <initial>, <menu>, <object>, <record>, <subdialog>, <transfer>,
<vxml>
Children
<assign>, <audio>, <clear>, <data>, <disconnect>, <enumerate>, <exit>, <foreach>,
<goto>, <if>, <log>, <prompt>, <reprompt>, <return>, <script>, <submit>, <throw>,
<value>, <var>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<catch event="terminate">
Caught terminate
<goto next="#formExit"/>
</catch>
<error>
Caught error
<!-- Log the exact error that was caught: -->
<log label="WARN">
The exact error was: <value expr="_event"/>
</log>
<goto next="#formExit"/>
</error>
<var name="bCondition" expr="false"/>
<form id="formEntry">
<!-- A handler for two kinds of event: -->
<catch event="event.foo event.bar">
Form scope event handler
<log label="INFO">
The event thrown was: <value expr="_event"/>.
The message is: <value expr="_message"/>.
</log>
Throwing terminate
<throw event="terminate"/>
</catch>
<catch event="terminate" cond="bCondition">
This handler will not be executed due to the condition
</catch>
<block>
Throwing custom event
<throw event="event.foo" message="Thrown from formEntry"/>
</block>
</form>
<form id="formExit">
<block>
Goodbye
<exit/>
</block>
</form>
</vxml>
See Also
<help>, <error>, <nomatch>, <noinput>
17
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
<choice>
Defines a choice item in a menu.
Syntax
<choice
accept = "{exact|approximate}"
dtmf = "CDATA"
event = "identifier"
eventexpr = "CDATA"
expr = "CDATA"
fetchaudio "URI"
fetchhint = {prefetch | safe}
fetchtimeout = "CDATA"
maxage "CDATA"
maxstale "CDATA"
message "CDATA"
messageexpr "CDATA"
next"URI"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
accept
{exact |
approximate
}
no
exact
Determines how the choice
is activated. Valid values:

approximate =
Utterances
containing a subphrase of the choice
phrase activate the
choice.

exact = Utterances
that match the
entire choice phrase
activate the choice.
dtmf
CDATA
no
NA
DTMF grammar assigned to
the choice.
event
identifier
no
NA
Event raised by the choice.
eventexpr
CDATA
no
NA
ECMAScript expression that
evaluates to the event to
raise.
expr
CDATA
no
NA
ECMAScript expression that
evaluates to the next URI
to load.
18
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
fetchaudio
URI
no
NA
URI of an audio resource to
play while the XML data is
fetched. If the fetchaudio
attribute is not set, no
audio is played during the
fetch. If the audio is playing
after the XML document is
fetched, the audio
terminates.
fetchhint
{prefetch |
safe}
no
NA
Specifies when the
VoiceXML Interpreter
context should retrieve
content from the server.
Valid values:

prefetch = Fetch the
resource when the
page is loaded.

safe = Fetch the
resource when it is
specifically called by
the application.
fetchtimeout
CDATA
no
NA
Interval to wait for the
content to be returned
before throwing an
error.badfetch event. Use s
for seconds (for example,
1s) and ms for milliseconds
(for example, 1ms).
maxage
CDATA
no
NA
Maximum acceptable age,
in seconds, of a resource
being fetched from the
cache. Setting maxage to 0
means that a cached
version is never considered
fresh.
maxstale
CDATA
no
NA
Maximum acceptable
staleness, in seconds, of
the resource being fetched,
if the fetched resource is
cached and expired.
19
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
message
CDATA
no
NA
Additional information
about the event being
raised. The message is
available as the ECMAScript
variable _message in the
<catch> element that
handles the event.
messageexpr
CDATA
no
NA
ECMAScript expression that
evaluates to the message.
next
URI
no
NA
URI of the next dialog or
document to load.
Details
You can associate speech, DTMF grammars, or both with the choice. When the choice is
selected, the VoiceXML Interpreter can:

Jump to the URI specified by next (or the URI obtained from the ECMAScript
expression expr).

Raise an event (specified either by event, or by evaluating the ECMAScript
expression eventexpr).
Parent
<menu>
Children
<audio>, <break>, <enumerate>, <grammar>, <mark>, <p>, <phoneme>, <prosody>,
<s>, <say-as>, <value>
20
Alphabetical VoiceXML Reference
Example
<?xml version="1.0"?>
'http://dtd.vision.com/voice/2.1/vision_voicexml-2.1.dtd'>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<catch event="quitEvent">
Goodbye
<exit/>
</catch>
<menu id="main">
<prompt>What do you want to eat, apple or orange?</prompt>
<choice dtmf="1" next="#formApple"> apple </choice>
<choice expr="'#' + 'formOrange'"> orange </choice>
<choice event="quitEvent"> quit </choice>
<nomatch>Please say apple, orange, or quit</nomatch>
</menu>
<form id="formApple">
<block>
You chose apple
<exit/>
</block>
</form>
<form id="formOrange">
<block>
You chose orange
<exit/>
</block>
</form>
</vxml>
See Also
<enumerate>, <link> , <menu>, <option>
<clear>
Resets one or more variables, including form items.
Syntax
<clear
namelist = "form_item_name_1 form_item_name_2 form_item_name_3 ..."
/>
Attributes
Attribute
Data Type
Required?
Default
Description
namelist
list of
identifiers
no
medium
Space-separated list of form
item variables. If not specified,
all form item variables in the
current form are cleared.
Details
Resetting a variable does both of the following:

Sets to undefined the variables specified by namelist.

Re-initializes the prompt and event counters.
21
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<field name="pin" type="digits?length=4">
<prompt>What is your pin number?</prompt>
<noinput>
Please say or key in your four digit pin number
<reprompt/>
</noinput>
<filled>
<if cond="pin == 1234">
Code accepted
<else/>
Invalid pin - please try again
<clear namelist="pin"/>
</if>
</filled>
</field>
</form>
</vxml>
See Also
<form>
<content>
Specifies the content of an overlay used in a video stream.
Syntax
<content
src = "URL"
align = "string"
type = "string"
wordwrap = "string"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
align
string
no
left
Horizontal alignment of the text in
the overlay area. Values are: left,
right, and center. This attribute is
ignored for image overlays.
22
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
src
string
yes
[none]
Source URL of the image overlay or
text overlay file. For image
overlays, you must specify the
source URL. For text overlays, you
must specify this attribute or
specify inline content (that is, text
strings placed in the element). One
or the other must be specified.
type
string
yes
text
Type of overlay. Values are: text
and image.
wordwrap
string
no
off
Determines whether to wrap text
to the next line in the overlay area.
Values are: on and off. This
attribute is ignored for image
overlays.
Details
For more information on text overlay and image overlay, see <overlay>.
Parents
<overlay>
Children
<font>, <scroll>
<data>
Enables a VoiceXML application to fetch arbitrary XML data from and submit data to, a
document server, without transitioning to a new VoiceXML document. The XML data fetched
by the <data> element is bound to ECMAScript through the named variable that exposes a
read-only subset of the XML DOM.
Syntax
<data
enctype = "CDATA"
fetchaudio = "URI"
fetchhint = "{prefetch | safe}"
fetchtimeout = "CDATA"
maxage = "CDATA"
maxstale = "CDATA"
method = "{get | post}"
name = "identifier"
namelist = "list of identifiers"
src = "URI"
srcexpr = "CDATA"
/>
23
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attributes
None of the attributes for <data> are required.
Attribute
Data Type
Required?
Default
Description
enctype
CDATA
no
application/
x-wwwformurlencoded
MIME encoding type to
use when submitting
data. Specify a MIME type
of multipart/form-data to
upload the audio file that
results from a record
operation.
fetchaudio
URI
no
NA
URI of an audio resource
to play while the XML
data is fetched. If the
fetchaudio attribute is not
set, no audio is played
during the fetch. If the
audio is playing after the
XML document is fetched,
the audio terminates.
fetchhint
{prefetch |
safe}
no
NA
Specifies when the
VoiceXML Interpreter
context should retrieve
content from the server.
Valid values:
fetchtimeout
CDATA
no
NA

prefetch = Fetch
the resource when
the page is loaded.

safe = Fetch the
resource when it is
specifically called
by the application.
Interval to wait for the
content to be returned
before throwing an
error.badfetch event. Use
s for seconds (for
example, 1s) and ms for
milliseconds (for example,
1ms).
24
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
maxage
CDATA
no
NA
Maximum acceptable age,
in seconds, of a resource
being fetched from the
cache. Setting maxage to
0 means that a cached
version is never
considered fresh.
maxstale
CDATA
no
NA
Maximum acceptable
staleness, in seconds, of
the resource being
fetched, if the fetched
resource is cached and
expired.
method
CDATA
no
get
HTTP request method.
Valid values:

get = Execute
HTTP get.

post = Execute
HTTP post.
name
identifier
no
NA
Name of the variable that
exposes the XML DOM.
This must be a legal
ECMAScript identifier.
namelist
list of
identifiers
no
NA
Space-separated list of
variables submitted. By
default, no variables are
submitted.
src
URI
no
NA
URI that specifies the
location of the XML data
to retrieve.
srcexpr
CDATA
no
NA
ECMAScript expression
that evaluates to the URI
specifying the location of
the XML data to retrieve.
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <form>, <help>, <if>, <noinput>,
<nomatch>, <vxml>
Children
None.
25
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Example
<?xml version="1.0" encoding="UTF-8"?>
<quote>
<ticker>F</ticker>
<name>Ford Motor Company</name>
<change>1.00</change>
<last>30.00</last>
</quote>
VoiceXML that retrieves a stock quote from the XML document:
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<data name="quote" src="quote.xml" maxage="0"/>
<script>
var price = quote.documentElement.getElementsByTagName("last").
item(0).firstChild.data;
</script>
<form>
<block>
Price is <value expr="price"/>
</block>
</form>
</vxml>
See Also
<script>, <submit>, <var>
<desc>
Provides a textual description of the referenced audio source.
Syntax
<desc
xml:lang = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
xml:lang
CDATA
no
NA
RFC 1766-compliant identifier
used to indicate that the content
of the element is in a different
language from that of the
content surrounding the
element.
Details
This element can only occur as a child of <audio>. It does not affect the audio output in any
way.
Parents
<audio>
Children
None.
26
Alphabetical VoiceXML Reference
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<audio src="../audio/effect_1.wav">
<desc> Vivaldi music earcon </desc>
</audio>
</block>
</form>
</vxml>
<disconnect>
Causes the VoiceXML Interpreter context to disconnect from the user.
Syntax
<disconnect
namelist = "list of identifiers"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
namelist
list of
identifiers
no
NA
Space-separated list of form
item variable to return to the
VoiceXML Interpreter context. By
default, no variables are
returned.
Details
Causes a connection.disconnect.hangup event to occur.
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<catch event="connection.disconnect.hangup">
<log expr="'disconnected'"/>
<exit/>
</catch>
<form>
<block>
<prompt>Get ready to disconnect!</prompt>
<disconnect/>
</block>
</form>
</vxml>
See Also
<exit>
27
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
<else>
Used in if..elseif..else conditional logic.
Syntax
<if cond="CDATA">
<!-- do something -->
<elseif cond="CDATA"/>
<!-- do something else -->
<elseif cond="CDATA"/>
<!-- do something else -->
<else/>
<!-- do something else -->
</if>
Attributes
None.
Parents
<if>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<field name="pin" type="digits?length=4">
<prompt>What is your pin number?</prompt>
<noinput>
Please say or key in your four digit pin number
<reprompt/>
</noinput>
<filled>
<if cond="pin == 1234">
Code accepted
<elseif cond="pin == 4321">
Code accepted
<else/>
Invalid pin - please try again
<clear namelist="pin"/>
</if>
</filled>
</field>
</form>
</vxml>
See Also
<if>, <elseif>
<elseif>
Used in if..elseif..else conditional logic.
28
Alphabetical VoiceXML Reference
Syntax
<if cond="CDATA">
<!-- do something -->
<elseif cond="CDATA"/>
<!-- do something else -->
<elseif cond="CDATA"/>
<!-- do something else -->
<else/>
<!-- do something else -->
</if>
Attributes
Attribute
Data Type
Required?
Default
Description
cond
CDATA
yes
NA
Boolean expression that must
evaluate to ECMAScript true for
the <elseif> element to execute.
Parents
<if>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<field name="pin" type="digits?length=4">
<prompt>What is your pin number?</prompt>
<noinput>
Please say or key in your four digit pin number
<reprompt/>
</noinput>
<filled>
<if cond="pin == 1234">
Code accepted
<elseif cond="pin == 4321"/>
Code accepted
<else/>
Invalid pin - please try again
<clear namelist="pin"/>
</if>
</filled>
</field>
</form>
</vxml>
See Also
<else>, <if>
<emphasis>
Specifies the stress of the text enclosed within the <emphasis> element.
29
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Syntax
<emphasis
level="{strong|moderate|reduced|none}"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
level
{strong |
moderate |
reduced |
none}
yes
moderate
Amount of emphasis assigned to
the text.
Parents
<audio>, <choice>, <emphasis>, <enumerate>, <option>, <p>, <s>, <prompt>,
<prosody>, <voice>
Children
<audio>, <break>, <emphasis>, <enumerate>, <mark>, <phoneme>, <prosody>, <sayas>, <value>, <voice>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
Thank you <emphasis>so</emphasis> much.
</block>
</form>
</vxml>
See Also
<prompt>
<enumerate>
Generates an automatic prompt of menu choices or field options.
Syntax
<enumerate/>
Attributes
None.
Details
The <enumerate> element can be empty or it can contain text , speech mark-up, and
<value> elements that reference the following special variables:

_prompt contains the text for the current choice or option.

_dtmf contains the DTMF sequence for the current choice or option.
30
Alphabetical VoiceXML Reference
Parents
<audio>, <block>, <catch>, <choice>, <enumerate>, <error>, <field>, <filled>,
<foreach>, <help>, <if>, <initial>, <menu>, <noinput>, <nomatch>, <object>,
<prompt>, <prosody>, <record>, <subdialog>, <transfer>, <voice>
Children
<audio>, <break>, <emphasis>, <enumerate>, <mark>, <p>, <phoneme>, <prosody>,
<say-as>, <s>, <value>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<catch event="myEvent">
Goodbye
<exit/>
</catch>
<catch event="nomatch">
I didn't understand. Say one of <enumerate/>
</catch>
<!-Note that the DTMF sequence for each choice will be
assigned automatically
-->
<menu id="main" dtmf="true">
<prompt>
Main Menu <break time="500ms"/>
<enumerate>
For <value expr="_prompt"/> say <value expr="_prompt"/>
or press <value expr="_dtmf"/>
</enumerate>
</prompt>
<choice next="#news"> news </choice>
<choice next="#sport"> sport </choice>
<choice event="myEvent"> quit </choice>
</menu>
<form id="news">
<block>
You chose news
<goto next="#main"/>
</block>
</form>
<form id="sport">
<block>
You chose sport
<goto next="#main"/>
</block>
</form>
</vxml>
See Also
<choice>, <option>
<error>
Catches the error event.
Syntax
<error
cond = "CDATA"
count = "integer"
/>
31
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attributes
Attribute
Data Type
Required?
Default
Description
cond
CDATA
no
NA
Boolean expression that must
evaluate to ECMAScript true for
the catch to execute.
count
integer
no
NA
Occurrence number of the error.
This permits alternate handlers to
be defined for the error. For
example, count=5 specifies the
fifth occurrence of the error.
Details
This element is shorthand for <catch event="error">.
Parents
<field>, <form>, <initial>, <menu>, <record>, <subdialog>, <transfer>, <vxml>
Children
<assign>, <audio>, <clear>, <data>, <disconnect>, <enumerate>, <exit>, <foreach>,
<goto>, <if>, <log>, <prompt>, <reprompt>, <return>, <script>, <submit>, <throw>,
<value>, <var>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<error>
An error has occurred -- please call again later.
<exit/>
</error>
<form id="formEntry">
<block>
Good applications are written defensively
</block>
</form>
</vxml>
See Also
<catch>
<example>
Defines an example phrase within XML grammar constructs.
Syntax
<example/>
Attributes
None.
32
Alphabetical VoiceXML Reference
Details
The <example> element is part of the Speech Recognition Grammar Specification (SRGS).
Use the example phrase to create a successful recognition result for the grammar in
question.
Parents
<rule>
Children
None.
Example
<?xml version= "1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar"
xml:lang="en-GB" root="rule1">
<rule id="rule1" scope="public">
<example> irish </example>
<example> or, english </example>
<one-of>
<item> irish
<tag><fieldone "irish"></tag>
</item>
<item> english
<tag><fieldone "english"></tag>
</item>
</one-of>
</rule>
</grammar>
<exit>
Terminates all loaded documents in the application.
Syntax
<exit
expr = "CDATA"
namelist = "list of identifiers"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
expr
CDATA
no
NA
Boolean expression that must
evaluate to ECMAScript true for
the exit to execute.
namelist
list of
identifiers
no
NA
Space-separated list of form
item variables to return. If not
specified, no variables are
returned.
Details
When <exit> is executed, control is returned to the VoiceXML Interpreter. An exit event is
not raised.
33
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form id="formExit">
<block>
<prompt>Thanks for using the voice portal</prompt>
<exit/>
</block>
</form>
</vxml>
See Also
<disconnect>
<field>
Specifies an input field for a form.
Syntax
<field
cond = "CDATA"
expr = "CDATA"
modal = "{true|false}"
name = "identifier"
slot = "identifier"
type = "{ boolean | currency |date |digits | number | phone | time}"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
cond
CDATA
no
NA
Boolean expression that must
evaluate to ECMAScript true for
the <field> element to execute.
expr
CDATA
no
ECMAScript
undefined
Initial value of the form item
variable.
modal
boolean
no
NA
Grammars to enable. Valid
values:

true = Only the field's
grammars are enabled.
All other active grammars
are temporarily disabled.

false = All active
grammars are enabled.
34
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
name
identifier
no
NA
Name of a shadow variable or a
field item variable that holds the
recognition result. Shadow
variables are values available
from a field item, specified as
fieldItemVariableName$.shadow
Variable. Supported shadow
variables are:

name$.bargeintime =
Time interval between
playback started and
bargein occurred, in ms
(Programmable Media
Platform proprietary).

name$.confidence =
Confidence level in the
recognized result. Valid
values range from 0.0
(minimum confidence
level) to 1.0 (maximum
confidence level).

name$.interpretation =
ECMAScript variable
containing the
interpretation of the
utterance.

name$.inputmode =
Mode in which user input
was provided. Valid
values are either dtmf or
voice.

name$.recording =
Reference to the
utterance recorded
during recognition, if the
input mode was voice;
otherwise undefined.

name$.recordingsize =
Size of the recording in
bytes, or undefined if no
audio is collected.

name$.recordingduration
= Duration of the
recording in ms, or
undefined if no audio is
collected.
35
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description

name$.utterance = Raw
string of recognized
words.
slot
identifier
no
NA
Name of the grammar slot used
to populate the variable. If not
specified, the value is the field
item variable name.
type
{boolean |
currency |
date |
digits |
number |
phone |
time}
no
NA
Name of an internal grammar.
Input can be through voice or
DTMF. Valid values are:


boolean = Recognizes
negative or positive
responses. Accepts the
following parameters:

boolean = Default
boolean type (no
parameters
specified). A key
press of 1 is the
affirmative
answer, and a key
press of 2 is the
negative answer.

boolean?y=d =
DTMF grammar
that treats the key
press d as an
affirmative
answer.

boolean?n=e =
DTMF grammar
that treats the key
press e as a
negative answer.
currency = Recognizes
currency amounts; for
example, $56.78. The
default currency is euro
number, which
recognizes real numbers;
for example, 3.14 or 77.
(Not currently
supported.)
36
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description

date = Recognizes date
formats; for example,
YYYYMMDD 20020317.
(Not currently
supported.)

digits = Recognizes the
digits 0 through 9.

digits?minlength=n =
String of at least n digits.

digits?maxlength=m =
String of at most m
digits.

digits?length=p = String
of exactly p digits.

phone = Recognizes
telephone numbers; for
example, 800-555-1234.
(Not currently
supported).

time = Recognizes hours
and minutes; for
example, 10:45. (Not
currently supported.)
Parents
<form>
Children
<audio>, <catch>, <enumerate>, <error>, <filled>, <grammar>, <help>, <link>,
<noinput>, <nomatch>, <option>, <prompt>, <property>, <value>
37
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<field name="sevendigits" type="digits?length=7" modal="true">
<prompt>Say or type a seven digit number</prompt>
</field>
<field name="answer" type="boolean" modal="true">
<prompt>Answer yes or no</prompt>
</field>
<filled namelist="sevendigits answer">
<prompt>
Your number was
<say-as interpret-as="vxml:digits">
<value expr="sevendigits"/>
</say-as>
<break time="80ms"/>
and you answered <value expr="answer"/>
<break time="80ms"/> Bye
</prompt>
</filled>
</form>
</vxml>
See Also
<form>, <initial>
<filled>
Action to perform after a form input item is filled.
Syntax
<filled
mode = "{all | any}"
namelist = "list of identifiers"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
mode
identifier
no
all
Determines when the <filled>
element is executed. Valid
values:

all = <filled> element is
executed when all of the
fields are filled.

any = <filled> element is
executed when any of the
fields are filled.
If the <filled> element is
specified at the form-item level,
the mode attribute cannot be
specified in the <filled> element.
38
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
namelist
list of
identifiers
no
NA
Space-separated list of input
item variables. Control items are
not permitted in this list. When
omitted, the namelist defaults to
the names of all of the form's
input items. If the <filled> tag is
specified at the form-item level,
the namelist attribute cannot be
specified in the <filled> tag.
Details
The <filled> element can be a child of:

An input item, in which case the actions are executed when that item is filled.

The <form> element, in which case the actions are executed as determined by the
mode attribute.
Parents
<field>, <form>, <object>, <record>, <subdialog>, <transfer>
Children
<assign>, <audio>, <clear>, <data>, <disconnect>, <enumerate>, <exit>, <foreach>,
<goto>, <if>, <log>, <prompt>, <reprompt>, <return>, <script>, <submit>, <throw>,
<value>, <var>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<field name="userID" type="digits?length=8">
<prompt>What is your user ID?</prompt>
<noinput>
Please say or key in your eight digit user ID
<reprompt/>
</noinput>
</field>
<field name="pin" type="digits?length=4">
<prompt>What is your pin number?</prompt>
<noinput>
Please say or key in your four digit pin number
<reprompt/>
</noinput>
<!-A field level <filled> - does not specify mode or namelist.
-->
<filled>
<if cond="pin == 9999">
Entry denied - please retry
<clear namelist="pin"/>
<elseif cond="pin == 0000"/>
Invalid pin - please re try
<clear namelist="pin"/>
<else/>
You entered <value expr="pin"/>
</if>
</filled>
</field>
39
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
<!-A form level <filled> - executes when both fields are filled:
-->
<filled namelist="userID pin" mode="all">
<submit next="validate.jsp"/>
</filled>
</form>
</vxml>
See Also
<field>, <form>, <object>, <record>, <subdialog>, <transfer>
<foreach>
Iterates through an ECMAScript array, executing the contained executable content for each
item in the array. Typically, <foreach> is used to concatenate prompts dynamically.
Syntax
<foreach
array="CDATA"
item="identifier">
<!-- do something -->
</foreach>
Attributes
Attribute
Data Type
Required?
Default
Description
array
CDATA
yes
NA
ECMAScript expression that
must evaluate to an array;
otherwise, an error.semantic
event is thrown.
item
identifier
yes
NA
Variable that stores each array
item upon each iteration of the
loop. A new variable is declared
if it is not already defined within
the parent's scope.
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>,
<prompt>
Children
<assign>, <audio>, <clear>, <data>, <disconnect>, <else>, <elseif>, <enumerate>,
<exit>, <foreach>, <goto>, <if>, <log>, <prompt>, <reprompt>, <return>, <script>,
<submit>, <throw>, <value>, <var>
Example
foreach
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<script>
var movies = new Array(3);
40
Alphabetical VoiceXML Reference
movies[0] = new Object();
movies[0].audio = "godfather.wav";
movies[0].tts = "the godfather";
movies[1] = new Object();
movies[1].audio = "high_fidelity.wav";
movies[1].tts = "high fidelity";
movies[2] = new Object();
movies[2].audio = "raiders.wav";
movies[2].tts = "raiders of the lost ark";
</script>
<form id="pick_movie">
<field name="movie">
<grammar type="application/srgs+xml" src="movie_names.grxml"/>
<prompt>
<audio src="prelist.wav">
When you hear the name of the movie you want,
just say it.
</audio>
<foreach item="thePrompt" array="movies">
<audio expr="thePrompt.audio">
<value expr="thePrompt.tts"/>
</audio>
<break time="300ms"/>
</foreach>
</prompt>
</field>
</form>
</vxml>
See Also
<if>, <prompt>
<form>
Dialog that defines an interaction for collecting values for a set of field item variables.
Syntax
<form
id = "identifier"
scope = "dialog|document"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
id
identifier
no
NA
Unique name of the form.
Having a unique name
facilitates the transfer of
control from form to form.
41
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
scope
{document|dialog}
no
dialog
Scope for the grammar
contained in the form. Valid
values:

dialog = Grammar
is only active in the
current form.

document =
Grammar is active
throughout the
current document.
Details
A form can contain the following items:

Input items filled by user utterances.

Control items that control form execution.

Event handlers.

Dialog-scoped variables.

Filled items, which specify the action to take after a field is input.

Properties.
Parents
<vxml>
Children
<block>, <catch>, <data>, <error>, <field>, <filled>, <grammar>, <help>, <initial>,
<link>, <noinput>, <nomatch>, <object>, <property>, <record>, <script>, <subdialog>,
<transfer>, <var>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form id="creditCard">
<field name="cardtype">
<prompt>Which credit card type ?</prompt>
<grammar type="application/srgs+xml" root="cardtype">
<rule id="cardtype">
<one-of>
<item>american express <tag>amex</tag></item>
<item>master card <tag>mc</tag></item>
<item>visa <tag>visa</tag></item>
</one-of>
</rule>
</grammar>
<noinput count="1">
Sorry I didn't hear you
<reprompt/>
</noinput>
<noinput count="2">
Sorry still didn't hear you
<reprompt/>
42
Alphabetical VoiceXML Reference
</noinput>
<nomatch count="1">
<prompt>
Sorry I didn't understand please repeat the card type
</prompt>
</nomatch>
<nomatch count="2">
<prompt>
I still don't understand please select either american
express or master card or visa
</prompt>
</nomatch>
<filled>
<prompt>
You selected <value expr="cardtype"/>
</prompt>
</filled>
</field>
</form>
</vxml>
See Also
<menu>
<font>
Specifies the font used in a text overlay. This element is not used for image overlays.
Syntax
<font
name = "string"
size = "positive int"
style = "string"
fgcolor = "string"
/>
43
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attributes
Attribute
Data Type
Required?
Default
Description
fgcolor
string or
integer
no
white
Color of text. Values are:
red, blue, green, yellow,
magenta, cyan, white,
black, transparent or an
unsigned integer. If a color
enumeration is specified,
the color will be opaque.
If an integer is specified,
use the format
0xRRGGBBTT, where RR is
a 2-digit hexadecimal value
for the red component, GG
is for the green component,
BB is for the blue
component, and TT is the
value for the transparency
component. Transparent
can be used as a color or
specified in the TT of the
bitmask.
name
string
yes
font:///usr/share/
fonts/liberation/
LiberationSansRegular.ttf
Name of the font, such as
Arial or Times New Roman.
Specify the URL to the font
file using this format:
font:///usr/share/fonts/...
size
positive int
yes
14
Font size.
style
string
no
[none]
One or more attributes to
apply to the text: bold,
italic, underlined, outlined.
Details
For more information on text overlay and image overlay, see <overlay>.
Parents
<content>
<goto>
Transfers execution to the specified URI.
44
Alphabetical VoiceXML Reference
Syntax
<goto
expr = "CDATA"
expritem = "CDATA"
fetchaudio = "URI"
fetchhint = "{prefetch | safe}"
fetchtimeout = "CDATA"
maxage = "CDATA"
maxstale = "CDATA"
next = "URI"
nextitem = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
expr
CDATA
no
NA
ECMAScript expression that
evaluates to the next dialog
URI fragment.
expritem
CDATA
no
NA
ECMAScript expression that
evaluates to the next form
item to transition to.
fetchaudio
URI
no
NA
URI of an audio resource to
play while the next document
resource is being fetched. If
the fetchaudio attribute is not
set, no audio is played during
the fetch. The audio is
terminated after the next
document is fetched.
fetchhint
{prefetch |
safe}
no
NA
Specifies when the VoiceXML
Interpreter context should
retrieve content from the
server. Valid values:

prefetch = Fetch the
resource when the page
is loaded.

safe = Fetch the
resource when it is
specifically called by the
application.
45
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
fetchtimeout
CDATA
no
NA
Time interval to wait for the
content to be returned before
throwing an error.badfetch
event. Use s for seconds (for
example, 1s) and ms for
milliseconds (for example,
1ms).
maxage
CDATA
no
NA
Maximum acceptable age, in
seconds, of a resource being
fetched from the cache. Setting
maxage to 0 means that a
cached version is never
considered fresh.
maxstale
CDATA
no
NA
Maximum acceptable staleness,
in seconds, of the resource
being fetched, if the fetched
resource is cached and expired.
next
URI
no
NA
The URI fragment of the next
dialog, or URI of the next
document to load.
nextitem
CDATA
no
NA
The next form item in the
current form to transition to.
Details
The destination of a <goto> operation can be:

An item in the current form; for example, a named block

A dialog in the current document; for example, a named form

A new document
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form id="form1">
<block name="block1">
<prompt>Currently in block one</prompt>
<goto nextitem="block3"/>
</block>
<block name="block2">
<prompt>Now in block two</prompt>
46
Alphabetical VoiceXML Reference
</block>
<block name="block3">
<prompt>Now in block three</prompt>
<goto next="#form2"/>
</block>
</form>
<form id="form2">
<block name="block4">
<prompt>Now in form two</prompt>
</block>
</form>
</vxml>
See Also
<submit>
<grammar>
Specifies the valid spoken utterances and corresponding string values returned in response
to the utterances.
Syntax
<grammar
fetchhint = "{prefetch | safe}"
fetchtimeout = "CDATA"
maxage = "CDATA"
maxstale = "CDATA"
mode = "{voice | dtmf}"
root = "CDATA"
scope = "{document | dialog}"
src = "URI"
srcexpr = "CDATA"
tag-format = "CDATA"
type = "CDATA"
version = "CDATA"
weight = "CDATA"
xml:lang = "locale identifier"
xml:base = "URI"
xmlns = "CDATA"
xmlns:xsi = "CDATA"
xsi:schemalocation = "CDATA"
/>
Attributes
None of the <grammar> attributes are required.
47
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
fetchhint
{prefetch |
safe}
no
None.
Specifies when the
VoiceXML Interpreter
context should retrieve
content from the
server. Valid values:

prefetch = Fetch
the resource
when the page is
loaded.

safe = Fetch the
resource when it
is specifically
called by the
application.
fetchtimeout
CDATA
no
NA
Time interval to wait for
the content to be
returned before
throwing an
error.badfetch event.
Use s for seconds (for
example, 1s) and ms
for milliseconds (for
example, 1ms).
maxage
CDATA
no
NA
Maximum acceptable
age, in seconds, of a
resource being fetched
from the cache. Setting
maxage to 0 means
that a cached version is
never considered fresh.
maxstale
CDATA
no
NA
Maximum acceptable
staleness, in seconds,
of the resource being
fetched, if the fetched
resource is cached and
expired.
48
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
mode
{voice |
dtmf}
no
voice
Input type this
grammar recognizes.
Valid values:

voice =
Grammar
recognizes voice
input.

dtmf =
Grammar
recognizes DTMF
input.
root
CDATA
no
NA
Root rule for the
document.
scope
{document |
dialog}
no
dialog
Scope for the grammar
contained in the form.
Valid values:

document =
Grammar is
active
throughout the
current
document.

dialog =
Grammar is
active only in
the current
form.
src
URI
no
NA
URI of the grammar
file.
srcexpr
CDATA
no
NA
ECMAScript expression
that evaluates to the
URI of the grammar
file.
tag-format
CDATA
no
semantic/
1.0literals
Tag format of the
grammar.
49
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
type
CDATA
no
NA
MIME type of the
grammar. If omitted,
the VoiceXML
Interpreter attempts to
determine the type
dynamically. The type
attribute can also
specify the character
encoding of the
grammar, as follows:
type="application/srgs+xm
l;
charset=UTF-8".
version
CDATA
no
1.0
Currently not
supported.
weight
CDATA
no
NA
Currently not
supported.
xml:lang
locale
identifier
no
NA
Language and locale of
the document, using an
identifier compliant with
RFC 1766.
xml:base
URI
no
NA
Base URI from which
relative URIs in the
grammar are resolved.
xmlns
CDATA
no
NA
(Stand-alone SRGS XML
documents only)
Designated namespace
for the SRGS XML
format.
xmlns:xsi
CDATA
no
NA
(Stand-alone SRGS XML
documents only) Used
with the
xsi:schemalocation
attribute to indicate the
location of the schema
for the SRGS XML
namespace.
xsi:schemalocation
CDATA
no
NA
Used with xmlns:xsi
attribute to indicate the
location of the schema
for the SRGS XML
namespace.
50
Alphabetical VoiceXML Reference
Details
The XML form of the Speech Recognition Grammar Specification (SRGS) is also supported in
VoiceXML 2.1 applications.
Parents
<choice>, <field>, <form>, <link>, <option>, <record>, <transfer>
Children
<lexicon>, <meta>, <rule>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form id="creditCard">
<field name="cardtype">
<prompt>Which credit card type ?</prompt>
<grammar type="application/srgs+xml" root="cardtype">
<rule id="cardtype">
<one-of>
<item>american express <tag>amex</tag></item>
<item>master card <tag>mc</tag></item>
<item>visa <tag>visa</tag></item>
</one-of>
</rule>
</grammar>
<noinput count="1">
Sorry I didn't hear you
<reprompt/>
</noinput>
<noinput count="2">
Sorry still didn't hear you
<reprompt/>
</noinput>
<nomatch count="1">
<prompt>
Sorry I didn't understand please repeat the card type
</prompt>
</nomatch>
<nomatch count="2">
<prompt>
I still don't understand please select either american
express or master card or visa
</prompt>
</nomatch>
<filled namelist="cardtype">
<prompt>
You selected <value expr="cardtype"/>
</prompt>
</filled>
</field>
</form>
</vxml>
See Also
<form>
<help>
Catches the help event.
51
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Syntax
<help
cond = "CDATA"
count = "integer"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
cond
CDATA
no
NA
Boolean expression that must
evaluate to ECMAScript true for
the <help> element to execute.
count
integer
no
NA
Numerical occurrence of the help
event, such as 2 for the second
occurrence. This allows you to
handle different occurrences of
the help event in different ways.
Details
The <help> element is shorthand for <catch event="help">.
Parents
<field>, <form>, <initial>, <menu>, <object>, <record>, <subdialog>, <transfer>,
<vxml>
Children
<assign>, <audio>, <clear>, <data>, <disconnect>, <enumerate>, <exit>, <foreach>,
<goto>, <if>, <log>, <prompt>, <reprompt>, <return>, <script>, <submit>, <throw>,
<value>, <var>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<catch event="terminate">
Caught terminate
<goto next="#formExit"/>
</catch>
<help>
<audio src="../../audio/help.wav" maxage="0"/>
Help requested
<goto next="#formEntry"/>
</help>
<error>
Caught error
<goto next="#formExit"/>
</error>
<var name="bCondition" expr="false"/>
<form id="formEntry">
<catch event="customEvent">
Form scope custom handler
Throwing terminate
<throw event="terminate"/>
</catch>
<catch event="terminate" cond="bCondition">
This handler will not be executed due to the condition
52
Alphabetical VoiceXML Reference
</catch>
<block>
Throwing custom event
<throw event="customEvent"/>
</block>
</form>
<form id="formExit">
<block>
Goodbye
<exit/>
</block>
</form>
</vxml>
See Also
<catch>
<if>
Used in if..elseif..else conditional logic.
Syntax
<if cond="CDATA">
<!-- do something -->
<elseif cond="CDATA"/>
<!-- do something else -->
<elseif cond="CDATA"/>
<!-- do something else -->
<else/>
<!-- do something else -->
</if>
Attributes
Attribute
Data Type
Required?
Default
Description
cond
CDATA
yes
NA
Boolean expression that must
evaluate to ECMAScript true for
the <if> element to execute.
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>
Children
<assign>, <audio>, <clear>, <data>, <disconnect>, <else>, <elseif>, <enumerate>,
<exit>, <foreach>, <goto>, <if>, <log>, <prompt>, <reprompt>, <return>, <script>,
<submit>, <throw>, <value>, <var>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<field name="pin" type="digits?length=4">
<prompt>What is your pin number?</prompt>
<noinput>
Please say or key in your four digit pin number
<reprompt/>
53
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
</noinput>
<filled>
<if cond="pin == 9999">
Entry denied - please re try
<clear namelist="pin"/>
<elseif cond="pin == 0000"/>
Invalid pin - please retry
<clear namelist="pin"/>
<else/>
You entered <value expr="pin"/>
</if>
</filled>
</field>
</form>
</vxml>
See Also
<else>, <elseif>
<initial>
Control item that specifies the entry logic for a mixed initiative form.
Syntax
<initial
cond = "CDATA"
expr = "PCDATA"
name = "identifier"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
cond
CDATA
no
NA
Boolean expression that must
evaluate to ECMAScript true
for the <initial> element to
execute.
expr
PCDATA
no
ECMAScript
undefined
Initial value of the form item
variable.
name
identifier
no
NA
Name of the form item
variable. This must be a legal
ECMAScript identifier.
Details
The <initial> element prompts the user, expecting an utterance matching a form-level
grammar to fill multiple fields. When a field is filled by an utterance, all <initial> items in
the current form are set. They are not set again unless explicitly cleared.
The <initial> element requires a form-level grammar. Field grammars are not active while
the <initial> element executes.
54
Alphabetical VoiceXML Reference
Parents
<form>
Children
<audio>, <catch>, <enumerate>, <error>, <help>, <link>, <noinput>, <nomatch>,
<prompt>, <property>, <value>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form id="weather_info">
<grammar src="../../grammar/weatherService.grxml" maxage="0"/>
<block>
<prompt bargein="false">
Welcome to the weather information service.
<audio src="http://www.online-ads.example/wis.wav"/>
Vox pilot develop anywhere deploy everywhere
</prompt>
</block>
<initial name="start">
<prompt>
For what city and country would you like the weather?
</prompt>
<help>
Please say the name of the city and country for which you
would like a weather report.
</help>
</initial>
<field name="country">
<prompt>What country?</prompt>
<help>
Please speak the country for which you want the weather.
</help>
</field>
<field name="city">
<prompt>
Please say the city in <value expr="country"/>
for which you want the weather.
</prompt>
<help>
Please speak the city for which you want the weather.
</help>
</field>
<field name="go_ahead" type="boolean" modal="true">
<prompt>
Do you want to hear the weather
for <value expr="city"/>
in <value expr="country"/>
</prompt>
<filled>
<if cond="go_ahead">
<!-- Servlet example, does not exist -->
<submit next="/servlet/weather" method="post"
namelist="city country" fetchtimeout="45s" />
</if>
<clear namelist="start city country go_ahead"/>
</filled>
</field>
</form>
</vxml>
weatherService.grxml:
<?xml version="1.0"?>
<grammar version="1.0" root="weatherservice"
xmlns="http://www.w3.org/2001/06/grammar"
xml:lang="en-gb">
<rule id="weatherservice">
<one-of>
55
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
<item>dublin <tag>dublin</tag></item>
<item>cork <tag>cork</tag></item>
<item>amsterdam <tag>amsterdam</tag></item>
</one-of>
</rule>
</grammar>
See Also
<field>, <form>
<item>
Defines a valid utterance match within an XML grammar.
Syntax
<item
repeat = "integer"
repeat-prob = "CDATA"
weight = "CDATA"
/>
Attributes
None of the <item> attributes are required.
Attribute
Data Type
Default
Description
repeat
integer
NA
Integer range that specifies how many times
the item can be repeated.
repeat-prob
CDATA
NA
Currently not supported.
weight
CDATA
NA
Probability weighting of this item.
Parents
<item>, <one-of>, <rule>
Children
<item>, <one-of>, <ruleref>, <tag>
Example
<?xml version= "1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar"
xml:lang="en-GB" root="ruleid">
<rule id="ruleid" scope="public">
<one-of>
<item>
irish
<tag><fieldone "irish"></tag>
</item>
<item weight="0.1">
english
<tag><fieldone "english"></tag>
</item>
<item weight="0.9">
french
<tag><fieldone "french"></tag>
</item>
56
Alphabetical VoiceXML Reference
</one-of>
</rule>
</grammar>
<lexicon>
Location of a pronunciation lexicon document that contains mappings of words to substitute
words, and mappings of words to phoneme sequences.
Syntax
<lexicon
type = "CDATA"
uri = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
type
CDATA
no
NA
Media type of the pronunciation
lexicon document.
uri
CDATA
yes
NA
URI of the pronunciation lexicon
document.
Details
The SSML specification does not define a default lexicon format. Until such a format is
defined, the format supported is a subset of a W3C XML Lexicon Working Draft specification
(with media type application/x-lexicon).
The root element in a lexicon document is the <lexicon> element. This can include an
alphabet attribute, which specifies the alphabet used in phonetic sequences contained in the
document, if any. The SSML <phoneme> element defines the valid values for the <lexicon>
element. If the alphabet is unspecified or unrecognized, the SSML Processor uses the
International Phonetic Alphabet (IPA).
The lexicon document can contain zero or more <lexeme> elements. Each <lexeme>
element contains child text that specifies the target word or phrase to be substituted, and
either a <sounds-like> element or a <phoneme> element:

The <sounds-like> element uses child text to specify the substitute word or phrase
with which the target word or phrase is to be replaced. This is equivalent to the
SSML <sub> element.

The <phoneme> element uses the ph attribute to specify a sequence of phonemes
with which the target word or phrase is to be replaced.
Parents
<grammar>
Children
None.
57
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<prompt>
<lexicon uri="DublinAsLondon.lexicon" type="application/x-lexicon"/>
</prompt>
</block>
</form>
</vxml>
See Also
<phoneme>, <sub>
<link>
Specifies one or more grammars, which are scoped to the element containing the link.
Syntax
<link
dtmf = "CDATA"
event = "CDATA"
eventexpr = "CDATA"
expr = "CDATA"
fetchaudio = "URI"
fetchint = "{prefetch | safe}"
fetchtimeout = "CDATA"
next = "URI"
scope = "{document | dialog}"
src = "URI"
tag-format = "CDATA"
type = "CDATA"
version = "CDATA"
weight = "CDATA"
xml:lang = "locale identifier"
xmlns = "CDATA"
xmlns:xsi = "CDATA"
xsi:schemalocation = "CDATA"
/>
Attributes
None of the attributes are required.
Attribute
Data Type
Required?
Default
Description
dtmf
CDATA
no
NA
DTMF key used to
validate a successful
grammar match.
event
CDATA
no
NA
Event that can be raised
to the application.
58
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
eventexpr
CDATA
no
NA
ECMAScript expression
that evaluates to the
event which can be
raised to the application.
expr
CDATA
no
NA
ECMAScript value that
evaluates to the target
URI.
fetchaudio
{voice |
dtmf}
no
NA
URI of an audio resource
to play while the XML
data is fetched. If the
fetchaudio attribute is
not set, no audio is
played during the fetch.
If the audio is playing
after the XML document
is fetched, the audio
terminates.
fetchhint
{prefetch |
safe}
no
NA
Specifies when the
VoiceXML Interpreter
context should retrieve
content from the server.
Valid values:
fetchtimeout
CDATA
no
NA

prefetch = Fetch
the resource
when the page is
loaded.

safe = Fetch the
resource when it
is specifically
called by the
application.
Time interval to wait for
the content to be
returned before throwing
an error.badfetch event.
Use s for seconds (for
example, 1s) and ms for
milliseconds (for
example, 1ms).
59
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
next
URI
no
NA
URI of the dialog (form
or menu) or document to
transition to when the
user input matches one
of the grammars
specified by <link>.
scope
{dialog |
document}
no
dialog
Scope for the grammar
contained in the form.
Valid values:

dialog =
Grammar is
active only in the
current form.

document =
Grammar is
active throughout
the current
document.
src
URI
no
NA
URI of the grammar file.
tag-format
CDATA
no
Nuance
Tag format of the
grammar. Currently the
only supported format is
of type "Nuance".
type
CDATA
no
NA
MIME type of the
grammar. If omitted, the
VoiceXML Interpreter
attempts to determine
the type dynamically.
The type attribute can
also specify the
character encoding of
the grammar, as follows:
type="application/srgs+xml
; charset=UTF-8"
version
CDATA
no
NA
SRGS version of this
grammar. Currently not
supported.
weight
CDATA
no
NA
Currently not supported.
60
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
xml:lang
locale
identifier
no
NA
Language and locale of
the document using an
identifier compliant with
RFC 1766.
xmlns
CDATA
no
NA
(Applies to stand-alone
SRGS XML documents
only.) Designated
namespace for the SRGS
XML format.
xml:xsi
CDATA
no
NA
(Applies to stand-alone
SRGS XML documents
only.) Used with
xsi:schemalocation to
indicate the location of
the schema for the SRGS
XML namespace.
xmlschemalocation
CDATA
no
NA
(Applies to stand-alone
SRGS XML documents
only.) Used with
xmlns:xsi to indicate the
location of the schema
for the SRGS XML
namespace.
Details
When one of the grammars specified by <link> is matched, the link is activated and does
one of the following:

Transitions to a new dialog or document using the value of the next or expr
attributes.

Raises an event using the value of the event or eventexpr attributes.
Parents
<field>, <form>, <initial>, <vxml>
Children
<grammar>
Example
<?xml version="1.0"?>
<!DOCTYPE vxml PUBLIC '-//Vision/DTD VoiceXML 2.1//EN'
'http://dtd.vision.com/voice/2.1/vision_voicexml-2.1.dtd'>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<link next="#linkTest">
<grammar type="application/srgs+xml" root="Repeat">
<rule id="Repeat">
<item>repeat</item>
</rule>
61
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
</grammar>
</link>
<catch event="quit">
Goodbye
<exit/>
</catch>
<form id="init">
<field name="link" >
<prompt>
Say repeat to execute the link
<break time="90ms"/>
Or say quit to exit
<break time="200ms"/>
</prompt>
<link event="quit">
<grammar type="application/srgs+xml" root="Quit">
<rule id="Quit">
<item>quit</item>
</rule>
</grammar>
</link>
</field>
<catch event="noinput nomatch">
<reprompt/>
</catch>
</form>
<form id="linkTest">
<block>
This is the link test
<goto next="#init"/>
</block>
</form>
</vxml>
See Also
<form>
<log>
Generates a log message to use for performance monitoring or debugging purposes.
Syntax
<log
expr = "CDATA"
label = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
expr
CDATA
no
NA
ECMAScript expression that
evaluates to the label.
label
CDATA
no
NA
String that specifies the purpose
or severity of the log message.
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>
62
Alphabetical VoiceXML Reference
Children
None.
Example
<?xml version="1.0"?>
<!DOCTYPE vxml PUBLIC '-//Vision/DTD VoiceXML 2.1//EN'
'http://dtd.vision.com/voice/2.1/vision_voicexml-2.1.dtd'>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form id="form1">
<block name="block1">
<log expr="'Entered block1'" label="LOG-1"/>
<prompt>Currently in block one</prompt>
<goto nextitem="block2"/>
</block>
<block name="block2">
<log expr="'Entered block2'" label="LOG-2"/>
<prompt>Now in block two</prompt>
<goto next="#form2"/>
</block>
</form>
<form id="form2">
<block name="block3">
<var name="x" expr="28"/>
<log label="LOG-3" expr="'Entered block3'">
Variable x has value: <value expr="x"/>
</log>
<prompt>Now in form two</prompt>
</block>
</form>
</vxml>
<mark>
Places a marker into a text or element sequence.
Syntax
<mark
name = "CDATA"
nameexpr = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
name
CDATA
no
NA
Name associated with this mark.
nameexpr
CDATA
no
NA
ECMAScript expression that
evaluates to the mark name.
Details
Although the VoiceXML Interpreter supports this element, it does not currently support mark
notifications, so the lastresult$.markname and lastresult$.marktime variables (and the
corresponding form item variables) are never set.
63
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Parents
<audio>, <choice>, <emphasis>, <enumerate>, <p>, <prompt>, <prosody>, <s>,
<voice>
Children
None.
Example
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<var name="played_ad" expr="false"/>
<form>
<field name="jacket">
<prompt>
<mark name="order_start"/>
Fleece jackets are available in a wide array of colors,
including red, green, purple, brown, blue, and black. You
won't find a better price.
<mark name="order_end"/>
<break time="500ms"/>
Say the name of the color you want to view.
For example, say purple.
</prompt>
<grammar type="application/srgs+xml" src="jackets.grxml"/>
<filled>
<if cond="typeof(jacket$.markname) == 'string' &amp;&amp;
(jacket$.markname=='order_end' ||
(jacket$.markname=='order_start' &amp;&amp;
jacket$.marktime &gt;= 5000))">
<assign jacket="played_order" expr="true"/>
<else/>
<assign jacket="played_order" expr="false"/>
</if>
</filled>
</field>
</form>
</vxml>
<media>
Plays the media file at the specified location.
Syntax
<media
src = "URI"
expr = "CDATA"
fetchhint = "{prefetch | safe}"
fetchtimeout = "CDATA"
maxage = "CDATA"
maxstale = "CDATA"
offset = "CDATA"
offsetexpr = "CDATA"
type = "CDATA"
/>
64
Alphabetical VoiceXML Reference
Attributes
Attribute
Data Type
Required?
Default
Description
expr
CDATA
no
NA
ECMAScript expression that
evaluates to the URI
(location) of the media file.
Programmable Media
Platform proprietary. Use the
v_ovl_def parameter
following the media file to
specify:
fetchhint
{prefetch |
safe}
no
NA

a URI (in http:// or
file:/// format) to an
XML file that defines a
text overlay or image
overlay.

an XML string that
defines a text overlay
or image overlay
inline.
Specifies when the VoiceXML
Interpreter context should
retrieve content from the
server. Valid values:

prefetch = Fetch the
resource when the
page is loaded.

safe = Fetch the
resource when it is
specifically called by
the application.
fetchtimeout
CDATA
no
NA
Time interval to wait for the
content to be returned before
throwing an error.badfetch
event. Use s for seconds (for
example, 1s) and ms for
milliseconds (for example,
1ms).
maxage
CDATA
no
NA
Maximum acceptable age, in
seconds, of a resource being
fetched from the cache.
Setting maxage to 0 means
that a cached version is
never considered fresh.
65
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
maxstale
CDATA
no
NA
Maximum acceptable
staleness, in seconds, of the
resource being fetched, if the
fetched resource is cached
and expired.
offset
CDATA
no
NA
The offset (in s or ms) at
which to play the media file.
This attribute is supported
for:

HTTP or local files that
reference a 3GP file

HTTP or local audioonly files

Audio-only files
streamed by an RTSP
server

3GP files streamed by
an RTSP server
The behavior of the offset
attribute for HTTP or local
files that reference a 3GP file
differs, depending on the
presence of a sync point
table and a matching Iframe. For information, see
the Details.
Note: The offset attribute is
not supported for live RTSP
presentations.
offsetexpr
CDATA
no
NA
ECMAScript expression that
evaluates to the offset. This
can be used in conjunction
with the
lastresult$.bargeintime
variable to let the application
play a media file from the
point at which the user
barged in, and not have to
start from the beginning
again. This attribute is
especially useful for long
media files.
66
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
src
CDATA
no
NA
URI of the media file. Use the
v_ovl_def parameter
following the media file to
specify:
type
CDATA
no
NA

a URI (in http:// or
file:/// format) to an
XML file that defines a
text overlay or image
overlay.

an XML string that
defines a text overlay
or image overlay
inline.
Preferred media type of the
requested resource. This can
differ from the actual media
type of the resource. The
VoiceXML Interpreter
currently ignores this
attribute, determining the
media type during HTTP
content negotiation or
content introspection.
Details
This element can be used with the <par> element to provide parallel playback of different
media types.
In this implementation, the <audio> and <media> elements are completely equivalent,
with the exception that <media> can specify a type of application/ssml+xml, omitting the
src and expr attributes and enclosing a complete SSML document as its child content. This
content is not treated as alternate content.
The behavior of the offset attribute works as follows for HTTP or local files that reference
3GP files:
If the Referenced 3GP
File...
And...
Then the VoiceXML
Interpreter...
Contains a sync point
table.
There is an I-frame that
corresponds to the specified
offset.
Plays the file from that Iframe.
The specified offset does
not match an I-frame.
Plays the file from the next
I-frame after the specified
offset.
67
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
If the Referenced 3GP
File...
Does not contain a sync
point table.
And...
Then the VoiceXML
Interpreter...
There is no next I-frame.
Does not play the file.
NA
Ignores the offset attribute
and plays the file from the
beginning.
Parents
<audio>, <block>, <catch>, <choice>, <enumerate>, <error>, <field>, <filled>,
<foreach>, <help>, <if>, <initial>, <media>, <menu>, <noinput>, <nomatch>,
<object>, <prompt>, <record>, <subdialog>, <transfer>
Children
<audio>, <break>, <desc>, <emphasis>, <enumerate>, <p>, <mark>, <media>,
<phoneme>, <s>, <prosody>, <say-as>, <speak>, <sub>, <value>, <voice>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<var name="num_messages" expr="3"/>
<form>
<block>
<prompt>
<par>
<media src="rtsp://example.org/avatar.3gp"/> <!-- Video only -->
<media type="application/ssml+xml">
<speak version="1.0" xml:lang="en-GB">
Welcome to your Video Mail account!
You have <value expr="num_messages"/> messages.
</speak>
</media>
</par>
</prompt>
</block>
</form>
</vxml>
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<prompt>
<media type=”video/3gpp” src=”http://www.example.com/generator”/>
</prompt>
</block>
</form>
</vxml>
See Also
<audio>, <par>, <prompt>
<menu>
Allows the user to specify a choice from a list of options.
68
Alphabetical VoiceXML Reference
Syntax
<menu
accept = "{exact | approximate}"
dtmf = "{true | false}"
id = "identifier"
scope = "{document | dialog}"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
accept
{exact |
approximate}
no
exact
Determines how a choice
phrase is activated. Valid
values:

exact = Utterances
must match the
entire choice phrase
to activate the
choice.

approximate =
Utterances can match
a sub-phrase of the
choice phrase to
activate the choice.
Each choice can override
this setting.
dtmf
id
boolean
identifier
no
no
no
NA
Assigns implicit DTMF
elements to the choices
contained in the menu. Valid
values:

true = Assigns
implicit DTMF
elements to any
<choice> element
that does not specify
a DTMF element.

false = Does not
assign implicit DTMF
elements to
<choice> elements.
Unique name of the menu.
This facilitates the transfer
of control from dialog to
dialog.
69
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
scope
{document |
dialog}
no
dialog
Scope for the grammar
contained in the menu. Valid
values:

document =
Grammar is active
throughout the
current document.

dialog = Grammar is
active only in the
current menu.
Parents
<vxml>
Children
<audio>, <catch>, <choice>, <enumerate>, <error>, <help>, <noinput>, <nomatch>,
<prompt>, <property>, <script>, <value>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<catch event="quitEvent">
Goodbye
<exit/>
</catch>
<!-With dtmf="true", the DTMF sequence for each
choice will be assigned automatically: 1, 2 and 3
-->
<menu id="main" dtmf="true">
<prompt>What do you want to eat, apple or orange?</prompt>
<choice next="#formApple"> apple </choice>
<choice expr="'#' + 'formOrange'"> orange </choice>
<choice event="quitEvent"> quit </choice>
<nomatch>Please say one of <enumerate/></nomatch>
</menu>
<form id="formApple">
<block>
You chose apple
<exit/>
</block>
</form>
<form id="formOrange">
<block>
You chose orange
<exit/>
</block>
</form>
</vxml>
See Also
<choice>, <form>
<meta>
Specifies meta information about the current VoiceXML, SRGS XML, or SSML document.
70
Alphabetical VoiceXML Reference
Syntax
<meta
content = "CDATA"
name = "identifier"
http-equiv = "identifier"
/>
Attributes
None of the <meta> attributes are required.
Attribute
Data Type
Required?
Default
Description
content
CDATA
yes
NA
Value of the metadata property.
http-equiv
identifier
no
NA
Name of the metadata property.
name
identifier
no
NA
Name of an HTTP response
header.
Parents
<vxml>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<meta name="author" content=""/>
<meta name="maintainer" content=""/>
<form>
<block>
<prompt>A simple vxml test</prompt>
</block>
</form>
</vxml>
<metadata>
Container in which information about the current VoiceXML, SRGS XML, or SSML document
is placed, using a metadata schema.
Syntax
<metadata/>
Attributes
None.
Parents
<grammar>, <prompt>, <vxml>
Children
None.
71
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Example
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/vxml
http://www.w3.org/TR/voicexml20/vxml.xsd">
<metadata>
<rdf:RDF
xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs = "http://www.w3.org/TR/1999/PR-rdf-schema-19990303#"
xmlns:dc = "http://purl.org/metadata/dublin_core#">
<!-- Metadata about the VoiceXML document -->
<rdf:Description about="http://www.example.com/meta.vxml"
dc:Title="Directory Enquiry Service"
dc:Description="Directory Enquiry Service for London in VoiceXML"
dc:Publisher="W3C"
dc:Language="en"
dc:Date="2002-02-12"
dc:Rights="Copyright 2002 John Smith"
dc:Format="application/voicexml+xml" >
<dc:Creator>
<rdf:Seq ID="CreatorsAlphabeticalBySurname">
<rdf:li>Jackie Crystal</rdf:li>
<rdf:li>William Lee</rdf:li>
</rdf:Seq>
</dc:Creator>
</rdf:Description>
</rdf:RDF>
</metadata>
<form>
<block>
<prompt>Hello</prompt>
</block>
</form>
</vxml>
<noinput>
Catches the noinput event.
Syntax
<noinput
cond = "CDATA"
count = "integer"
/>
72
Alphabetical VoiceXML Reference
Attributes
Attribute
Data Type
Required?
Default
Description
cond
CDATA
no
NA
Boolean expression that must
evaluate to ECMAScript true for
the <noinput> element to
execute.
count
integer
no
NA
Numerical occurrence of the
noinput event, such as 2 for the
second occurrence. This allows
the application to handle different
occurrences of the noinput event
in different ways.
Details
This element is shorthand for <catch event="noinput">.
Parents
<field>, <form>, <initial>, <menu>, <object>, <record>, <subdialog>, <transfer>,
<vxml>
Children
<audio>, <assign>, <clear>, <data>, <disconnect>, <enumerate>, <exit>, <foreach>,
<goto>, <if>, <log>, <prompt>, <reprompt>, <return>, <script>, <submit>, <throw>,
<value>, <var>
Example
<?xml version="1.0"?>
<!DOCTYPE vxml PUBLIC '-//Vision/DTD VoiceXML 2.1//EN'
'http://dtd.vision.com/voice/2.1/vision_voicexml-2.1.dtd'>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form id="creditCard">
<field name="cardtype">
<prompt>Which credit card type ?</prompt>
<grammar type="application/srgs+xml" root="cardtype">
<rule id="cardtype">
<one-of>
<item>american express <tag>amex</tag></item>
<item>master card <tag>mc</tag></item>
<item>visa <tag>visa</tag></item>
</one-of>
</rule>
</grammar>
<noinput count="1">
Sorry I didn't hear you
<reprompt/>
</noinput>
<noinput count="2">
Sorry still didn't hear you
<reprompt/>
</noinput>
<nomatch count="1">
<prompt>
Sorry I didn't understand please repeat the card type
</prompt>
</nomatch>
73
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
<nomatch count="2">
<prompt>
I still don't understand please select either american
express or master card or visa
</prompt>
</nomatch>
<filled namelist="cardtype">
<prompt>
You selected <value expr="cardtype"/>
</prompt>
</filled>
</field>
</form>
</vxml>
See Also
<catch>
<nomatch>
Catches the nomatch event.
Syntax
<nomatch
cond = "CDATA"
count = "integer"
/>
Attributes
Attribute
Data Type
Default
Description
cond
CDATA
NA
Boolean expression that must evaluate to
ECMAScript true for the <nomatch> element
to execute.
count
integer
NA
Numerical occurrence of the nomatch event,
such as 2 for the second occurrence. This
allows you to handle different occurrences of
the nomatch event in different ways.
Details
This element is shorthand for <catch event="nomatch">
Parents
<field>, <form>, <initial>, <menu>, <object>, <record>, <subdialog>, <transfer>,
<vxml>
Children
<audio>, <assign>, <clear>, <data>, <disconnect>, <enumerate>, <exit>, <foreach>,
<goto>, <if>, <log>, <prompt>, <reprompt>, <return>, <script>, <submit>, <throw>,
<value>, <var>
74
Alphabetical VoiceXML Reference
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form id="creditCard">
<field name="cardtype">
<prompt>Which credit card type ?</prompt>
<grammar type="application/srgs+xml" root="cardtype">
<rule id="cardtype">
<one-of>
<item>american express <tag>amex</tag></item>
<item>master card <tag>mc</tag></item>
<item>visa <tag>visa</tag></item>
</one-of>
</rule>
</grammar>
<noinput count="1">
Sorry I didn't hear you
<reprompt/>
</noinput>
<noinput count="2">
Sorry still didn't hear you
<reprompt/>
</noinput>
<nomatch count="1">
<prompt>
Sorry I didn't understand please repeat the card type
</prompt>
</nomatch>
<nomatch count="2">
<prompt>
I still don't understand please select either american express
or master card or visa
</prompt>
</nomatch>
<filled namelist="cardtype">
<prompt>
You selected <value expr="cardtype"/>
</prompt>
</filled>
</field>
</form>
</vxml>
See Also
<catch>
<object>
Invokes a platform-specific object.
75
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Syntax
<object
archive = "CDATA"
classid = "CDATA"
codebase = "CDATA"
codetype = "CDATA"
cond = "CDATA"
data = "CDATA"
expr = "CDATA"
fetchaudio = "URI"
fetchhint = "{prefetch | safe}"
fetchtimeout = "CDATA"
name = "identifier"
type = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
archive
CDATA
no
NA
Currently not supported.
classid
CDATA
no
NA
URI specifying the location
of the object's
implementation.
codebase
CDATA
no
NA
Currently not supported.
codetype
CDATA
no
NA
Currently not supported.
cond
CDATA
no
NA
Boolean expression that
must evaluate to
ECMAScript true for the
<object> element to
execute.
data
CDATA
no
NA
Currently not supported.
expr
CDATA
no
NA
Initial value of the form
item variable.
fetchaudio
URI
no
NA
Currently not supported.
fetchhint
{prefetch |
safe}
no
NA
Currently not supported.
fetchtimeout
CDATA
no
NA
Currently not supported.
76
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
name
identifier
no
ECMAScript
undefined
Name of the object
variable. This must be a
legal ECMAScript identifier.
type
CDATA
no
NA
Currently not supported.
Parents
<form>
Children
<audio>, <catch>, <enumerate>, <error> , <filled>, <noinput>, <help>, <nomatch>,
<param>, <prompt>, <property>, <value>
Example
<?xml version="1.0" encoding="utf-8"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml" xml:lang="en-GB">
<form id="playDTMF">
<object name="objDtmf1" classid="com.vision.DtmfGenerator">
<param name="dtmfstring" value="1"/>
</object>
</form>
</vxml>
See Also
<form>, <param>
<one-of>
Enables the grammar to be constructed with a series of alternate phrases or rule
expansions, each of which is contained within an <item> element.
Syntax
<one-of
xml:lang = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
xml:lang
CDATA
no
NA
Language used in the grammar
token, conforming to RFC 3066.
Details
The <one-of> element specifies a disjunction in an SRGS XML grammar, allowing the
grammar to specify a list of alternatives using multiple <item> elements.
Parents
<item>, <rule>
77
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Children
<item>
Example
<grammar xmlns="http://www.w3.org/2001/06/grammar"
xml:lang="en-GB" root="rule1">
<rule id="rule1" scope="public">
<one-of>
<item>
irish
<tag><field1 "irish"></tag>
</item>
<item>
english
<tag><field1 "english"></tag>
</item>
</one-of>
</rule>
</grammar>
<option>
Generates a grammar for a simple response to field options.
Syntax
<option
accept = "{exact | approximate}"
dtmf = "CDATA"
value = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
accept
{approximate |
exact}
no
exact
Determines how the option is
activated. Valid values:

approximate =
Utterance must match
a sub-phrase to
activate this option.

exact = Utterance must
match the entire choice
phrase to activate this
option.
dtmf
CDATA
no
NA
DTMF sequence for this option.
value
CDATA
no
NA
String to assign to the field
item variable when a user
selects this option by speech
or DTMF.
78
Alphabetical VoiceXML Reference
Details
If the dtmf attribute is unspecified, the option cannot be matched using DTMF.
If the value attribute is unspecified, the VoiceXML Interpreter assigns default data to the
option as follows:

Uses the CDATA content of the <option> element with leading and trailing white
space removed.

If CDATA content does not exist, then the VoiceXML Interpreter uses the DTMF
sequence.

If neither the CDATA content nor a DTMF sequence is specified, then the default
assignment is undefined and the field's form item variable is not filled.
Parents
<field>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<meta name="author" content=""/>
<meta name="maintainer" content=""/>
<form id="options">
<catch event="nomatch noinput">
<prompt> Please select an option. </prompt>
<reprompt/>
</catch>
<field name="myOption">
<prompt>
Please select from the following list: <enumerate/>
</prompt>
<option value="inquiry"> billing inquiry </option>
<option value="statement"> last statement </option>
<option value="balance"> current balance </option>
<option value="support"> customer support </option>
<filled>
<prompt>You chose <value expr="myOption"/> </prompt>
</filled>
</field>
</form>
</vxml>
See Also
<choice>, <field>
<overlay>
Creates a text overlay or image overlay for a video stream.
79
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Syntax
<overlay
template = "string"
position = "X<int>Y<int>"
size = "X<int>Y<int>"
delay = "seconds"
layer = "positive int"
borderwidth = "positive int"
bordercolor = "string"
timeout = "seconds"
bgcolor = "string"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
bgcolor
string or
integer
no
transparent
Background color of the
overlay area. Values are: red,
blue, green, yellow, magenta,
cyan, white, black,
transparent or an unsigned
integer. If a color
enumeration is used, the
color will be opaque.
If an integer is specified, use
the format 0xRRGGBBTT,
where RR is a 2-digit
hexadecimal value for the red
component, GG is for the
green component, BB is for
the blue component, and TT
is the value for the
transparency component.
Transparent can be used as a
color or specified in the TT of
the bitmask.
80
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
bordercolor
string or
integer
no
black
Border color of the overlay
area. Values are: red, blue,
green, yellow, magenta,
cyan, white, black,
transparent or an unsigned
integer. If a color
enumeration is used, the
color will be opaque.
If an integer is specified, use
the format 0xRRGGBBTT,
where RR is a 2-digit
hexadecimal value for the red
component, GG is for the
green component, BB is for
the blue component, and TT
is the value for the
transparency component.
Transparent can be used as a
color or specified in the TT of
the bitmask.
borderwidth
positive
integer
no
0
Border width of the overlay
area given in pixels.
delay
integer
no
0
Delays the start of the
overlay until a specified
number of seconds has
passed from the start of the
video stream.
layer
positive
integer
no
0
The order in which overlays
are displayed when multiple
overlays are specified. An
overlay with a higher number
(such as 5) is displayed on
top of an overlay with a lower
number (such as 4). When
using multiple overlays, be
careful that the overlays do
not overlap and render the
text unreadable. By default,
the same layer value is used
for all overlays.
81
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
position
integer
yes
[none]
The X coordinate and Y
coordinate of the upper lefthand corner of the overlay
area, given as a percentage
of the background video
frame.
size
integer
yes
[none]
The height (X coordinate) and
width (Y coordinate) of the
overlay area, given as a
percentage of the background
video frame.
template
string
no
[none]
URI (in http:// or file:///
format) to an XML file that
defines a text overlay or
image overlay.
timeout
positive
integer
no
0
Stops displaying the overlay
after a specified number of
seconds has passed from the
start of the video stream. A
value of 0 means that no
timeout will occur.
Parents
<overlaydescription>
Children
<content>
<overlaydescription>
Used for text overlay and image overlay. Contains multiple overlays as its children.
Syntax
<overlaydescription/>
Details
For more information on text overlay and image overlay, see <overlay>.
Parent
None.
Children
<overlay>, <overlaytemplate>
82
Alphabetical VoiceXML Reference
<overlaytemplate>
Describes an overlay template that contains common attributes shared by multiple overlays.
Syntax
<overlaytemplate
template = "string"
position = "X<int>Y<int>"
size = "X<int>Y<int>"
delay = "seconds"
layer = "positive int"
borderwidth = "positive int"
bordercolor = "string"
timeout = "seconds"
bgcolor = "string"
/>
Attributes
The same attributes are supported as for <overlay>, except that the template attribute is
required for <overlaytemplate>.
Details
The overlay template is defined in an XML file. Each XML file must contain only one template
definition.
Once a template is defined, you can refer to it in the template attribute of <overlay>. If the
template attribute is specified in both <overlay> and <overlaytemplate>, the attribute in
<overlay> overrides the one in <overlaytemplate>.
For more information on text overlay and image overlay, see <overlay>.
Parents
<overlaydescription>
Children
<content>
<p>
Identifies the enclosed text as a paragraph containing zero or more sentences.
Syntax
<p
xml:lang = "CDATA"
/>
83
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attributes
Attribute
Data Type
Required?
Default
Description
xml:lang
CDATA
no
NA
RFC 1766 compliant identifier
used to locate the text-to-speech
(TTS) engine that will render the
enclosed text.
Parents
<audio>, <enumerate>, <prosody>, <prompt>, <voice>
Children
<audio>, <break>, <emphasis>, <enumerate>, <mark>, <phoneme>, <prosody>, <s>,
<say-as>, <sub>, <value>, <voice>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<prompt>
<p>
<s>This is the first sentence of the paragraph.</s>
<s>Here's another sentence.</s>
</p>
</prompt>
</block>
</form>
</vxml>
See Also
<s>
<par>
With the <media> element, provides parallel playback of separate media sources of
differing types.
Syntax
<par></par>
Attributes
None.
Details
The <par> element, allows simultaneous playback of multiple media resources during a
video call. In this implementation, you can simultaneously play back a single audio and a
single video stream from separate sources.
Specify the media streams using child <media> elements. Exactly two such elements must
be specified: one specifying an audio-only source and the other specifying a video-only
source. If one of the elements references an audio-video source, playback does not occur.
84
Alphabetical VoiceXML Reference
For the audio source, the <media> element can either:

Reference an external source using the src or expr attribute, or

Enclose the audio in an inline SSML document by specifying a type of
application/ssml+xml.
For the media source, the <media> element must reference an external source using the
src or expr attribute.
If one of the sources cannot be played (for example, because of an error fetching a file), the
other is still rendered. If a <par> element executes while in a voice call, only the audio
stream plays.
The following restrictions apply to the use of <par>:

Exactly two <media> elements must be specified. If this condition is violated, an
error.semantic is raised.

A <prompt> element containing <par> cannot contain any other child elements. To
queue audio before or after the parallel playback, place the audio in a separate
<prompt> element. A <prompt> element must be either parallel or sequential, and
not a combination of both.

In the current implementation it is not possible to reference more than one
consecutive audio or video source in a single <media> element during parallel
playback. For example, if the audio <media> element contains inline SSML that uses
text-to-speech, that SSML cannot also contain an <audio> or <media> element
referencing an external source. The <seq> element is not currently supported.

The <property> element is currently not supported when it is used as a child of
<par>.

Since the Programmable Media Platform must synchronize the start of audio and
video playback, it is recommended that the real-time streaming protocol (RTSP) be
used when playing back files longer than one minute. If an HTTP or local file is
referenced, a large amount of audio data might need to be buffered while waiting for
the video stream, or vice-versa. This degrades performance, and in the case of very
long files, may prevent playback from succeeding at all.
Parents
<prompt>
Children
<audio>, <media>, <property>
85
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Examples
The following example shows how the <par> element can use the src attribute of the
<media> element to reference an audio source and a video source:
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<prompt>
<par>
<media src="http://example.org/video.3gp"/>
<media src="http://example.org/audio.3gp"/>
</par>
</prompt>
</block>
</form>
</vxml>
<!-- Video only -->
<!-- Audio only -->
The following example , shows how the <par > element can enclose an audio phrase an
inline SSML document. In this case, the <media> element must specify a type of
application/ssml+xml.
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<var name="num_messages" expr="3"/>
<form>
<block>
<prompt>
<par>
<media src="rtsp://example.org/avatar.3gp"/> <!-- Video only -->
<media type="application/ssml+xml">
<speak version="1.0" xml:lang="en-GB">
Welcome to your Video Mail account!
You have <value expr="num_messages"/> messages.
</speak>
</media>
</par>
</prompt>
</block>
</form>
</vxml>
See Also
<audio>, <media>, <prompt>
<param>
Specifies a parameter to pass to an object or subdialog.
Syntax
<param
expr = "CDATA"
name = "identifier"
type = "CDATA"
value = "CDATA"
valuetype = "{data | ref}"
/>
86
Alphabetical VoiceXML Reference
Attributes
Attribute
Data Type
Required?
Default
Description
expr
CDATA
no
ECMAScript
undefined
Expression that computes the
value associated with the name
attribute.
name
identifier
no
NA
Parameter name.
type
CDATA
no
NA
Currently not supported.
value
CDATA
no
NA
Literal string value associated
with the name attribute.
valuetype
CDATA
no
data
Currently not supported.
Parents
<object>, <subdialog>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<var name="defaultName"/>
<form>
<block>
Calling the sub dialog
<assign name="document.defaultName" expr="'Fred'"/>
</block>
<subdialog name="subResult" src="#mySubDialog">
<param name="firstName" expr="document.defaultName"/>
<param name="lastName" value="Smith"/>
</subdialog>
<block>
After the call to the sub dialog the name is
<value expr="subResult.firstName"/>
<value expr="subResult.lastName"/>
</block>
</form>
<form id="mySubDialog">
<var name="firstName" expr="'Billy'"/>
<var name="lastName"/>
<block>
In the sub dialog
<value expr="firstName"/>
<value expr="lastName"/>
<return namelist="firstName lastName"/>
</block>
</form>
</vxml>
<phoneme>
Phonetic pronunciation for the contained text.
87
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Syntax
<phoneme
alphabet = "CDATA"
ph = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
alphabet
CDATA
no
NA
Alphabet to use for the phonetic
string.
ph
CDATA
yes
NA
Phonetic string for the enclosed
text.
Parents
<audio>, <emphasis>, <enumerate>, <p>, <prompt>, <prosody>, <s>, <voice>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<prompt>
<phoneme alphabet="ipa" ph="t&#x252;m&#x251;to&#x28A;">
tomato
</phoneme>
</prompt>
</block>
</form>
</vxml>
See Also
<lexicon>, <prosody>, <say-as>, <voice>
<prompt>
Controls the output of text-to-speech (TTS) and audio sources.
Syntax
<prompt
bargein = "{true | false}"
bargeintype = "{speech | hotword}"
cond = "CDATA"
count = "integer"
timeout = "integer"
version = "CDATA"
xml:base = "CDATA"
xml:lang = "CDATA"
/>
88
Alphabetical VoiceXML Reference
Attributes
None of the <prompt> attributes are required.
Attribute
Data Type
Required?
Default
Description
bargein
boolean
no
yes
Indicates whether a user can
interrupt the prompt. This
attribute overrides a bargein
previously set with the
<property> element.
bargeintype
{speech |
hotword}
no
speech
Type of bargein that can
interrupt this prompt. This
attribute overrides a bargein
type previously set with the
<property> element.
cond
CDATA
no
NA
Boolean expression that must
evaluate to ECMAScript true
for the prompt to be played.
count
integer
no
1
A number that allows you to
emit different prompts if the
user does something
repeatedly.
timeout
integer
no
NA
Silence time, in seconds,
after which a noinput event is
raised. This attribute
overrides a timeout set
previously by the <property>
element.
version
CDATA
no
NA
Currently not supported.
xml:base
CDATA
no
NA
Currently not supported.
xml:lang
CDATA
no
NA
RFC 1766 compliant identifier
used to locate the text-tospeech (TTS) engine used to
render text prompts.
Details
SSML elements provide a hint as to how the enclosed text should be spoken. Whether or not
a certain element has an effect depends on the capabilities of the TTS engine currently in
use. In some cases, only certain attributes of an element have an effect, and even then, the
level of control may not be as high as is described in the specification.
For a list of elements and attributes supported by the current set of TTS engines, see SSML
Support.
89
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Parents
<block>, <catch>, <error>, <help>, <field>, <filled>, <foreach>, <help>, <if>,
<menu>, <initial>, <noinput>, <nomatch>, <object>, <record>, <subdialog>,
<transfer>
Children
<audio>, <break>, <emphasis>, <enumerate>, <lexicon>, <mark>, <meta>,
<metadata>, <p>, <foreach>, <par>, <phoneme>, <prosody>, <s>, <say-as>, <sub>,
<value>, <voice>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form id="french">
<block>
<prompt xml:lang="fr-FR">
bonjour, bienvenue au service vocal.
</prompt>
<goto next="#english"/>
</block>
</form>
<form id="english">
<block>
<prompt xml:lang="en-GB">
hello, welcome to the voice portal.
</prompt>
<goto next="#spanish"/>
</block>
</form>
<form id="spanish">
<block>
<prompt xml:lang="es-ES">
buenos días, bienvenida sobre el servicio vocal.
</prompt>
</block>
</form>
</vxml>
See Also
<audio>, <par>
<property>
Sets a property value.
Syntax
<property
name = "identifier"
value = "CDATA"
/>
90
Alphabetical VoiceXML Reference
Attributes
Attribute
Data Type
Required?
Default
Description
name
identifier
yes
NA
Name of the property to set.
value
CDATA
yes
NA
Value to assign to the property.
Details
Properties control platform behavior, including caching, timeouts, and so forth. For a list of
supported properties, see Application Properties.
Parents
<field>, <form>, <initial>, <menu>, <object>, <record>, <subdialog>, <transfer>,
<vxml>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<property name="audiomaxage" value="0"/>
<property name="audiofetchhint" value="safe"/>
<property name="confidence" value="0.75"/>
<property name="bargein" value="true"/>
<form id="weather_info">
<grammar src="../../grammar/weatherService.grxml"/>
<block>
<prompt bargein="false">
Welcome to the weather information service.
Barge in is enabled but not here
</prompt>
</block>
<initial name="start">
<property name="timeout" value="5s"/>
<prompt>
For what city and country would you like the weather?
</prompt>
<help>
Please say the name of the city and country
for which you would like a weather report.
</help>
</initial>
<field name="country">
<prompt>What country?</prompt>
<help>
Please speak the country for which you want the weather.
</help>
</field>
<field name="city">
<prompt>
Please say the city in <value expr="country"/>
for which you want the weather.
</prompt>
<help>
Please speak the city for which you want the weather.
</help>
</field>
<field name="go_ahead" type="boolean" modal="true">
<prompt>
91
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Do you want to hear the weather
for <value expr="city$.utterance"/>
in <value expr="country$.utterance"/>
</prompt>
<filled>
<if cond="go_ahead">
<!-- Servlet example, does not exist -->
<submit next="/servlet/weather" method="post"
namelist="city country" fetchtimeout="45s" />
</if>
<clear namelist="start city country go_ahead"/>
</filled>
</field>
</form>
</vxml>
weatherService.grxml:
<?xml version="1.0"?>
<grammar version="1.0" root="weatherservice"
xmlns="http://www.w3.org/2001/06/grammar"
xml:lang="en-gb">
<rule id="weatherservice">
<one-of>
<item>dublin <tag>dublin</tag></item>
<item>cork <tag>cork</tag></item>
<item>amsterdam <tag>amsterdam</tag></item>
</one-of>
</rule>
</grammar>
<prosody>
Specifies the pitch, duration, speaking rate, and volume for the enclosed speech output.
Syntax
<prosody
contour = "CDATA"
duration = "CDATA"
pitch = "CDATA"
range = "CDATA"
rate = "CDATA"
volume = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
contour
CDATA
no
NA
Pitch contour of the speech
output, formatted as a value
pair:

The first value is a
percentage of the period
of the contained text (a
number followed by %).

The second value is the
value of the pitch
attribute.
92
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
duration
CDATA
no
NA
Time duration for reading the
speech output, in seconds (s) or
milliseconds (ms). For example,
5s or 3500ms.
pitch
CDATA
no
NA
Level and intensity of the speech
output. Valid values:

A number followed by Hz.

A relative change, as
compared to the default
pitch.

One of the following
values: high, low,
medium, x-high, x-low,
default.
A relative change is expressed
using the plus sign (+) or minus
sign (-), followed by Hz (hertz)
or st (semitones). It can also be
expressed as a percentage
change preceded by an optional
+ or -. The TTS engine
determines the default pitch.
range
CDATA
no
NA
Pitch range of the speech output.
Valid values:

A number followed by Hz,
where higher values
increase the pitch range.

A relative change, as
compared to the default
range.

One of the following
values: high, low,
medium, x-high, x-low,
default.
A relative change is expressed
using the plus sign (+) or minus
sign (-), followed by a number,
followed by Hz (hertz) or st
(semitones). It can also be
expressed as a percentage
change preceded by an optional
+ or -. The TTS engine
determines the default range.
93
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
rate
CDATA
no
NA
Speaking rate of the speech
output. Valid values:

A number followed by Hz.

A relative change, as
compared to the default
rate.

One of the following
values: high, low,
medium, x-high, x-low,
default.
A relative change is expressed as
a number that acts as a
multiplier of the default rate.
Thus, a value of 2 means the
rate should be twice the default
rate; a value of 0.5 means the
rate should be half the default
rate. The TTS engine determines
the default rate.
volume
CDATA
no
NA
Volume of the speech output.
Valid values:

A number between 0.0
and 100.0, where higher
values are louder.

A relative change, as
compared to the default
volume.

One of the following
values: x-loud, loud,
medium, soft, x-soft,
silent, default.
A relative change is expressed
using the plus sign (+) or minus
sign (-), followed by a number.
It can also be expressed as a
percentage change preceded by
an optional + or -. The TTS
engine determines the default
volume.
Parents
<audio>, <emphasis>, <enumerate>, <p>, <prompt>, <prosody>, <s>, <voice>
94
Alphabetical VoiceXML Reference
Children
<audio>, <break>, <emphasis>, <enumerate>, <mark>, <p>, <phoneme>, <prosody>,
<s>, <say-as>, <sub>, <value>, <voice>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<prompt>
The price of XYZ is
<prosody volume="loud" rate="0.5">
<say-as interpret-as="vxml:currency">$45</say-as>
</prosody>
</prompt>
</block>
</form>
</vxml>
See Also
<emphasis>, <say-as>, <voice>
<record>
An input item that collects media input and stores the recording in the form item variable.
Syntax
<record
beep = "{true | false}"
cond = "CDATA"
dtmfterm = {true | false}
expr = "CDATA"
finalsilence = "CDATA"
maxtime = "CDATA"
modal = "{true | false}"
name = identifier
type = "CDATA"
vision:bgsrc = "CDATA"
vision:bgexpr = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
beep
boolean
no
no
Indicates whether to emit a
tone prior to recording. Valid
values:

true = Emit a tone.

false = Do not emit a
tone.
95
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
cond
CDATA
no
NA
Specifies a Boolean
expression that must
evaluate to ECMAScript true
for the record to execute.
dtmfterm
boolean
no
yes
Indicates whether to
terminate the recording with
a DTMF key press. Valid
values:

true = Terminate the
recording with a DTMF
key press.

false = Do not
terminate the
recording with a DTMF
key press.
Note: Associated tones, if
any, are not part of the
recording.
expr
CDATA
no
NA
Initial value for the form item
variable.
finalsilence
integer
no
NA
Length of the silence that
indicates the end of the
recording, in seconds (s) or
milliseconds (ms).
maxtime
CDATA
no
NA
Maximum length of the
recording, in seconds (s) or
milliseconds (ms).
modal
boolean
no
NA
Not currently supported.
name
identifier
no
NA
Name of the input item
variable that holds the
recording.
96
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
type
CDATA
no
NA
Media format of the resulting
recording. This can be one of
the audio file formats
specified by the VoiceXML
specification, or in the case
of a video call, can be a 3GP
container format. Valid
values:

audio/basic = Raw
(headerless) 8kHz 8bit mu-law PCM
(G.711).

audio/x-alaw-basic =
Raw (headerless)
8kHz 8-bit A-law PCM
(G.711).

audio/x-wav = WAV
(RIFF header) 8kHz 8bit PCM.

video/3gpp = 3GP
multimedia file.
Parents
<form>
Children
<audio>, <enumerate>, <help>, <catch>, <error>, <filled>, <grammar>, <noinput>,
<nomatch>, <prompt>, <property>, <value>
Example
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<record name="msg" beep="true" maxtime="10s" finalsilence="4000ms"
dtmfterm="true" type="audio/x-wav">
<prompt timeout="5s">
Record a message after the beep.
</prompt>
<noinput>
I didn't hear anything, please try again.
</noinput>
</record>
<field name="confirm">
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
<prompt>
Your message is <audio expr="msg"/>.
</prompt>
<prompt>
To keep it, say yes. To discard it, say no.
</prompt>
<filled>
<if cond="confirm">
<submit next="save_message.pl" enctype="multipart/form-data"
97
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
method="post" namelist="msg"/>
</if>
<clear/>
</filled>
</field>
</form>
</vxml>
See Also
<object>, <subdialog>
<reprompt>
After a catch is executed, causes normal prompt processing to occur (queuing and counter
increments) instead of suppressing prompt processing.
Syntax
<reprompt/>
Attributes
None.
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form id="creditCard">
<field name="cardtype">
<prompt>Which credit card type ?</prompt>
<grammar type="application/srgs+xml" root="cardtype">
<rule id="cardtype">
<one-of>
<item>american express <tag>amex</tag></item>
<item>master card <tag>mc</tag></item>
<item>visa <tag>visa</tag></item>
</one-of>
</rule>
</grammar>
<noinput count="1">
Sorry I didn't hear you
<reprompt/>
</noinput>
<noinput count="2">
Sorry still didn't hear you
<reprompt/>
</noinput>
<nomatch count="1">
<prompt>
Sorry I didn't understand please repeat the card type
</prompt>
</nomatch>
<nomatch count="2">
<prompt>
I still don't understand.
please select either american express or master card or visa
</prompt>
</nomatch>
98
Alphabetical VoiceXML Reference
<filled namelist="cardtype">
<prompt>
You selected <value expr="cardtype"/>
</prompt>
</filled>
</field>
</form>
</vxml>
<return>
Ends execution in a subdialog. Returns control and optionally, data, to the caller of the
subdialog.
Syntax
<return
event = "CDATA"
eventexpr = "CDATA"
message = "CDATA"
messageexpr = "CDATA"
namelist = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
event
CDATA
no
NA
Event to raise returning to
the caller.
eventexpr
CDATA
no
NA
ECMAScript expression that
evaluates to the event to
raise.
message
CDATA
no
NA
String that provides
additional information about
the raised event. The
message is available as the
ECMAScript variable
_message in the <catch>
element that handles the
event.
messageexpr
CDATA
no
NA
ECMAScript expression that
evaluates to the message.
namelist
CDATA
no
NA
Space-separated list of
variables to return to the
caller.
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>
99
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<var name="defaultName"/>
<form>
<block>
Calling the sub dialog
<assign name="document.defaultName" expr="'Fred'"/>
</block>
<subdialog name="subResult" src="#mySubDialog">
<param name="firstName" expr="document.defaultName"/>
<param name="lastName" value="Smith"/>
</subdialog>
<block>
After the call to the sub dialog the name is
<value expr="subResult.firstName"/>
<value expr="subResult.lastName"/>
</block>
</form>
<form id="mySubDialog">
<var name="firstName" expr="'Billy'"/>
<var name="lastName"/>
<block>
In the sub dialog
<value expr="firstName"/>
<value expr="lastName"/>
<return namelist="firstName lastName"/>
</block>
</form>
</vxml>
See Also
<subdialog>
<rule>
Defines the named rule expansion of an XML grammar.
Syntax
<rule
id = "identifier"
scope = "{private | public}"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
id
identifier
yes
NA
Identifier by which to reference
this rule.
scope
"{private |
public}"
no
private
Scope of the rule. Valid values:

private

public
100
Alphabetical VoiceXML Reference
Parents
<grammar>
Children
<example>, <item>, <one-of>, <ruleref>, <tag>, <token>
Example
<?xml version= "1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar"
xml:lang="en-GB" root="rule1">
<rule id="rule1" scope="public">
<one-of>
<item>irish</item>
</one-of>
</rule>
</grammar>
<ruleref>
Allows the specification of an existing rule for inclusion within the current grammar.
Syntax
<ruleref
special = "{NULL | VOID | GARBAGE}"
type = "CDATA"
uri = "URI"
lang-list = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
special
NULL|
VOID|
GARBAGE
no
NA
Currently there is only
support for tag-format of
type "Nuance".
type
CDATA
no
application/
srgs+xml
Type of the referenced rule.
Only application/srgs+xml is
supported.
uri
URI
no
NA
URI of the grammar to
reference.
xml:lang
CDATA
no
NA
Language used in the
referenced rule.
Parents
<item>, <rule>
Children
None.
101
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Example
<?xml version= "1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar"
xml:lang="en-GB" root="rule1">
<rule id="rule1">
<one-of>
<item>
<ruleref uri="http://myserver.com/"/>
</item>
</one-of>
</rule>
</grammar>
<s>
Identifies the enclosed text as a sentence.
Syntax
<s
xml:lang = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
xml:lang
CDATA
no
NA
RFC 1766 compliant identifier
used to locate the text-tospeech (TTS) engine that
renders the enclosed text.
Parents
<audio>, <enumerate>, <p>, <prompt>, <prosody>, <voice>
Children
<audio>, <break>, <emphasis>, <enumerate>, <mark>, <phoneme>, <prosody>, <sayas>, <sub>, <value>, <voice>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<var name="x" expr="12345"/>
<prompt>
<p>
<s>This is the first sentence of the paragraph.</s>
<s>Here's another sentence.</s>
</p>
</prompt>
</block>
</form>
</vxml>
See Also
<p>
102
Alphabetical VoiceXML Reference
<say-as>
Specifies how a word or phrase is spoken.
Syntax
<say-as
detail = "PCDATA"
format = "PCDATA"
interpret-as = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
detail
PCDATA
no
NA
Level of detail to read aloud or
render.
format
PCDATA
no
NA
Provides precise formatting
information for the contained
text for content types with
ambiguous formats.
interpret-as
CDATA
yes
NA
Style of a given text format.
Valid values:

letters = Pronounce
contained text as
individual characters.

vxml:digits = Speak
contained text as
digits. For example:
"one two three"
instead of "one
hundred and twenty
three".

vxml:number =
Contained text is a
number.

vxml:date = Contained
text is a date. Format
values for dates are
dmy, mdy, ymd, ym,
my, md, y.

vxml:time = Contained
text is a time of day.
Format values for time
are hm, and hms.
103
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description

vxml:currency =
Contained text is a
currency amount.

vxml:phone =
Contained text is a
telephone number.

vxml:boolean = Speak
contained text as an
affirmative or negative
phrase appropriate to
the current locale.
Parents
<audio>, <emphasis>, <enumerate>, <p>, <prompt>, <prosody>, <s>, <voice>
Children
<value>
Example
In the following example, the text that results from evaluating the expression is spoken in
the style specified by the enclosing <say-as> element.
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<var name="x" expr="12345"/>
<prompt>
date <say-as interpret-as="letters">RTE</say-as>
date <say-as interpret-as="vxml:date">2002-04-25</say-as>
digits <say-as interpret-as="vxml:digits"> <value expr="x"/></say-as>
number <say-as interpret-as="vxml:number">54321</say-as>
phone <say-as interpret-as="vxml:phone">123-456-7890</say-as>
currency <say-as interpret-as="vxml:currency">£123.56</say-as>
time <say-as interpret-as="vxml:time">20.16</say-as>
</prompt>
</block>
</form>
</vxml>
See Also
<emphasis>, <prosody>, <voice>
<scroll>
Specifies the characteristics of scrolling text in a text overlay. This is an optional element for
a text overlay. If the <scroll> element is not used, the text overlay will be static. This
element is not used for image overlays.
104
Alphabetical VoiceXML Reference
Syntax
<scroll
mode = "string"
speed = "positive int"
direction = "string"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
direction
string
no
left
Direction of scrolling. Values are:
left, right, up, down.
mode
string
yes
none
Mode of scrolling text. Values
are: content (scroll one time),
continuous (scroll continuously),
and none.
speed
positive
integer
no
25
Speed of scrolling in pixels per
second.
Details
For more information on text overlay and image overlay, see <overlay>.
Parents
<content>
<script>
Allows the specification of a block of client-side scripting language code.
Syntax
<script
charset = "CDATA"
fetchtimeout = "CDATA"
fetchhint = "{prefetch | safe}"
maxage = "CDATA"
maxstale = "CDATA"
src = "URI"
srcexpr = "CDATA"
/>
105
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attributes
Attribute
Data Type
Required?
Default
Description
charset
CDATA
no
NA
Character encoding of the
script designated by the src
attribute.
fetchtimeout
CDATA
no
NA
Time interval to wait for the
content to be returned before
throwing an error.badfetch
event. Use s for seconds (for
example, 1s) and ms for
milliseconds (for example,
1ms).
no
NA
Specifies when the VoiceXML
Interpreter context should
retrieve content from the
server. Valid values:
fetchhint

prefetch = Fetch the
resource when the page
is loaded.

safe = Fetch the
resource when it is
specifically called by the
application.
maxage
CDATA
no
NA
Maximum acceptable age, in
seconds, of a resource being
fetched from the cache. Setting
maxage to 0 means that a
cached version is never
considered fresh.
maxstale
CDATA
no
NA
Maximum acceptable staleness,
in seconds, of the resource
being fetched, if the fetched
resource is cached and expired.
src
URI
no
NA
URI of the script file.
srcexpr
CDATA
no
NA
ECMAScript expression that
evaluates to the URI of the
script file.
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <form>, <help>, <if>, <noinput>,
<nomatch>, <vxml>
106
Alphabetical VoiceXML Reference
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<script>
var
var
var
var
d = new
hours =
minutes
seconds
Date();
d.getHours();
= d.getMinutes();
= d.getSeconds();
</script>
<form>
<block>
The time is <value expr="hours"/> hours,
<value expr="minutes"/> minutes, and
<value expr="seconds"/> seconds.
</block>
</form>
</vxml>
See Also
<assign>, <var>
<speak>
Top-level element required in a standalone SSML document.
Syntax
<speak
version = "CDATA"
xml:base = "URI"
xml:lang = "CDATA"
xmlns = "CDATA"
xmlns:xsi = "CDATA"
xsi:schemalocation = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
version
CDATA
yes
NA
VoiceXML version.
xml:base
URI
no
NA
Base URI, used to
resolve relative URIs in
the document.
xml:lang
CDATA
no
NA
Language variant of
the document.
xmlns
CDATA
no
NA
Designated namespace
for VoiceXML.
107
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
xmlns:xsi
CDATA
no
NA
Used with the
xsi:schemalocation
attribute to indicate
the location of the
schema for the
VoiceXML namespace.
xsi:schemalocation
CDATA
no
NA
Used with the
xmlns:xsi attribute to
indicate the location of
the schema for the
VoiceXML namespace.
Details
In-line SSML fragments are permitted in VoiceXML 2.0 documents. In this case, the
<prompt> element is used in place of the <speak> element, allowing the same SSML child
elements and attributes, except xmlns, xmlns:xsi, and xsi:schemaLocation.
The <speak> element describes how the enclosed text should be spoken. Whether or not a
certain element has an effect depends on the capabilities of the TTS engine in use. In some
cases, only certain attributes of an element have an effect, and even then, the level of
control may not be as high as described in the specification.
For information about the elements and attributes supported by the current set of TTS
engines, see SSML Support.
Parents
None.
Children
<audio>, <break>, <emphasis>, <mark>, <phoneme>, <p>, <prosody>, <s>, <sayas>, <sub>, <voice>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<var name="num_messages" expr="3"/>
<form>
<block>
<media type="application/ssml+xml">
<speak version="1.0" xml:lang="en-GB">
Welcome to your Video Mail account!
You have <value expr="num_messages"/> messages.
</speak>
</media>
</block>
</form>
</vxml>
See Also
<prompt>
108
Alphabetical VoiceXML Reference
<sub>
Indicates that the specified text replaces the contained text for pronunciation. This allows a
document to contain both a spoken and written form.
Syntax
<sub
alias = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
alias
CDATA
yes
NA
String to substitute for the
enclosed string.
Parents
<audio>, <emphasis>, <enumerate>, <p>, <prompt>, <prosody>, <s>, <voice>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<var name="x" expr="12345"/>
<prompt>
<sub alias="Speech Synthesis Markup Language">SSML</sub>
</prompt>
</block>
</form>
</vxml>
See Also
<lexicon>
<subdialog>
Invokes a dialog in a new execution context. Control returns to the calling element after the
called subdialog executes a return.
Syntax
<subdialog
cond = "CDATA"
enctype = "CDATA"
expr = "CDATA"
fetchaudio = "URI"
fetchtimeout = "CDATA"
fetchhint = "{prefetch | safe}"
maxage = "CDATA"
maxstale = "CDATA"
109
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
/>
method = "{get | post}"
name = "identifier"
namelist = "list of identifiers"
src = "URI"
srcexpr = "CDATA"
Attributes
Attribute
Data Type
Required?
Default
Description
cond
CDATA
no
NA
Boolean expression that
must evaluate to
ECMAScript true for the
<subdialog> element to
execute.
enctype
CDATA
no
application
/x-wwwformurlencoded
MIME encoding type to use
when submitting data to the
application server while
fetching the subdialog. To
submit an audio file that
results from a record
operation, use
enctype="multipart/formdata".
expr
CDATA
no
NA
Initial value of the form item
variable.
fetchaudio
URI
no
NA
URI of an audio resource to
play while the XML data is
fetched. If the fetchaudio
attribute is not set, no audio
is played during the fetch. If
the audio is playing after the
XML document is fetched,
the audio terminates.
fetchhint
{prefetch |
safe}
no
NA
Specifies when the VoiceXML
Interpreter context should
retrieve content from the
server. Valid values:

prefetch = Fetch the
resource when the
page is loaded.

safe = Fetch the
resource when it is
specifically called by
the application.
110
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description
fetchtimeout
CDATA
no
NA
Time interval to wait for the
content to be returned
before raising an
error.badfetch event. Use s
for seconds (for example,
1s) and ms for milliseconds
(for example, 1ms).
maxage
CDATA
no
NA
Maximum acceptable age, in
seconds, of a resource being
fetched from the cache.
Setting maxage to 0 means
that a cached version is
never considered fresh.
maxstale
CDATA
no
NA
Maximum acceptable
staleness, in seconds, of the
resource being fetched, if
the fetched resource is
cached and expired.
method
{get |
post}
no
get
HTTP request method. Valid
values:

get = Execute an
HTTP get.

post = Execute an
HTTP post.
name
identifier
no
NA
Result returned from the
subdialog as an ECMAScript
object whose properties are
defined in the namelist
attribute of the <return>
element.
namelist
list of
identifiers
no
NA
Space-separated list of
variables sent to the
subdialog.
src
URI
no
NA
URI of the subdialog.
screxpr
CDATA
no
NA
ECMAScript expression that
evaluates to the URI of the
subdialog.
Parents
<form>
111
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Children
<audio>, <catch>, <enumerate>, <error>, <filled>, <help>, <noinput>, <nomatch>,
<param>, <prompt>, <property>, <value>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<var name="defaultName"/>
<form>
<block>
Calling the sub dialog
<assign name="document.defaultName" expr="'Fred'"/>
</block>
<subdialog name="subResult" src="#mySubDialog">
<param name="firstName" expr="document.defaultName"/>
<param name="lastName" value="Smith"/>
</subdialog>
<block>
After the call to the sub dialog the name is
<value expr="subResult.firstName"/>
<value expr="subResult.lastName"/>
</block>
</form>
<form id="mySubDialog">
<var name="firstName" expr="'Billy'"/>
<var name="lastName"/>
<block>
In the sub dialog
<value expr="firstName"/>
<value expr="lastName"/>
<return namelist="firstName lastName"/>
</block>
</form>
</vxml>
See Also
<form>, <return>
<submit>
Performs an HTTP GET or POST with optional variables.
Syntax
<submit
enctype = "CDATA"
expr = "CDATA"
fetchaudio = "URI"
fetchtimeout = "CDATA"
fetchhint = "{prefetch | safe}"
maxage = "CDATA"
maxstale = "CDATA"
method = "{get | post}"
namelist = "list of identifiers"
next = "URI"
/>
112
Alphabetical VoiceXML Reference
Attributes
Attribute
Data Type
Required?
Default
Description
enctype
CDATA
no
application
/x-wwwformurlencoded
MIME encoding type of the
submitted document. A
MIME type of
multipart/form-data must
be specified for uploading
to the server the audio file
that results from a record
operation.
expr
CDATA
no
NA
ECMAScript expression that
evaluates to the URI of the
HTTP request.
fetchaudio
URI
no
NA
URI of an audio resource to
play while the XML data is
fetched. If the fetchaudio
attribute is not set, no
audio is played during the
fetch. If the audio is playing
after the XML document is
fetched, the audio
terminates.
fetchhint
{prefetch |
safe}
no
NA
Specifies when the
VoiceXML Interpreter
context should retrieve
content from the server.
Valid values:
fetchtimeout
CDATA
no
NA

prefetch = Fetch the
resource when the
page is loaded.

safe = Fetch the
resource when it is
specifically called by
the application.
Time interval to wait for the
content to be returned
before throwing an
error.badfetch event. Use s
for seconds (for example,
1s) and ms for milliseconds
(for example, 1ms).
113
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
maxage
CDATA
no
NA
Maximum acceptable age,
in seconds, of a resource
being fetched from the
cache. Setting maxage to 0
means that a cached
version is never considered
fresh.
maxstale
CDATA
no
NA
Maximum acceptable
staleness, in seconds, of
the resource being fetched,
if the fetched resource is
cached and expired.
method
CDATA
no
get
HTTP request method. Valid
values:

get = Execute an
HTTP get.

post = Execute an
HTTP post.
namelist
list of
identifiers
no
NA
Space-separated list of
variables submitted. If no
namelist is specified, all
named input item variables
are submitted.
next
URI
no
NA
URI for the HTTP request.
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form id="weather_info">
<grammar src="../../grammar/weatherService.grxml" maxage="0"/>
<block>
<prompt bargein="false">
Welcome to the weather information service.
<audio src="http://www.online-ads.example/wis.wav"/>
Vox pilot develop anywhere deploy everywhere
</prompt>
</block>
<initial name="start">
<prompt>For what city and country would you like the weather?</prompt>
<help>Please say the name of the city and country for which you would
like a weather report. </help>
114
Alphabetical VoiceXML Reference
</initial>
<field name="country">
<prompt>What country?</prompt>
<help>Please speak the country for which you want the weather.</help>
</field>
<field name="city">
<prompt>Please say the city in <value expr="country"/> for which you want
the weather.</prompt>
<help>Please speak the city for which you want the weather.</help>
</field>
<field name="go_ahead" type="boolean" modal="true">
<prompt>
Do you want to hear the weather for <value expr="city"/> in
<value expr="country"/>
</prompt>
<filled>
<if cond="go_ahead">
<!-- Servlet example, does not exist -->
<submit next="/servlet/weather" method="post" namelist="city country"
fetchtimeout="45s" />
</if>
<clear namelist="start city country go_ahead"/>
</filled>
</field>
</form>
</vxml>
weatherService.grxml:
<?xml version="1.0"?>
<grammar version="1.0" root="weatherservice"
xmlns="http://www.w3.org/2001/06/grammar"
xml:lang="en-gb">
<rule id="weatherservice">
<one-of>
<item>dublin <tag>dublin</tag></item>
<item>cork <tag>cork</tag></item>
<item>amsterdam <tag>amsterdam</tag></item>
</one-of>
</rule>
</grammar>
See Also
<goto>
<tag>
Contains the semantic interpretation of spoken user input.
Syntax
<tag/>
Attributes
None.
Details
The format of the <tag> element content depends on the tag-format attribute in the
<grammar> element. For example, if the tag-format attribute is set to "semantics/1.0literals", then literal text tokens are used. Typically, different ASR engines have different
tag-formats. Refer to the ASR engine vendor documentation for more information.
Parents
None.
115
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Children
None.
Example
<grammar xmlns="http://www.w3.org/2001/06/grammar"
xml:lang="en-GB" root="ruleid" tag-format="semantics/1.0-literals">
<rule id="ruleid" scope="public">
<item>
ten
<tag>10/tag>
</item>
</rule>
</grammar>
<throw>
Raises a pre-defined or application-specific event.
Syntax
<throw
event = "identifier"
eventexpr = "CDATA"
message = "CDATA"
messageexpr = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
event
identifier
no
NA
Pre-defined or applicationspecific event to raise. The
raised event is available as
the ECMAScript variable
_event in the <catch>
element that handles the
event.
eventexpr
CDATA
no
NA
ECMAScript expression that
evaluates to the event to
raise.
message
CDATA
no
NA
String providing additional
information about the event
being raised. The message is
available as the ECMAScript
variable _message in the
<catch> element that
handles the event.
messageexpr
CDATA
no
NA
ECMAScript expression that
evaluates to the message.
116
Alphabetical VoiceXML Reference
Details
Use an event handler to catch the event. For information, see <catch>.
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<catch event="terminate">
Caught terminate
<goto next="#formExit"/>
</catch>
<help>
<audio src="../../ProjectName/audio/help.wav" maxage="0"/>
Help requested
<goto next="#formEntry"/>
</help>
<error>
Caught error
<goto next="#formExit"/>
</error>
<var name="bCondition" expr="false"/>
<form id="formEntry">
<catch event="customEvent">
Form scope custom handler
Throwing terminate
<throw event="terminate"/>
</catch>
<catch event="terminate" cond="bCondition">
This handler will not be executed due to the condition
</catch>
<block>
Throwing custom event
<throw event="customEvent"/>
</block>
</form>
<form id="formExit">
<block>
Goodbye
<exit/>
</block>
</form>
</vxml>
<token>
Defines a word or phrases that can be spoken by the caller in an XML grammar.
Syntax
<token
xml:lang = "CDATA"
/>
117
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attributes
Attribute
Data Type
Required?
Default
Description
xml:lang
CDATA
no
NA
Specifies the language used in
the grammar token, conforming
to RFC 1766.
Parents
<grammar>
Children
None.
Example
<?xml version= "1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar"
xml:lang="en-GB" root="ruleid">
<token>american express</token>
<token>master card</token>
<token>visa</token>
</grammar>
<transfer>
Transfers the call to the specified number.
Syntax
<transfer
aai = "CDATA"
aaiexpr = "CDATA"
bridge = "{true | false}"
cond = "CDATA"
connecttimeout = "CDATA"
dest = "URI"
destexpr = "CDATA"
expr = "CDATA"
maxtime = "CDATA"
name = "identifier"
transferaudio = "URI"
type = "{bridge | blind | consultation}"
/>
118
Alphabetical VoiceXML Reference
Attributes
Attribute
Data Type
Required?
Default
Description
aai
CDATA
no
NA
String containing applicationto-application (aai) data to
send to an application at the
far-end of the transfer.
aaiexpr
CDATA
no
NA
ECMAScript expression that
evaluates to the aai.
bridge
boolean
no
no
Determines whether the
platform stays in the
connection with the caller
and callee during and after
the transfer. Valid values:

true = Document
interpretation
suspends until the
transferred call
terminates.

false = Raises the
connection.disconnect
.transfer event.
cond
CDATA
no
NA
Boolean expression that
must evaluate to ECMAScript
true for the transfer to
execute.
connecttimeout
CDATA
no
NA
Time to wait for a connection
to be made before the
noanswer condition is
returned.
dest
URI
no
NA
URI of the transfer
destination.
destexpr
CDATA
no
NA
ECMAScript expression that
evaluates to the URI of the
transfer destination.
expr
CDATA
no
NA
Initial value of the form item
variable.
maxtime
CDATA
no
0
Maximum duration of the call
if bridge is true.
119
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attribute
Data Type
Required?
Default
Description
name
CDATA
no
NA
Stores the outcome of the
transfer. Valid values:

busy = Destination
refused the request.

noanswer =
connecttimeout
interval was exceeded
before a connection
occurred.

network_busy =
Transfer was refused
by an intermediary
network.

near_end_disconnect
= Transfer completed
and was terminated
by the caller.

far_end_disconnect =
Transfer completed
and was terminated
by the callee.

network_disconnect =
Transfer completed
and was terminated
by the network.

maxtime_disconnect
= Transfer reached
the maximum allowed
duration and was
terminated.

unknown = Transfer
ended for an unknown
reason.
The form item shadow
variable has the following
properties after the transfer
is completed (where mycall
is the form item variable
name):

mycall$.duration =
Duration of a
successful call, in
seconds.
120
Alphabetical VoiceXML Reference
Attribute
Data Type
Required?
Default
Description

mycall$.utterance =
User utterance, if the
transfer was
terminated by a
recognition.

mycall$.inputmode =
Input mode of the
utterance (DTMF or
voice), if the transfer
was terminated by a
recognition.
transferaudio
URI
no
NA
URI of an audio file to play
while attempting the
transfer. By default, the
audio used is a 2-tone (440
+ 480 Hz), 2-second on, 4second off sound. Only
single-channel, 8 bit, 8 kHz
audio files can be used for
transferaudio.
type
{bridge |
blind |
consultation
}
no
blind
Type of transfer to perform.
The <transfer> element can
have a bridge attribute or a
type attribute, but not both;
otherwise an error.badfetch
event is thrown. Valid
values:

bridge = Equivalent to
bridge="true".

blind = Equivalent to
bridge="false".

consultation = Similar
to a blind transfer,
except that the
disconnect event is
only raised if the call
was successfully
transferred.
Otherwise, the
session between the
original caller and the
VoiceXML Interpreter
remains active, and
document execution
resumes.
121
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Details
The following events can be raised by a transfer:
Event
Description
error.connection.baddestination
Destination URI is malformed.
connection.disconnect.hangup
Caller hung up.
connection.disconnect.transfer
Call was transferred (see the bridge attribute).
error.connection.noauthorization
Caller is not allowed to call the destination.
error.connection.noresource
Platform cannot allocate resources to place the call.
error.connection.noroute
Not implemented.
error.connection.protocol.nnn
Not implemented.
error.unsupported.uri
URI format used in the destination number is not
supported.
Parents
<form>
Children
<audio>, <catch>, <enumerate>, <error>, <filled>, <grammar>, <help>, <noinput>,
<nomatch>, <prompt>, <property>, <value>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<var name="phoneNumber" expr="'tel:+35312345678'"/>
<block>Transferring your call, please hold</block>
<transfer destexpr="phoneNumber" name="callTransfer" type="bridge"
connecttimeout="10s">
<filled>
Your transfer lasted
<value expr="callTransfer$.duration" /> seconds.
<if cond="callTransfer == 'busy
Your call party is busy please call back later
</if>
</filled>
</transfer>
</form>
</vxml>
value
See Also
<form>
122
Alphabetical VoiceXML Reference
<value>
Returns the value of a variable.
Syntax
<value
expr = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
expr
CDATA
no
application
/x-wwwformurlencoded
ECMAScript expression that
evaluates to the variable's
value.
Parents
<audio>, <block>, <catch>, <emphasis>, <enumerate>, <error>, <field>, <filled>,
<foreach>, <help>, <if>, <initial>, <log>, <menu>, <noinput>, <nomatch>, <object>,
<p>, <prompt>, <prosody>, <record>, <s>, <say-as>, <subdialog>, <transfer>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<var name="number"/>
<var name="month" expr="'March'"/>
<form>
<block>
Month is <value expr="month"/>
<assign name="month" expr="'July'"/>
Now month is <value expr="month"/>
<assign name="number" expr="2*5"/>
Number is <value expr="number"/>
</block>
</form>
</vxml>
<var>
Declares a local variable.
Syntax
<var
name = "identifier"
expr = "CDATA"
/>
123
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Attributes
Attribute
Data Type
Required?
Default
Description
name
identifier
yes
NA
Variable name. This must be
a legal ECMAScript identifier.
expr
CDATA
no
ECMAScript
undefined
Initial value of the variable.
Parents
<block>, <catch>, <error>, <filled>, <foreach>, <form>, <help>, <if>, <noinput>,
<nomatch>, <vxml>
Children
None.
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<var name="number"/>
<var name="month" expr="'March'"/>
<form>
<block>
Month is <value expr="month"/>
<assign name="month" expr="'July'"/>
Now month is <value expr="month"/>
<assign name="number" expr="2*5"/>
Number is <value expr="number"/>
</block>
</form>
</vxml>
See Also
<assign>, <script>
<voice>
Voice characteristics for the spoken text.
Syntax
<voice
age = "CDATA"
gender = "{male | female | neutral}"
name = "CDATA"
xml:lang = "CDATA"
/>
124
Alphabetical VoiceXML Reference
Attributes
Attribute
Data Type
Required?
Default
Description
age
CDATA
no
NA
Integer specifying the preferred
age of the voice to speak the
contained text.
gender
{male |
female |
neutral}
no
NA
Preferred gender of the voice to
speak the contained text.
name
CDATA
no
NA
Name of the voice to speak the
contained text.
xml:lang
CDATA
no
NA
RFC 1766 compliant identifier
used to locate the TTS engine
used to render the enclosed text.
Parents
<audio>, <emphasis>, <enumerate>, <p>, <prompt>, <prosody>, <s>, <voice>
Children
<audio>, <break>, <emphasis>, <mark>, <p>, <phoneme>, <prosody>, <s>, <sayas>, <sub>, <value>, <voice>
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
<prompt>
<voice gender="female" age="5">Mary had a little lamb,</voice>
<!-- now request a different female child's voice -->
<voice gender="female" age="6" xml:lang="en-GB">
It's fleece was white as snow.
</voice>
<!-- platform-specific voice selection -->
<voice name="Mike">I want to be like Mike.</voice>
</prompt>
</block>
</form>
</vxml>
See Also
<emphasis>, <prosody>, <say-as>
<vxml>
Top-level element required in every VoiceXML document.
125
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Syntax
<vxml
application = "URI"
version = "CDATA"
xml:base = "URI"
xml:lang = "CDATA"
xmlns = "CDATA"
xmlns:xsi = "CDATA"
xsi:schemalocation = "CDATA"
/>
Attributes
Attribute
Data Type
Required?
Default
Description
application
URI
no
NA
URI of this document's
application root
document.
version
CDATA
yes
NA
VoiceXML version.
xml:base
URI
no
NA
Base URI to use when
resolving relative URIs in
the document.
xml:lang
CDATA
no
NA
Language variant of the
document.
xmlns
CDATA
no
NA
Designated namespace
for VoiceXML.
xmlns:xsi
CDATA
no
NA
Used with the
xsi:schemalocation
attribute to indicate the
location of the schema
for the VoiceXML
namespace.
xsi:schemalocation
CDATA
no
NA
Used with the xmlns:xsi
attribute to indicate the
location of the schema
for the VoiceXML
namespace.
Parents
None.
Children
<catch>, <data>, <error>, <form>, <help>, <link>, <menu>, <meta>, <metadata>,
<noinput>, <nomatch>, <property>, <script>, <var>
126
Alphabetical VoiceXML Reference
Example
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
Hello World!
</block>
</form>
</vxml>
127
3.
Application Reference
Application Properties
VoiceXML application properties allow you to set platform defaults for a session and alter
platform behavior when the application executes. Unsupported properties are allowed but
ignored at execution. Properties follow the standard VoiceXML scoping rules.
Usage
To use a property in a VoiceXML application, specify the value attribute for the <property>
tag. For example, suppose you want to have an application that takes advantage of a fast
caching policy, so that your application (VoiceXML documents, grammars, scripts, and so
forth) load quickly. However, during development you need your application to use a safe
caching policy so that you can develop and debug. During development, set the following
properties in the application root:
<vxml version="2.1">
<property name="documentmaxage" value="0"/>
<property name="audiomaxage" value="0"/>
<property name="grammarmaxage" value="0"/>
<property name="scriptmaxage" value="0"/>
...
</vxml>
When you deploy the application, either change the property values from 0 to non-zero
values, or remove the properties.
Note: A property is scoped to the level where it is specified. For example, a property
specified at the application level provides the defaults for all loaded documents. A property
at the form level overrides properties set previously at the application or document level.
Supported Properties
The VoiceXML Interpreter supports the following types of properties:

DTMF

Fetch

Prompt

Recognition
128
Application Reference
DTMF Properties
The following table describes the VoiceXML Interpreter's DTMF properties:
Property
Data Type
Default
Description
interdigittimeout
Number
3.0s
Timeout value between DTMF
occurrences.
termchar
0-9
#
*
""
#
Terminating DTMF character for
DTMF input recognition. Using the
blank option ("") allows you to
specify all DTMF characters as input
items, including the pound key (#).
termtimeout
Number
0s
Termination timeout for DTMF
occurrences.
Fetch Properties
The following table describes the VoiceXML Interpreter's fetch properties.
Property
Data Type
Default
Description
audiofetchhint
{safe |
prefetch}
safe
Not currently supported.
audiomaxage
Number
NA
Maximum acceptable age of cached
audio resources, in seconds.
audiomaxstale
Number
NA
Maximum acceptable staleness of
expired, cached audio resources, in
ms. Specifying an audiomaxstale
value lets a VoiceXML document use
audio resources contained in the
cache for a given period after the
resources have expired.
datafetchhint
{safe |
prefetch}
safe
Not currently supported.
datamaxage
Number
NA
Maximum acceptable age of cached
XML data, in seconds.
129
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Property
Data Type
Default
Description
datamaxstale
Number
NA
Maximum acceptable staleness of
expired cached XML documents, in
seconds. Specifying a datamaxstale
value lets a VoiceXML document use
XML data contained in the cache for
a given period after the data has
expired.
documentfetchhint
{safe |
prefetch}
safe
Not currently supported.
documentmaxage
Number
NA
Maximum acceptable age of cached
documents, in seconds.
documentmaxstale
Number
NA
Maximum acceptable staleness of
expired cached documents, in
seconds. Specifying a
documentmaxstale value lets a
VoiceXML document use VoiceXML
documents contained in the cache,
for a given period after the
documents have expired.
fetchaudio
Number
NA
URI of the audio to play while
waiting for a document to be
fetched.
fetchaudiodelay
Number
0s
Amount of time to wait at the start
of a fetch delay before playing the
fetchaudio source. This is useful if a
fetch delay is short, when it may be
preferable not to start playing
fetchaudio that will be cut-off almost
immediately.
fetchaudiominimum
Number
2s
Minimum time interval to play a
fetchaudio source, once started,
even if the fetch result arrives in the
meantime. This is useful when you
do not want the fetchaudio heard by
a user to be stopped too quickly.
fetchtimeout
Number
10s
Amount of time to wait before a
timeout event is raised on HTTP
fetches.
grammarfetchhint
{safe |
prefetch}
safe
Not currently supported.
130
Application Reference
Property
Data Type
Default
Description
grammarmaxage
Number
NA
Maximum acceptable age of cached
grammars, in seconds.
grammarmaxstale
Number
NA
Maximum acceptable staleness of
expired cached grammars, in
seconds. Specifying a
grammarmaxstale value lets a
VoiceXML document use grammar
resources contained in the cache, for
a given period after the resources
have expired.
objectfetchint
{safe |
prefetch}
safe
Not currently supported.
objectmaxage
Number
NA
Maximum acceptable age of cached
objects, in seconds.
objectmaxstale
Number
NA
Maximum acceptable staleness of
expired cached objects, in seconds.
Specifying an objectmaxstale value
lets a VoiceXML document use
objects contained in the cache for a
given period after the objects have
expired.
scriptfetchhint
{safe |
prefetch}
safe
Currently not available.
scriptmaxage
Number
NA
Maximum acceptable age of cached
scripts, in seconds.
scriptmaxstale
Number
NA
Maximum acceptable staleness of
expired cached scripts, in seconds.
Specifying a scriptmaxstale value
lets a VoiceXML document use script
resources contained in the cache for
a given period after the resources
have expired.
131
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Prompt Properties
The following table lists the VoiceXML Interpreter's prompt properties:
Property
Data Type
Default
Description
bargein
boolean
yes
Allows or disallows prompt bargein.
bargeintype
{speech |
hotword}
speech
Type of barge-in performed in response
to voice input.
timeout
Number
3.4s
Elapsed silent time before a noinput
event is raised.
Recognition Properties
The following table lists the VoiceXML Interpreter's recognition properties:
Property
Data Type
Default
Description
completetimeout
0.2s - 10s
0.25s
Length of silence after speech before a
result is either accepted or rejected
with a nomatch event. This value
applies when the speech prior to
silence is a complete match of an
active grammar.
confidencelevel
0.0 - 1.0
0.5
Threshold of the speech recognition
confidence level. The VoiceXML
Interpreter rejects user inputs if the
confidence level is below this
threshold. Valid values range from 0.0
to 1.0.
132
Application Reference
Property
Data Type
Default
Description
incompletetimeout
0.2s - 10s
0.75s
Length of silence after speech before a
result is finalized. This value applies
when the speech prior to silence is
either:

An incomplete match of all
active grammars, or

A complete match of an active
grammar, but the user can
speak additional grammar
items.
In the first case, when the timeout is
triggered, the VoiceXML Interpreter
rejects the partial result and raises a
nomatch event. In the second case,
the VoiceXML Interpreter accepts the
speech.
inputmodes
{dtmf |
dtmf voice |
voice}
dtmf
voice
Space separated list defining the type
of inputs allowed. Valid values:

dtmf = Speech recognition is
disabled.

voice = DTMF recognition is
disabled.
maxspeechtimeout
0s - 600s
15s
Maximum duration of user speech. In
VoiceXML 2.0, if this time elapses
before the user stops speaking, a
maxspeechtimeout event is raised. Use
0 for no limit.
maxnbest
1 - 500
1
Maximum number of results returned
by the recognizer. Also represents the
maximum size of the
application.lastresult$[i] array.
133
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Property
Data Type
Default
Description
recordutterance
boolean
no
Indicates whether to enable or disable
utterance recording during recognition.

true: Enables utterance
recording during recognition.

false: Disables utterance
recording.
When utterance recording is enabled,
the following variables contain
recording values:

lastresult$.recording contains
the user's utterance.

lastresult$.recordingsize
contains the recording size, in
bytes.

lastresult$.recordingduration
contains, the recording duration
in ms when a recognition result
is returned.
If a form item is filled, the
corresponding form item shadow
variables also are set to these values.
recordutterancetype
{audio/xwav |
video/3gpp}
audio/xwav
Media type to use for utterances
recorded during recognition.
sensitivity
0.0 - 1.0
0.5
Sensitivity level to input. Valid values
range from 0.0 (least sensitive) to 1.0
(most sensitive).
speedvsaccuracy
0.0 - 1.0
0.5
Provides information to the recognizer
of the desired balance between speed
and accuracy. Values range from 0.0
(fastest recognition) to 1.0 (highest
accuracy).
universals
{cancel |
exit | help |
none}
none
Space-separated list of the universal
commands to activate; for example:
"help" "cancel" "exit"
SSML Support
VoiceXML for PowerMedia XMS will follow the Speech Server Markup Language (SSML) 1.0
standard for speech control interface. It will have its own SSML processor to interpret
speech tags and provide to VoiceXML application a standard way to control aspects of
speech such as pronunciation, volume, pitch, and rate.
134
Application Reference
This release of PowerMedia XMS will only support a subset of the SSML 1.0 standard.
Although all elements will be parsed and processed, the only SSML element to be integrated
with the PowerMedia XMS media engine is the <audio> element. It specifies the audio files
to be played. For TTS enabled application, all SSML commands will be transferred as-is to
the speech server via the Media Resource Control Protocol (MRCP) interface. Refer to the
speech vendor specification for the SSML support coverage.
Session Variables
VoiceXML session variables are read-only variables that hold information about the platform
during an entire user session. At the beginning of a user session, the VoiceXML Interpreter
sets and declares the session variables. These variables follow the usual VoiceXML scoping
rules and are at the highest tier of the scope chain.
Usage
Session variables are referenced in any VoiceXML document during a call session.
<block>
<prompt>
The Caller ID is <value expr="session.connection.remote.uri"/>
</prompt>
...
</block>
The following table lists the available session variables:
Session Variable
Description
session.connection.aai
Application-to-application information passed
during connection setup. For example, this
information can be set by the <transfer>
element.
session.connection.initialuri
URI of the first page of VoiceXML used in the call.
session.connection.local.uri
URI that addresses the local VoiceXML
Interpreter device. For a SIP inbound call, this is
the value of the INVITE To: header.
session.connection.originator
Directly references the local or remote URI. For
example, the following ECMAScript returns true if
the remote party initiated the connection:
var caller_initiate = session.connection.originator
==
session.connection.remote.uri.
session.connection.protocol.name
Name of the connection protocol. This name can
also represent the subobject name for protocolspecific information, as in the following example:
session.connection.protocol[session.connection.
protocol.name].*
135
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Session Variable
Description
session.connection.protocol[session.
These subobject variables provide protocol
specific information. For example, if
session.connection.protocol.name is q931, then
session.connection.protocol.q931.mode would
specify if the connection is in voice or video
mode.
connection.protocol.name].*
For more information, see Connection Protocol
Subobjects.
session.connection.protocol.version
Connection protocol version.
session.connection.redirect
An array representing the connection redirection
paths. The first element is the original called
number, the last element is the last redirected
number. Each element of the array contains a
uri, pi (presentation information), si (screening
information), and reason property. Valid values
for the reason property are:

deflection during alerting

deflection immediate response

mobile subscriber not reachable

no reply

unknown

user busy
session.connection.remote.uri
URI that addresses the remote device. For a SIP
inbound call, this is the value of the INVITE
From: header. For a PSTN inbound call, this is
the calling party number, regardless of the
Presentation Restricted setting.
session.connection.protocol.version
Version of the connection protocol.
Connection Protocol Subobjects
The session.connection.protocol session variable contains subobject variables that provide
protocol-specific information. For example, if session.connection.protocol.name is 'q931',
then session.connection.protocol.q931.mode indicates whether the connection is in voice or
video mode.
The following table describes the connection subobjects available for the SIP protocol when
the VoiceXML Interpreter is used with the call server. These subobjects are available within
the session.connection.protocol.sip object.
136
Application Reference
Subobject Name
Description
requesturi
Request-URI from the SIP INVITE.
requesturi.voicexml
VoiceXML parameter from the Request-URI. This information
is also available through the session.connection.initialuri
variable.
requesturi.aai
Application-to-application information from the Request-URI.
This information is also available through the
session.connection.aai variable.
The following example shows the variables used when a SIP call is in session:
session.connection.protocol.name="sip"
session.connection.protocol.version="2"
session.connection.protocol.sip.requesturi="sip:[email protected];
voicexml=http://vxmlserver.example.net/cgi-bin/script.vxml;aai=information"
Application Variables
The read-only application.lastresult$ variable is an array of elements containing information
about the last recognition to occur within an application. Each array element represents a
possible recognition result.
Recognition results are sorted by the confidence score of the recognition, from highest to
lowest. Using application.lastresult.$ without an index is the same as referencing the first
element of the array, application.lastresult$[0].
The following table describes the subobjects available for each possible recognition result:
Name
Description
application.lastresult$[i].bargeintime
Duration that elapsed until the user gave
input.
application.lastresult$[i].confidence
Whole utterance confidence level for this
interpretation. Valid values range from 0.0
(minimum) through 1.0 (maximum).
application.lastresult$[i].inputmode
Indicates whether the user used voice or
DTMF to input this result.
application.lastresult$[i].interpretation
Semantic interpretation of the user's input.
application.lastresult$[i].markname
Name of the last <mark> executed before
the user gave input, or before the end of
playback occurred.
application.lastresult$[i].marktime
Number of milliseconds between when the
last <mark> was executed and the user
gave input, or the end of playback
occurred.
137
Dialogic® PowerMedia™ XMS VoiceXML Reference Guide
Name
Description
application.lastresult$[i].recording
Reference to the user's utterance, if the
recordutterance property is set.
application.lastresult$[i].recordingduration
Duration of the recording of the user's
utterance, in ms.
application.lastresult$[i].recordingsize
Size of the recording of the user's
utterance in bytes.
application.lastresult$[i].utterance
Raw string of words recognized for this
interpretation. For a DTMF grammar, this
variable contains the string representation
of the matched digits.
Application variables are referenced in the same scope as any recognition that occurred
during a call session.
<field>
<prompt>Say yes or no</prompt>
<filled>
<if cond="application.lastresult$.confidence &lt; 0.5">
<goto nextitem="confirm"/>
<else>
<goto next="next_menu.html"/>
</if>
</filled>
</field>
138
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement