You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15944 lines
542 KiB
15944 lines
542 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
|
|
lang="en">
|
|
<head>
|
|
<title>Voice Extensible Markup Language (VoiceXML) Version
|
|
2.0</title>
|
|
<meta http-equiv="Content-Type"
|
|
content="text/html; charset=UTF-8" />
|
|
<style type="text/css" xml:space="preserve">
|
|
body {
|
|
font-family: sans-serif;
|
|
margin-left: 10%;
|
|
margin-right: 5%;
|
|
color: black;
|
|
background-color: white;
|
|
}
|
|
h2,h3,h4,h5,h5,h6 {
|
|
font-weight: normal;
|
|
color: rgb(0, 92, 160);
|
|
}
|
|
img { color: white; border: 0; }
|
|
h2 { margin-top: 2em; clear: both; }
|
|
.tocline { list-style: none; }
|
|
div.navbar,div.head { margin-bottom: 1em; }
|
|
div.navbar { text-align: center; }
|
|
p.copyright { font-size: 70%; }
|
|
pre.example {
|
|
font-family: "Courier New", monospace;
|
|
white-space: pre;
|
|
background-color: rgb(204,204,255);
|
|
padding: 0.5em;
|
|
border: none;
|
|
margin-left: 0;
|
|
font-size: 90%;
|
|
width: 97%;
|
|
}
|
|
.fig { text-align: center }
|
|
.new { color: blue }
|
|
.remove { text-decoration: line-through }
|
|
.diff { color: red }
|
|
.changes { color: red }
|
|
.hide { display: none }
|
|
.issues {
|
|
font-style: italic;
|
|
color: green;
|
|
}
|
|
</style>
|
|
|
|
<link rel="stylesheet" type="text/css"
|
|
href="http://www.w3.org/StyleSheets/TR/W3C-REC" />
|
|
</head>
|
|
<body>
|
|
<div class="head">
|
|
<p><a href="http://www.w3.org/"><img height="48"
|
|
alt="W3C" src="http://www.w3.org/Icons/w3c_home"
|
|
width="72" /></a></p>
|
|
|
|
<!--- CHAPTER 1: BEGIN =-->
|
|
<h1 class="notoc" id="Voice">Voice Extensible Markup Language
|
|
(VoiceXML) Version 2.0</h1>
|
|
|
|
<h2 class="notoc" id="Working">W3C Recommendation 16 March 2004</h2>
|
|
|
|
<dl>
|
|
<dt>This Version:</dt>
|
|
|
|
<dd><a href="http://www.w3.org/TR/2004/REC-voicexml20-20040316/"
|
|
shape="rect">http://www.w3.org/TR/2004/REC-voicexml20-20040316/</a></dd>
|
|
|
|
<dt>Latest Version:</dt>
|
|
|
|
<dd><a href="http://www.w3.org/TR/voicexml20/"
|
|
shape="rect">http://www.w3.org/TR/voicexml20/</a></dd>
|
|
|
|
<dt>Previous Version:</dt>
|
|
|
|
<dd><a href="http://www.w3.org/TR/2004/PR-voicexml20-20040203/"
|
|
shape="rect">http://www.w3.org/TR/2004/PR-voicexml20-20040203/</a></dd>
|
|
|
|
<dt>Editors:</dt>
|
|
|
|
<dd>Scott McGlashan, Hewlett-Packard (Editor-in-Chief)<br
|
|
clear="none" />
|
|
Daniel C. Burnett, Nuance Communications<br />
|
|
Jerry Carter, Invited Expert<br />
|
|
Peter Danielsen, Lucent (until October 2002)<br />
|
|
Jim Ferrans, Motorola<br />
|
|
Andrew Hunt, ScanSoft<br />
|
|
Bruce Lucas, IBM<br />
|
|
Brad Porter, Tellme Networks<br />
|
|
Ken Rehor, Vocalocity<br />
|
|
Steph Tryphonas, Tellme Networks</dd>
|
|
</dl>
|
|
|
|
<p>Please refer to the <a href=
|
|
"http://www.w3.org/2004/03/voicexml20-errata.html"><strong>errata</strong></a>
|
|
for this document, which may include some normative corrections.</p>
|
|
|
|
<p>See also <a href="http://www.w3.org/2003/03/Translations/byTechnology?technology=voicexml20"><strong>translations</strong></a>.</p>
|
|
|
|
|
|
|
|
<p class="copyright"><a
|
|
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
|
|
shape="rect">Copyright</a> © 2004 <a
|
|
href="http://www.w3.org/" shape="rect"><acronym
|
|
title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup>
|
|
(<a href="http://www.csail.mit.edu/" shape="rect"><acronym
|
|
title="Massachusetts Institute of Technology">MIT</acronym></a>,
|
|
<a href="http://www.ercim.org/" shape="rect"><acronym
|
|
title="European Research Consortium for Informatics and Mathematics">
|
|
ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/"
|
|
shape="rect">Keio</a>), All Rights Reserved. W3C <a
|
|
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer"
|
|
shape="rect">liability</a>, <a
|
|
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks"
|
|
shape="rect">trademark</a>, <a
|
|
href="http://www.w3.org/Consortium/Legal/copyright-documents"
|
|
shape="rect">document use</a> and <a
|
|
href="http://www.w3.org/Consortium/Legal/copyright-software"
|
|
shape="rect">software licensing</a> rules apply.</p>
|
|
|
|
<hr title="Separator for header" />
|
|
</div>
|
|
|
|
<h2 class="notoc" id="Abstract001"><a id="abstract"
|
|
name="abstract" shape="rect">Abstract</a></h2>
|
|
|
|
<p>This document specifies VoiceXML, the Voice Extensible Markup
|
|
Language. VoiceXML is designed for creating audio dialogs that
|
|
feature synthesized speech, digitized audio, recognition of
|
|
spoken and DTMF key input, recording of spoken input, telephony,
|
|
and mixed initiative conversations. Its major goal is to bring
|
|
the advantages of Web-based development and content delivery to
|
|
interactive voice response applications.</p>
|
|
|
|
<h2 id="Status">Status of this Document</h2>
|
|
|
|
<p><em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/">W3C technical reports index</a> at http://www.w3.org/TR/.</em></p>
|
|
|
|
<p>This document has been reviewed by W3C Members and other
|
|
interested parties, and it has been endorsed by the Director
|
|
as a <a
|
|
href="http://www.w3.org/2004/02/Process-20040205/tr.html#RecsW3C">W3C
|
|
Recommendation</a>. W3C's role in making the Recommendation is to
|
|
draw attention to the specification and to promote its widespread
|
|
deployment. This enhances the functionaility and interoperability
|
|
of the Web.</p>
|
|
|
|
<p>This specification is part of the W3C Speech Interface Framework
|
|
and has been developed within the <a href=
|
|
"http://www.w3.org/Voice/">W3C Voice Browser Activity</a><span
|
|
class="hide"><a href=
|
|
"http://www.w3.org/Voice/Activity.html"></a></span> by participants in
|
|
the <a href="http://www.w3.org/Voice/Group/">Voice Browser Working
|
|
Group</a> (<a href="http://cgi.w3.org/MemberAccess/AccessRequest">W3C
|
|
Members only</a>).</p>
|
|
|
|
<p>The design of VoiceXML 2.0 has been widely reviewed (see the
|
|
<a href=
|
|
"http://www.w3.org/TR/2004/PR-voicexml20-20040203/disposition.htm">
|
|
disposition of comments</a>) and satisfies the Working Group's <a
|
|
href=
|
|
"http://www.w3.org/TR/voice-dialog-reqs/">technical requirements</a>.
|
|
A list of implementations is included in the <a href=
|
|
"http://www.w3.org/Voice/2004/vxml-ir/">VoiceXML 2.0 implementation report</a>, along with the associated test suite.</p>
|
|
|
|
<p>Comments are welcome on <a
|
|
href="mailto:www-voice@w3.org">www-voice@w3.org</a> (<a
|
|
href="http://lists.w3.org/Archives/Public/www-voice/">archive</a>).
|
|
See <a href="http://www.w3.org/Mail/">W3C mailing list and archive usage
|
|
guidelines</a>.</p>
|
|
|
|
<p>The W3C maintains a list of <a href=
|
|
"http://www.w3.org/2001/09/voice-disclosures.html">any patent
|
|
disclosures related to this work</a>.</p>
|
|
|
|
<h2 id="Convention">Conventions of this Document</h2>
|
|
|
|
<p>In this document, the key words "must", "must not",
|
|
"required", "shall", "shall not", "should", "should not",
|
|
"recommended", "may", and "optional" are to be interpreted as
|
|
described in <a href="#ref_RFC2119" shape="rect">[RFC2119]</a>
|
|
and indicate requirement levels for compliant VoiceXML
|
|
implementations.</p>
|
|
|
|
<h2 class="notoc" id="Table"><a name="toc" id="toc"
|
|
shape="rect">Table of Contents</a></h2>
|
|
|
|
<h3 id="Abbreviate">Abbreviated Contents</h3>
|
|
|
|
<ul>
|
|
<li class="tocline">1. <a href="#dml1"
|
|
shape="rect">Overview</a></li>
|
|
|
|
<li class="tocline">2. <a href="#dml2" shape="rect">Dialog
|
|
Constructs</a></li>
|
|
|
|
<li class="tocline">3. <a href="#dml3" shape="rect">User
|
|
Input</a></li>
|
|
|
|
<li class="tocline">4. <a href="#dml4" shape="rect">System
|
|
Output</a></li>
|
|
|
|
<li class="tocline">5. <a href="#dml5" shape="rect">Control flow
|
|
and scripting</a></li>
|
|
|
|
<li class="tocline">6. <a href="#dml6" shape="rect">Environment
|
|
and Resources</a></li>
|
|
|
|
<li class="tocline"><a href="#dml7"
|
|
shape="rect">Appendices</a></li>
|
|
</ul>
|
|
|
|
<h3 id="Full">Full Contents</h3>
|
|
|
|
<ul>
|
|
<li class="tocline">1. <a href="#dml1" shape="rect">Overview</a>
|
|
|
|
<ul>
|
|
<li class="tocline">1.1 <a href="#dml1.1"
|
|
shape="rect">Introduction</a></li>
|
|
|
|
<li class="tocline">1.2 <a href="#dml1.2"
|
|
shape="rect">Background</a>
|
|
|
|
<ul>
|
|
<li class="tocline">1.2.1 <a href="#dml1.2.1"
|
|
shape="rect">Architectural Model</a></li>
|
|
|
|
<li class="tocline">1.2.2 <a href="#dml1.2.2" shape="rect">Goals
|
|
of VoiceXML</a></li>
|
|
|
|
<li class="tocline">1.2.3 <a href="#dml1.2.3" shape="rect">Scope
|
|
of VoiceXML</a></li>
|
|
|
|
<li class="tocline">1.2.4 <a href="#dml1.2.4"
|
|
shape="rect">Principles of Design</a></li>
|
|
|
|
<li class="tocline">1.2.5 <a href="#dml1.2.5"
|
|
shape="rect">Implementation Platform Requirements</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">1.3 <a href="#dml1.3"
|
|
shape="rect">Concepts</a>
|
|
|
|
<ul>
|
|
<li class="tocline">1.3.1 <a href="#dml1.3.1"
|
|
shape="rect">Dialogs and Subdialogs</a></li>
|
|
|
|
<li class="tocline">1.3.2 <a href="#dml1.3.2"
|
|
shape="rect">Sessions</a></li>
|
|
|
|
<li class="tocline">1.3.3 <a href="#dml1.3.3"
|
|
shape="rect">Applications</a></li>
|
|
|
|
<li class="tocline">1.3.4 <a href="#dml1.3.4"
|
|
shape="rect">Grammars</a></li>
|
|
|
|
<li class="tocline">1.3.5 <a href="#dml1.3.5"
|
|
shape="rect">Events</a></li>
|
|
|
|
<li class="tocline">1.3.6 <a href="#dml1.3.6"
|
|
shape="rect">Links</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">1.4 <a href="#dml1.4" shape="rect">VoiceXML
|
|
Elements</a></li>
|
|
|
|
<li class="tocline">1.5 <a href="#dml1.5" shape="rect">Document
|
|
Structure and Execution</a>
|
|
|
|
<ul>
|
|
<li class="tocline">1.5.1 <a href="#dml1.5.1"
|
|
shape="rect">Execution within one Document</a></li>
|
|
|
|
<li class="tocline">1.5.2 <a href="#dml1.5.2"
|
|
shape="rect">Executing a Multi-Document Application</a></li>
|
|
|
|
<li class="tocline">1.5.3 <a href="#dml1.5.3"
|
|
shape="rect">Subdialogs</a></li>
|
|
|
|
<li class="tocline">1.5.4 <a href="#dml1.5.4" shape="rect">Final
|
|
Processing</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">2. <a href="#dml2" shape="rect">Dialog
|
|
Constructs</a>
|
|
|
|
<ul>
|
|
<li class="tocline">2.1 <a href="#dml2.1" shape="rect">Forms</a>
|
|
|
|
<ul>
|
|
<li class="tocline">2.1.1 <a href="#dml2.1.1" shape="rect">Form
|
|
Interpretation</a></li>
|
|
|
|
<li class="tocline">2.1.2 <a href="#dml2.1.2" shape="rect">Form
|
|
Items</a></li>
|
|
|
|
<li class="tocline">2.1.3 <a href="#dml2.1.3" shape="rect">Form
|
|
Item Variables and Conditions</a></li>
|
|
|
|
<li class="tocline">2.1.4 <a href="#dml2.1.4"
|
|
shape="rect">Directed Forms</a></li>
|
|
|
|
<li class="tocline">2.1.5 <a href="#dml2.1.5" shape="rect">Mixed
|
|
Initiative Forms</a></li>
|
|
|
|
<li class="tocline">2.1.6 <a href="#dml2.1.6" shape="rect">Form
|
|
Interpretation Algorithm</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">2.2 <a href="#dml2.2" shape="rect">Menus</a>
|
|
|
|
<ul>
|
|
<li class="tocline">2.2.1 <a href="#dml2.2.1"
|
|
shape="rect">menu element</a></li>
|
|
|
|
<li class="tocline">2.2.2 <a href="#dml2.2.2"
|
|
shape="rect">choice element</a></li>
|
|
|
|
<li class="tocline">2.2.3 <a href="#dml2.2.3" shape="rect">DTMF
|
|
in Menus</a></li>
|
|
|
|
<li class="tocline">2.2.4 <a href="#dml2.2.4"
|
|
shape="rect">enumerate element</a></li>
|
|
|
|
<li class="tocline">2.2.5 <a href="#dml2.2.5"
|
|
shape="rect">Grammar Generation</a></li>
|
|
|
|
<li class="tocline">2.2.6 <a href="#dml2.2.6"
|
|
shape="rect">Interpretation Model</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">2.3 <a href="#dml2.3" shape="rect">Form
|
|
Items</a>
|
|
|
|
<ul>
|
|
<li class="tocline">2.3.1 <a href="#dml2.3.1"
|
|
shape="rect">field element</a></li>
|
|
|
|
<li class="tocline">2.3.2 <a href="#dml2.3.2"
|
|
shape="rect">block element</a></li>
|
|
|
|
<li class="tocline">2.3.3 <a href="#dml2.3.3"
|
|
shape="rect">initial element</a></li>
|
|
|
|
<li class="tocline">2.3.4 <a href="#dml2.3.4"
|
|
shape="rect">subdialog element</a></li>
|
|
|
|
<li class="tocline">2.3.5 <a href="#dml2.3.5"
|
|
shape="rect">object element</a></li>
|
|
|
|
<li class="tocline">2.3.6 <a href="#dml2.3.6"
|
|
shape="rect">record element</a></li>
|
|
|
|
<li class="tocline">2.3.7 <a href="#dml2.3.7"
|
|
shape="rect">transfer element</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">2.4 <a href="#dml2.4"
|
|
shape="rect">Filled</a></li>
|
|
|
|
<li class="tocline">2.5 <a href="#dml2.5"
|
|
shape="rect">Links</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">3. <a href="#dml3" shape="rect">User
|
|
Input</a>
|
|
|
|
<ul>
|
|
<li class="tocline">3.1 <a href="#dml3.1"
|
|
shape="rect">Grammars</a>
|
|
|
|
<ul>
|
|
<li class="tocline">3.1.1 <a href="#dml3.1.1" shape="rect">Speech
|
|
Grammars</a></li>
|
|
|
|
<li class="tocline">3.1.2 <a href="#dml3.1.2" shape="rect">DTMF
|
|
Grammars</a></li>
|
|
|
|
<li class="tocline">3.1.3 <a href="#dml3.1.3" shape="rect">Scope
|
|
of Grammars</a></li>
|
|
|
|
<li class="tocline">3.1.4 <a href="#dml3.1.4"
|
|
shape="rect">Activation of Grammars</a></li>
|
|
|
|
<li class="tocline">3.1.5 <a href="#dml3.1.5"
|
|
shape="rect">Semantic Interpretation of Input</a></li>
|
|
|
|
<li class="tocline">3.1.6 <a href="#dml3.1.6"
|
|
shape="rect">Mapping Semantic Interpretation Results to VoiceXML
|
|
forms</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">4. <a href="#dml4" shape="rect">System
|
|
Output</a>
|
|
|
|
<ul>
|
|
<li class="tocline">4.1 <a href="#dml4.1" shape="rect">Prompt</a>
|
|
|
|
|
|
<ul>
|
|
<li class="tocline">4.1.1 <a href="#dml4.1.1" shape="rect">Speech
|
|
Markup</a></li>
|
|
|
|
<li class="tocline">4.1.2 <a href="#dml4.1.2" shape="rect">Basic
|
|
Prompts</a></li>
|
|
|
|
<li class="tocline">4.1.3 <a href="#dml4.1.3" shape="rect">Audio
|
|
Prompting</a></li>
|
|
|
|
<li class="tocline">4.1.4 <a href="#dml4.1.4"
|
|
shape="rect"><value> Element</a></li>
|
|
|
|
<li class="tocline">4.1.5 <a href="#dml4.1.5"
|
|
shape="rect">Bargein</a></li>
|
|
|
|
<li class="tocline">4.1.6 <a href="#dml4.1.6" shape="rect">Prompt
|
|
Selection</a></li>
|
|
|
|
<li class="tocline">4.1.7 <a href="#dml4.1.7"
|
|
shape="rect">Timeout</a></li>
|
|
|
|
<li class="tocline">4.1.8 <a href="#dml4.1.8" shape="rect">Prompt
|
|
Queueing and Input Collection</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">5. <a href="#dml5" shape="rect">Control flow
|
|
and scripting</a>
|
|
|
|
<ul>
|
|
<li class="tocline">5.1 <a href="#dml5.1" shape="rect">Variables
|
|
and Expressions</a>
|
|
|
|
<ul>
|
|
<li class="tocline">5.1.1 <a href="#dml5.1.1"
|
|
shape="rect">Declaring Variables</a></li>
|
|
|
|
<li class="tocline">5.1.2 <a href="#dml5.1.2"
|
|
shape="rect">Variable Scopes</a></li>
|
|
|
|
<li class="tocline">5.1.3 <a href="#dml5.1.3"
|
|
shape="rect">Referencing Variables</a></li>
|
|
|
|
<li class="tocline">5.1.4 <a href="#dml5.1.4"
|
|
shape="rect">Standard Session Variables</a></li>
|
|
|
|
<li class="tocline">5.1.5 <a href="#dml5.1.5"
|
|
shape="rect">Standard Application Variables</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<ul>
|
|
<li class="tocline">5.2 <a href="#dml5.2" shape="rect">Event
|
|
Handling</a>
|
|
|
|
<ul>
|
|
<li class="tocline">5.2.1 <a href="#dml5.2.1"
|
|
shape="rect">throw element</a></li>
|
|
|
|
<li class="tocline">5.2.2 <a href="#dml5.2.2"
|
|
shape="rect">catch element</a></li>
|
|
|
|
<li class="tocline">5.2.3 <a href="#dml5.2.3"
|
|
shape="rect">Shorthand Notation</a></li>
|
|
|
|
<li class="tocline">5.2.4 <a href="#dml5.2.4" shape="rect">catch
|
|
Element Selection</a></li>
|
|
|
|
<li class="tocline">5.2.5 <a href="#dml5.2.5"
|
|
shape="rect">Default catch elements</a></li>
|
|
|
|
<li class="tocline">5.2.6 <a href="#dml5.2.6" shape="rect">Event
|
|
Types</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">5.3 <a href="#dml5.3" shape="rect">Executable
|
|
Content</a>
|
|
|
|
<ul>
|
|
<li class="tocline">5.3.1 <a href="#dml5.3.1"
|
|
shape="rect">var element</a></li>
|
|
|
|
<li class="tocline">5.3.2 <a href="#dml5.3.2"
|
|
shape="rect">assign element</a></li>
|
|
|
|
<li class="tocline">5.3.3 <a href="#dml5.3.3"
|
|
shape="rect">clear element</a></li>
|
|
|
|
<li class="tocline">5.3.4 <a href="#dml5.3.4" shape="rect">if,
|
|
elseif, else elements</a></li>
|
|
|
|
<li class="tocline">5.3.5 <a href="#dml5.3.5"
|
|
shape="rect">prompts</a></li>
|
|
|
|
<li class="tocline">5.3.6 <a href="#dml5.3.6"
|
|
shape="rect">reprompt element</a></li>
|
|
|
|
<li class="tocline">5.3.7 <a href="#dml5.3.7"
|
|
shape="rect">goto element</a></li>
|
|
|
|
<li class="tocline">5.3.8 <a href="#dml5.3.8"
|
|
shape="rect">submit element</a></li>
|
|
|
|
<li class="tocline">5.3.9 <a href="#dml5.3.9"
|
|
shape="rect">exit element</a></li>
|
|
|
|
<li class="tocline">5.3.10 <a href="#dml5.3.10"
|
|
shape="rect">return element</a></li>
|
|
|
|
<li class="tocline">5.3.11 <a href="#dml5.3.11"
|
|
shape="rect">disconnect element</a></li>
|
|
|
|
<li class="tocline">5.3.12 <a href="#dml5.3.12"
|
|
shape="rect">script element</a></li>
|
|
|
|
<li class="tocline">5.3.13 <a href="#dml5.3.13"
|
|
shape="rect">log element</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">6. <a href="#dml6" shape="rect">Environment
|
|
and Resources</a>
|
|
|
|
<ul>
|
|
<li class="tocline">6.1 <a href="#dml6.1" shape="rect">Resource
|
|
Fetching</a>
|
|
|
|
<ul>
|
|
<li class="tocline">6.1.1 <a href="#dml6.1.1"
|
|
shape="rect">Fetching</a></li>
|
|
|
|
<li class="tocline">6.1.2 <a href="#dml6.1.2"
|
|
shape="rect">Caching</a></li>
|
|
|
|
<li class="tocline">6.1.3 <a href="#dml6.1.3"
|
|
shape="rect">Prefetching</a></li>
|
|
|
|
<li class="tocline">6.1.4 <a href="#dml6.1.4"
|
|
shape="rect">Protocols</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">6.2 <a href="#dml6.2" shape="rect">Metadata
|
|
Information</a>
|
|
|
|
<ul>
|
|
<li class="tocline">6.2.1 <a href="#dml6.2.1"
|
|
shape="rect">meta element</a></li>
|
|
|
|
<li class="tocline">6.2.2 <a href="#dml6.2.2"
|
|
shape="rect">metadata element</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">6.3 <a href="#dml6.3"
|
|
shape="rect">property element</a>
|
|
|
|
<ul>
|
|
<li class="tocline">6.3.1 <a href="#dml6.3.1"
|
|
shape="rect">Platform-Specific Properties</a></li>
|
|
|
|
<li class="tocline">6.3.2 <a href="#dml6.3.2"
|
|
shape="rect">Generic Speech Recognizer Properties</a></li>
|
|
|
|
<li class="tocline">6.3.3 <a href="#dml6.3.3"
|
|
shape="rect">Generic DTMF Recognizer Properties</a></li>
|
|
|
|
<li class="tocline">6.3.4 <a href="#dml6.3.4" shape="rect">Prompt
|
|
and Collect Properties</a></li>
|
|
|
|
<li class="tocline">6.3.5 <a href="#dml6.3.5"
|
|
shape="rect">Fetching Properties</a></li>
|
|
|
|
<li class="tocline">6.3.6 <a href="#dml6.3.6"
|
|
shape="rect">Miscellaneous Properties</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline">6.4 <a href="#dml6.4"
|
|
shape="rect">param element</a></li>
|
|
|
|
<li class="tocline">6.5 <a href="#dml6.5"
|
|
shape="rect">Value Designations</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="tocline"><a href="#dml7" shape="rect">Appendices</a>
|
|
|
|
<ul>
|
|
<li class="tocline">Appendix A. <a href="#dmlATerms"
|
|
shape="rect">Glossary of Terms</a></li>
|
|
|
|
<li class="tocline">Appendix B. <a href="#dmlADTD"
|
|
shape="rect">VoiceXML Document Type Definition</a></li>
|
|
|
|
<li class="tocline">Appendix C. <a href="#dmlAFIA"
|
|
shape="rect">Form Interpretation Algorithm</a></li>
|
|
|
|
<li class="tocline">Appendix D. <a href="#dmlATiming"
|
|
shape="rect">Timing Properties</a></li>
|
|
|
|
<li class="tocline">Appendix E. <a href="#dmlAAudioFormats"
|
|
shape="rect">Audio File Formats</a></li>
|
|
|
|
<li class="tocline">Appendix F. <a href="#dmlAConformance"
|
|
shape="rect">Conformance</a></li>
|
|
|
|
<li class="tocline">Appendix G. <a
|
|
href="#dmlAInternationalization"
|
|
shape="rect">Internationalization</a></li>
|
|
|
|
<li class="tocline">Appendix H. <a href="#dmlAAccessibility"
|
|
shape="rect">Accessibility</a></li>
|
|
|
|
<li class="tocline">Appendix I. <a href="#dmlAPrivacy"
|
|
shape="rect">Privacy</a></li>
|
|
|
|
<li class="tocline">Appendix J. <a href="#dmlAChanges"
|
|
shape="rect">Changes from VoiceXML 1.0</a></li>
|
|
|
|
<li class="tocline">Appendix K. <a href="#dmlAReusability"
|
|
shape="rect">Reusability</a></li>
|
|
|
|
<li class="tocline">Appendix L. <a href="#dmlAAcknowledge"
|
|
shape="rect">Acknowledgements</a></li>
|
|
|
|
<li class="tocline">Appendix M. <a href="#dmlAReferences"
|
|
shape="rect">References</a></li>
|
|
|
|
<li class="tocline">Appendix N. <a href="#dmlAMediaType"
|
|
shape="rect">Media Type and File Suffix</a></li>
|
|
|
|
<li class="tocline">Appendix O. <a href="#dmlASchema"
|
|
shape="rect">VoiceXML XML Schema Definition</a></li>
|
|
|
|
<li class="tocline">Appendix P. <a href="#dmlABuiltins"
|
|
shape="rect">Builtin Grammar Types</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<hr />
|
|
<h1 id="L852"><a id="dml1" name="dml1" shape="rect">1.
|
|
Overview</a></h1>
|
|
|
|
<p>This document defines VoiceXML, the Voice Extensible Markup
|
|
Language. Its background, basic concepts and use are presented in
|
|
<a href="#dml1.1" shape="rect">Section 1</a>. The dialog
|
|
constructs of form, menu and link, and the mechanism (Form
|
|
Interpretation Algorithm) by which they are interpreted are then
|
|
introduced in <a href="#dml2" shape="rect">Section 2</a>. User
|
|
input using DTMF and speech grammars is covered in <a
|
|
href="#dml3" shape="rect">Section 3</a>, while <a href="#dml4"
|
|
shape="rect">Section 4</a> covers system output using speech
|
|
synthesis and recorded audio. Mechanisms for manipulating dialog
|
|
control flow, including variables, events, and executable
|
|
elements, are explained in <a href="#dml5" shape="rect">Section
|
|
5</a>. Environment features such as parameters and properties as
|
|
well as resource handling are specified in <a href="#dml6"
|
|
shape="rect">Section 6</a>. The appendices provide additional
|
|
information including the <a href="#dmlASchema"
|
|
shape="rect">VoiceXML Schema</a>, a detailed specification of the
|
|
<a href="#dmlAFIA" shape="rect">Form Interpretation Algorithm</a>
|
|
and <a href="#dmlATiming" shape="rect">timing</a>, <a
|
|
href="#dmlAAudioFormats" shape="rect">audio file formats</a>, and
|
|
statements relating to <a href="#dmlAConformance"
|
|
shape="rect">conformance</a>, <a href="#dmlAInternationalization"
|
|
shape="rect">internationalization</a>, <a
|
|
href="#dmlAAccessibility" shape="rect">accessibility</a> and <a
|
|
href="#dmlAPrivacy" shape="rect">privacy</a>.</p>
|
|
|
|
<p>The origins of VoiceXML began in 1995 as an XML-based dialog
|
|
design language intended to simplify the speech recognition
|
|
application development process within an AT&T project called
|
|
Phone Markup Language (PML). As AT&T reorganized, teams at
|
|
AT&T, Lucent and Motorola continued working on their own
|
|
PML-like languages.</p>
|
|
|
|
<p>In 1998, W3C hosted a conference on voice browsers. By this
|
|
time, AT&T and Lucent had different variants of their
|
|
original PML, while Motorola had developed VoxML, and IBM was
|
|
developing its own SpeechML. Many other attendees at the
|
|
conference were also developing similar languages for dialog
|
|
design; for example, such as HP's TalkML and PipeBeach's
|
|
VoiceHTML.</p>
|
|
|
|
<p>The VoiceXML Forum was then formed by AT&T, IBM, Lucent,
|
|
and Motorola to pool their efforts. The mission of the VoiceXML
|
|
Forum was to define a standard dialog design language that
|
|
developers could use to build conversational applications. They
|
|
chose XML as the basis for this effort because it was clear to
|
|
them that this was the direction technology was going.</p>
|
|
|
|
<p>In 2000, the VoiceXML Forum released VoiceXML 1.0 to the
|
|
public. Shortly thereafter, VoiceXML 1.0 was submitted to the W3C
|
|
as the basis for the creation of a new international standard.
|
|
VoiceXML 2.0 is the result of this work based on input from W3C
|
|
Member companies, other W3C Working Groups, and the public.</p>
|
|
|
|
<p>Developers familiar with VoiceXML 1.0 are particularly directed
|
|
to <a href="#dmlAChanges" shape="rect">Changes from Previous
|
|
Public Version</a> which summarizes how VoiceXML 2.0 differs from
|
|
VoiceXML 1.0.</p>
|
|
|
|
<h2 id="L904"><a id="dml1.1" name="dml1.1" shape="rect">1.1
|
|
Introduction</a></h2>
|
|
|
|
<p>VoiceXML is designed for creating audio dialogs that feature
|
|
synthesized speech, digitized audio, recognition of spoken and
|
|
DTMF key input, recording of spoken input, telephony, and
|
|
mixed initiative conversations. Its major goal is to bring the
|
|
advantages of Web-based development and content delivery to
|
|
interactive voice response applications.</p>
|
|
|
|
<p>Here are two short examples of VoiceXML. The first is the
|
|
venerable "Hello World":</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml 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"
|
|
version="2.0">
|
|
<form>
|
|
<block>Hello World!</block>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>The top-level element is <vxml>, which is mainly a
|
|
container for <i>dialogs</i>. There are two types of dialogs:
|
|
<i>forms</i> and <i>menus</i>. Forms present information and
|
|
gather input; menus offer choices of what to do next. This
|
|
example has a single form, which contains a block that
|
|
synthesizes and presents "Hello World!" to the user. Since the
|
|
form does not specify a successor dialog, the conversation
|
|
ends.</p>
|
|
|
|
<p>Our second example asks the user for a choice of drink and
|
|
then submits it to a server script:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml 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"
|
|
version="2.0">
|
|
<form>
|
|
<field name="drink">
|
|
<prompt>Would you like coffee, tea, milk, or nothing?</prompt>
|
|
<grammar src="drink.grxml" type="application/srgs+xml"/>
|
|
</field>
|
|
<block>
|
|
<submit next="http://www.drink.example.com/drink2.asp"/>
|
|
</block>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>A <i>field</i> is an input field. The user must provide a
|
|
value for the field before proceeding to the next element in the
|
|
form. A sample interaction is:</p>
|
|
|
|
<blockquote>
|
|
<p>C <span class="stage">(computer)</span>: Would you like
|
|
coffee, tea, milk, or nothing?</p>
|
|
|
|
<p>H <span class="stage">(human)</span>: Orange juice.</p>
|
|
|
|
<p>C: I did not understand what you said. <span class="stage">(a
|
|
platform-specific default message.)</span></p>
|
|
|
|
<p>C: Would you like coffee, tea, milk, or nothing?</p>
|
|
|
|
<p>H: Tea</p>
|
|
|
|
<p>C: <span class="stage">(continues in document
|
|
drink2.asp)</span></p>
|
|
</blockquote>
|
|
|
|
<h2 id="L960"><a id="dml1.2" name="dml1.2" shape="rect">1.2
|
|
Background</a></h2>
|
|
|
|
<p>This section contains a high-level architectural model, whose
|
|
terminology is then used to describe the goals of VoiceXML, its
|
|
scope, its design principles, and the requirements it places on
|
|
the systems that support it.</p>
|
|
|
|
<h3 id="L965"><a id="dml1.2.1" name="dml1.2.1" shape="rect">1.2.1
|
|
Architectural Model</a></h3>
|
|
|
|
<p>The architectural model assumed by this document has the
|
|
following components:</p>
|
|
|
|
<p class="fig"><img height="290"
|
|
alt="VoiceXML interpreter fits between document server and implementation platform"
|
|
src="Images/image005.gif" width="322" /><br />
|
|
Figure 1: Architectural Model</p>
|
|
|
|
<p>A <i>document server</i> (e.g. a Web server) processes
|
|
<i>requests</i> from a client application, <i>the VoiceXML
|
|
Interpreter</i>, through the <i>VoiceXML interpreter context</i>.
|
|
The server produces <i>VoiceXML documents</i> in reply, which are
|
|
processed by the VoiceXML interpreter. The VoiceXML interpreter
|
|
context may monitor user inputs in parallel with the VoiceXML
|
|
interpreter. For example, one VoiceXML interpreter context may
|
|
always listen for a special escape phrase that takes the user to
|
|
a high-level personal assistant, and another may listen for
|
|
escape phrases that alter user preferences like volume or
|
|
text-to-speech characteristics.</p>
|
|
|
|
<p>The <i>implementation platform</i> is controlled by the
|
|
VoiceXML interpreter context and by the VoiceXML interpreter. For
|
|
instance, in an interactive voice response application, the
|
|
VoiceXML interpreter context may be responsible for detecting an
|
|
incoming call, acquiring the initial VoiceXML document<i>,</i>
|
|
and answering the call, while the VoiceXML interpreter conducts
|
|
the dialog after answer. The implementation platform generates
|
|
events in response to user actions (e.g. spoken or character
|
|
input received, disconnect) and system events (e.g. timer
|
|
expiration). Some of these events are acted upon by the VoiceXML
|
|
interpreter itself, as specified by the VoiceXML document, while
|
|
others are acted upon by the VoiceXML interpreter context.</p>
|
|
|
|
<h3 id="L1000"><a id="dml1.2.2" name="dml1.2.2"
|
|
shape="rect">1.2.2 Goals of VoiceXML</a></h3>
|
|
|
|
<p>VoiceXML's main goal is to bring the full power of Web
|
|
development and content delivery to voice response applications,
|
|
and to free the authors of such applications from low-level
|
|
programming and resource management. It enables integration of
|
|
voice services with data services using the familiar
|
|
client-server paradigm. A voice service is viewed as a sequence
|
|
of interaction dialogs between a user and an implementation
|
|
platform. The dialogs are provided by document servers, which may
|
|
be external to the implementation platform. Document servers
|
|
maintain overall service logic, perform database and legacy
|
|
system operations, and produce dialogs. A VoiceXML document
|
|
specifies each interaction dialog to be conducted by a VoiceXML
|
|
interpreter. User input affects dialog interpretation and is
|
|
collected into requests submitted to a document server. The
|
|
document server replies with another VoiceXML document to
|
|
continue the user's session with other dialogs.</p>
|
|
|
|
<p>VoiceXML is a markup language that:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>Minimizes client/server interactions by specifying multiple
|
|
interactions per document.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Shields application authors from low-level, and
|
|
platform-specific details.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Separates user interaction code (in VoiceXML) from service
|
|
logic (e.g. CGI scripts).</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Promotes service portability across implementation platforms.
|
|
VoiceXML is a common language for content providers, tool
|
|
providers, and platform providers.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Is easy to use for simple interactions, and yet provides
|
|
language features to support complex dialogs.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>While VoiceXML strives to accommodate the requirements of a
|
|
majority of voice response services, services with stringent
|
|
requirements may best be served by dedicated applications that
|
|
employ a finer level of control.</p>
|
|
|
|
<h3 id="L1029"><a id="dml1.2.3" name="dml1.2.3"
|
|
shape="rect">1.2.3 Scope of VoiceXML</a></h3>
|
|
|
|
<p>The language describes the human-machine interaction provided
|
|
by voice response systems, which includes:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>Output of synthesized speech (text-to-speech).</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Output of audio files.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Recognition of spoken input.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Recognition of DTMF input.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Recording of spoken input.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Control of dialog flow.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Telephony features such as call transfer and disconnect.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>The language provides means for collecting character and/or
|
|
spoken input, assigning the input results to document-defined
|
|
request variables, and making decisions that affect the
|
|
interpretation of documents written in the language. A document
|
|
may be linked to other documents through Universal Resource
|
|
Identifiers (URIs).</p>
|
|
|
|
<h3 id="L1058"><a id="dml1.2.4" name="dml1.2.4"
|
|
shape="rect">1.2.4 Principles of Design</a></h3>
|
|
|
|
<p>VoiceXML is an XML application <a href="#ref_XML"
|
|
shape="rect">[XML]</a>.</p>
|
|
|
|
<ol>
|
|
<li>
|
|
<p>The language promotes portability of services through
|
|
abstraction of platform resources.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The language accommodates platform diversity in supported
|
|
audio file formats, speech grammar formats, and URI schemes.
|
|
While producers of platforms may support various grammar formats
|
|
the language requires a common grammar format, namely the XML
|
|
Form of the W3C Speech Recognition Grammar Specification <a
|
|
href="#ref_SRGS" shape="rect">[SRGS]</a>, to facilitate
|
|
interoperability. Similarly, while various audio formats for
|
|
playback and recording may be supported, the audio formats
|
|
described in <a href="#dmlAAudioFormats" shape="rect">Appendix
|
|
E</a> must be supported</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The language supports ease of authoring for common types of
|
|
interactions.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The language has well-defined semantics that preserves the
|
|
author's intent regarding the behavior of interactions with the
|
|
user. Client heuristics are not required to determine document
|
|
element interpretation.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The language recognizes semantic interpretations from grammars
|
|
and makes this information available to the application.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The language has a control flow mechanism.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The language enables a separation of service logic from
|
|
interaction behavior.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>It is not intended for intensive computation, database
|
|
operations, or legacy system operations. These are assumed to be
|
|
handled by resources outside the document interpreter, e.g. a
|
|
document server.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>General service logic, state management, dialog generation,
|
|
and dialog sequencing are assumed to reside outside the document
|
|
interpreter.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The language provides ways to link documents using URIs, and
|
|
also to submit data to server scripts using URIs.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>VoiceXML provides ways to identify exactly which data to
|
|
submit to the server, and which HTTP method (GET or POST) to use
|
|
in the submittal.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The language does not require document authors to explicitly
|
|
allocate and deallocate dialog resources, or deal with
|
|
concurrency. Resource allocation and concurrent threads of
|
|
control are to be handled by the implementation platform.</p>
|
|
</li>
|
|
</ol>
|
|
|
|
<h3 id="L1106"><a id="dml1.2.5" name="dml1.2.5"
|
|
shape="rect">1.2.5 Implementation Platform Requirements</a></h3>
|
|
|
|
<p>This section outlines the requirements on the
|
|
hardware/software platforms that will support a VoiceXML
|
|
interpreter.</p>
|
|
|
|
<p><b>Document acquisition.</b> The interpreter context is
|
|
expected to acquire documents for the VoiceXML interpreter to act
|
|
on. The "http" URI scheme must be supported. In some cases, the
|
|
document request is generated by the interpretation of a VoiceXML
|
|
document, while other requests are generated by the interpreter
|
|
context in response to events outside the scope of the language,
|
|
for example an incoming phone call. When issuing document
|
|
requests via http, the interpreter context identifies itself
|
|
using the "User-Agent" header variable with the value
|
|
"<name>/<version>", for example,
|
|
"acme-browser/1.2"</p>
|
|
|
|
<p><b>Audio output.</b> An implementation platform must support
|
|
audio output using audio files and text-to-speech (TTS). The
|
|
platform must be able to freely sequence TTS and audio output. If
|
|
an audio output resource is not available, an error.noresource
|
|
event must be thrown. Audio files are referred to by a URI. The
|
|
language specifies a required set of audio file formats which
|
|
must be supported (see <a href="#dmlAAudioFormats"
|
|
shape="rect">Appendix E</a>); additional audio file formats may
|
|
also be supported.</p>
|
|
|
|
<p><b>Audio input.</b> An implementation platform is required to
|
|
detect and report character and/or spoken input simultaneously
|
|
and to control input detection interval duration with a timer
|
|
whose length is specified by a VoiceXML document. If an audio
|
|
input resource is not available, an error.noresource event must
|
|
be thrown.</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>It must report <u>characters</u> (for example, DTMF) entered
|
|
by a user. Platforms must support the XML form of DTMF grammars
|
|
described in the W3C Speech Recognition Grammar Specification
|
|
<a href="#ref_SRGS" shape="rect">[SRGS]</a>. They should also
|
|
support the Augmented BNF (ABNF) form of DTMF grammars described
|
|
in the W3C Speech Recognition Grammar Specification
|
|
<a href="#ref_SRGS" shape="rect">[SRGS]</a>.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>It must be able to receive <u>speech recognition</u> grammar
|
|
data dynamically. It must be able to use speech grammar data in
|
|
the XML Form of the W3C Speech Recognition Grammar Specification
|
|
<a href="#ref_SRGS" shape="rect">[SRGS]</a>. It should be able to
|
|
receive speech recognition grammar data in the ABNF form of the
|
|
W3C Speech Recognition Grammar Specification <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a>, and may support other formats such as
|
|
the JSpeech Grammar Format <a href="#ref_JSGF"
|
|
shape="rect">[JSGF]</a> or proprietary formats. Some VoiceXML
|
|
elements contain speech grammar data; others refer to speech
|
|
grammar data through a URI. The speech recognizer must be able to
|
|
accommodate dynamic update of the spoken input for which it is
|
|
listening through either method of speech grammar data
|
|
specification.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>It must be able to <u>record</u> audio received from the user.
|
|
The implementation platform must be able to make the recording
|
|
available to a <i>request</i> variable. The language specifies a
|
|
required set of recorded audio file formats which must be
|
|
supported (see <a href="#dmlAAudioFormats" shape="rect">Appendix
|
|
E</a>); additional formats may also be supported.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p><b>Transfer</b> The platform should be able to support making
|
|
a third party connection through a communications network, such
|
|
as the telephone.</p>
|
|
|
|
<h2 id="L1170"><a id="dml1.3" name="dml1.3" shape="rect">1.3
|
|
Concepts</a></h2>
|
|
|
|
<p>A VoiceXML <i>document</i> (or a set of related documents
|
|
called an <i>application</i>) forms a conversational finite state
|
|
machine. The user is always in one conversational state, or
|
|
<i>dialog</i>, at a time. Each dialog determines the next dialog
|
|
to transition to. <i>Transitions</i> are specified using URIs,
|
|
which define the next document and dialog to use. If a URI does
|
|
not refer to a document, the current document is assumed. If it
|
|
does not refer to a dialog, the first dialog in the document is
|
|
assumed. Execution is terminated when a dialog does not specify
|
|
a successor, or if it has an element that explicitly exits the
|
|
conversation.</p>
|
|
|
|
<h3 id="L1187"><a id="dml1.3.1" name="dml1.3.1"
|
|
shape="rect">1.3.1 Dialogs and Subdialogs</a></h3>
|
|
|
|
<p>There are two kinds of dialogs: <i>forms</i> and <i>menus</i>.
|
|
Forms define an interaction that collects values for a set of
|
|
form item variables. Each field may specify a grammar that
|
|
defines the allowable inputs for that field. If a form-level
|
|
grammar is present, it can be used to fill several fields from
|
|
one utterance. A menu presents the user with a choice of options
|
|
and then transitions to another dialog based on that choice.</p>
|
|
|
|
<p>A <i>subdialog</i> is like a function call, in that it
|
|
provides a mechanism for invoking a new interaction, and
|
|
returning to the original form. Variable instances, grammars, and
|
|
state information are saved and are available upon returning to
|
|
the calling document. Subdialogs can be used, for example, to
|
|
create a confirmation sequence that may require a database query;
|
|
to create a set of components that may be shared among documents
|
|
in a single application; or to create a reusable library of
|
|
dialogs shared among many applications.</p>
|
|
|
|
<h3 id="L1203"><a id="dml1.3.2" name="dml1.3.2"
|
|
shape="rect">1.3.2 Sessions</a></h3>
|
|
|
|
<p>A <i>session</i> begins when the user starts to interact with
|
|
a VoiceXML interpreter context, continues as documents are loaded
|
|
and processed, and ends when requested by the user, a document,
|
|
or the interpreter context.</p>
|
|
|
|
<h3 id="L1211"><a id="dml1.3.3" name="dml1.3.3"
|
|
shape="rect">1.3.3 Applications</a></h3>
|
|
|
|
<p>An <i>application</i> is a set of documents sharing the same
|
|
<i>application root document</i>. Whenever the user interacts
|
|
with a document in an application, its application root document
|
|
is also loaded. The application root document remains loaded
|
|
while the user is transitioning between other documents in the
|
|
same application, and it is unloaded when the user transitions to
|
|
a document that is not in the application. While it is loaded,
|
|
the application root document's variables are available to the
|
|
other documents as application variables, and its grammars remain
|
|
active for the duration of the application, subject to the grammar
|
|
activation rules discussed in <a href="#dml3.1.4"
|
|
shape="rect">Section 3.1.4</a>.</p>
|
|
|
|
<p>Figure 2 shows the transition of documents (D) in an
|
|
application that share a common application root document
|
|
(root).</p>
|
|
|
|
<p class="fig"><img height="191"
|
|
alt="root over sequence of 3 documents" src="Images/image006.gif"
|
|
width="227" /><br />
|
|
Figure 2: Transitioning between documents in an application.</p>
|
|
|
|
<h3 id="L1234"><a id="dml1.3.4" name="dml1.3.4"
|
|
shape="rect">1.3.4 Grammars</a></h3>
|
|
|
|
<p>Each dialog has one or more speech and/or DTMF <i>grammars</i>
|
|
associated with it. In <i>machine directed</i> applications, each
|
|
dialog's grammars are active only when the user is in that
|
|
dialog. In <i>mixed initiative</i> applications, where the user
|
|
and the machine alternate in determining what to do next, some of
|
|
the dialogs are flagged to make their grammars <i>active</i>
|
|
(i.e., listened for) even when the user is in another dialog in
|
|
the same document, or on another loaded document in the same
|
|
application. In this situation, if the user says something
|
|
matching another dialog's active grammars, execution
|
|
transitions to that other dialog, with the user's utterance
|
|
treated as if it were said in that dialog. Mixed initiative adds
|
|
flexibility and power to voice applications.</p>
|
|
|
|
<h3 id="L1257"><a id="dml1.3.5" name="dml1.3.5"
|
|
shape="rect">1.3.5 Events</a></h3>
|
|
|
|
<p>VoiceXML provides a form-filling mechanism for handling
|
|
"normal" user input. In addition, VoiceXML defines a mechanism
|
|
for handling events not covered by the form mechanism.</p>
|
|
|
|
<p>Events are thrown by the platform under a variety of
|
|
circumstances, such as when the user does not respond, doesn't
|
|
respond intelligibly, requests help, etc. The interpreter also
|
|
throws events if it finds a semantic error in a VoiceXML
|
|
document. Events are caught by catch elements or their syntactic
|
|
shorthand. Each element in which an event can occur may specify
|
|
catch elements. Furthermore, catch elements are also inherited
|
|
from enclosing elements "as if by copy". In this way, common
|
|
event handling behavior can be specified at any level, and it
|
|
applies to all lower levels.</p>
|
|
|
|
<h3 id="L1264"><a id="dml1.3.6" name="dml1.3.6"
|
|
shape="rect">1.3.6 Links</a></h3>
|
|
|
|
<p>A <i>link</i> supports mixed initiative. It specifies a
|
|
grammar that is active whenever the user is in the scope of the
|
|
link. If user input matches the link's grammar, control
|
|
transfers to the link's destination URI. A link can be used
|
|
to throw an event or go to a destination URI.</p>
|
|
|
|
<h2 id="L1276"><a id="dml1.4" name="dml1.4" shape="rect">1.4
|
|
VoiceXML Elements</a></h2>
|
|
|
|
<div align="center">
|
|
<table cellspacing="0" cellpadding="4" width="80%" border="1"
|
|
summary="Table 1: VoiceXML Elements">
|
|
<caption align="bottom">Table 1: VoiceXML Elements</caption>
|
|
|
|
<thead>
|
|
<tr>
|
|
<th>Element</th>
|
|
<th>Purpose</th>
|
|
<th>Section</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<td><assign></td>
|
|
<td>Assign a variable a value</td>
|
|
<td><a href="#dml5.3.2"
|
|
shape="rect">5.3.2</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><audio></td>
|
|
<td>Play an audio clip within a
|
|
prompt</td>
|
|
<td><a href="#dml4.1.3"
|
|
shape="rect">4.1.3</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><block></td>
|
|
<td>A container of (non-interactive)
|
|
executable code</td>
|
|
<td><a href="#dml2.3.2"
|
|
shape="rect">2.3.2</a></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><catch></td>
|
|
<td>Catch an event</td>
|
|
<td><a href="#dml5.2.2"
|
|
shape="rect">5.2.2</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><choice></td>
|
|
<td>Define a menu item</td>
|
|
<td><a href="#dml2.2.2"
|
|
shape="rect">2.2.2</a></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><clear></td>
|
|
<td>Clear one or more form item
|
|
variables</td>
|
|
<td><a href="#dml5.3.3"
|
|
shape="rect">5.3.3</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><disconnect></td>
|
|
<td>Disconnect a session</td>
|
|
<td><a href="#dml5.3.11"
|
|
shape="rect">5.3.11</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><else></td>
|
|
<td>Used in <if> elements</td>
|
|
<td><a href="#dml5.3.4"
|
|
shape="rect">5.3.4</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><elseif></td>
|
|
<td>Used in <if> elements</td>
|
|
<td><a href="#dml5.3.4"
|
|
shape="rect">5.3.4</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><enumerate></td>
|
|
<td>Shorthand for enumerating the choices
|
|
in a menu</td>
|
|
<td><a href="#dml2.2.4"
|
|
shape="rect">2.2.4</a></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><error></td>
|
|
<td>Catch an error event</td>
|
|
<td><a href="#dml5.2.3"
|
|
shape="rect">5.2.3</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><exit></td>
|
|
<td>Exit a session</td>
|
|
<td><a href="#dml5.3.9"
|
|
shape="rect">5.3.9</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><field></td>
|
|
<td>Declares an input field in a
|
|
form</td>
|
|
<td><a href="#dml2.3.1"
|
|
shape="rect">2.3.1</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><filled></td>
|
|
<td>An action executed when fields are
|
|
filled</td>
|
|
<td><a href="#dml2.4"
|
|
shape="rect">2.4</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><form></td>
|
|
<td>A dialog for presenting information
|
|
and collecting data</td>
|
|
<td><a href="#dml2.1"
|
|
shape="rect">2.1</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><goto></td>
|
|
<td>Go to another dialog in the same or
|
|
different document</td>
|
|
<td><a href="#dml5.3.7"
|
|
shape="rect">5.3.7</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><grammar></td>
|
|
<td>Specify a speech recognition or DTMF
|
|
grammar</td>
|
|
<td><a href="#dml3.1"
|
|
shape="rect">3.1</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><help></td>
|
|
<td>Catch a help event</td>
|
|
<td><a href="#dml5.2.3"
|
|
shape="rect">5.2.3</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><if></td>
|
|
<td>Simple conditional logic</td>
|
|
<td><a href="#dml5.3.4"
|
|
shape="rect">5.3.4</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><initial></td>
|
|
<td>Declares initial logic upon entry
|
|
into a (mixed initiative) form</td>
|
|
<td><a href="#dml2.3.3"
|
|
shape="rect">2.3.3</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><link></td>
|
|
<td>Specify a transition common to all
|
|
dialogs in the link's scope</td>
|
|
<td><a href="#dml2.5"
|
|
shape="rect">2.5</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><log></td>
|
|
<td>Generate a debug message</td>
|
|
<td><a href="#dml5.3.13"
|
|
shape="rect">5.3.13</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><menu></td>
|
|
<td>A dialog for choosing amongst
|
|
alternative destinations</td>
|
|
<td><a href="#dml2.2.1"
|
|
shape="rect">2.2.1</a></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><meta></td>
|
|
<td>Define a metadata item as a
|
|
name/value pair</td>
|
|
<td><a href="#dml6.2.1"
|
|
shape="rect">6.2.1</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><metadata></td>
|
|
<td>Define metadata information using a
|
|
metadata schema</td>
|
|
<td><a href="#dml6.2.2"
|
|
shape="rect">6.2.2</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><noinput></td>
|
|
<td>Catch a noinput event</td>
|
|
<td><a href="#dml5.2.3"
|
|
shape="rect">5.2.3</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><nomatch></td>
|
|
<td>Catch a nomatch event</td>
|
|
<td><a href="#dml5.2.3"
|
|
shape="rect">5.2.3</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><object></td>
|
|
<td>Interact with a custom extension</td>
|
|
<td><a href="#dml2.3.5"
|
|
shape="rect">2.3.5</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><option></td>
|
|
<td>Specify an option in a
|
|
<field></td>
|
|
<td><a href="#dml2.3.1.3"
|
|
shape="rect">2.3.1.3</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><param></td>
|
|
<td>Parameter in <object> or
|
|
<subdialog></td>
|
|
<td><a href="#dml6.4"
|
|
shape="rect">6.4</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><prompt></td>
|
|
<td>Queue speech synthesis and audio
|
|
output to the user</td>
|
|
<td><a href="#dml4.1"
|
|
shape="rect">4.1</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><property></td>
|
|
<td>Control implementation platform
|
|
settings.</td>
|
|
<td><a href="#dml6.3"
|
|
shape="rect">6.3</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><record></td>
|
|
<td>Record an audio sample</td>
|
|
<td><a href="#dml2.3.6"
|
|
shape="rect">2.3.6</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><reprompt></td>
|
|
<td>Play a field prompt when a field is
|
|
re-visited after an event</td>
|
|
<td><a href="#dml5.3.6"
|
|
shape="rect">5.3.6</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><return></td>
|
|
<td>Return from a subdialog.</td>
|
|
<td><a href="#dml5.3.10"
|
|
shape="rect">5.3.10</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><script></td>
|
|
<td>Specify a block of ECMAScript
|
|
client-side scripting logic</td>
|
|
<td><a href="#dml5.3.12"
|
|
shape="rect">5.3.12</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><subdialog></td>
|
|
<td>Invoke another dialog as a subdialog
|
|
of the current one</td>
|
|
<td><a href="#dml2.3.4"
|
|
shape="rect">2.3.4</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><submit></td>
|
|
<td>Submit values to a document
|
|
server</td>
|
|
<td><a href="#dml5.3.8"
|
|
shape="rect">5.3.8</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><throw></td>
|
|
<td>Throw an event.</td>
|
|
<td><a href="#dml5.2.1"
|
|
shape="rect">5.2.1</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><transfer></td>
|
|
<td>Transfer the caller to another
|
|
destination</td>
|
|
<td><a href="#dml2.3.7"
|
|
shape="rect">2.3.7</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><value></td>
|
|
<td>Insert the value of an expression in
|
|
a prompt</td>
|
|
<td><a href="#dml4.1.4"
|
|
shape="rect">4.1.4</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><var></td>
|
|
<td>Declare a variable</td>
|
|
<td><a href="#dml5.3.1"
|
|
shape="rect">5.3.1</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><vxml></td>
|
|
<td>Top-level element in each VoiceXML
|
|
document</td>
|
|
<td><a href="#dml1.5.1"
|
|
shape="rect">1.5.1</a> </td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<h2 id="L1767"><a id="dml1.5" name="dml1.5" shape="rect">1.5
|
|
Document Structure and Execution</a></h2>
|
|
|
|
<p>A VoiceXML document is primarily composed of top-level
|
|
elements called <i>dialogs</i>. There are two types of dialogs:
|
|
<i>forms</i> and <i>menus</i>. A document may also have
|
|
<meta> and <metadata> elements, <var> and
|
|
<script> elements, <property> elements, <catch>
|
|
elements, and <link> elements.</p>
|
|
|
|
<h3 id="L1781"><a id="dml1.5.1" name="dml1.5.1"
|
|
shape="rect">1.5.1 Execution within One Document</a></h3>
|
|
|
|
<p>Document execution begins at the first dialog by default. As
|
|
each dialog executes, it determines the next dialog. When a
|
|
dialog doesn't specify a successor dialog, document
|
|
execution stops.</p>
|
|
|
|
<p>Here is "Hello World!" expanded to illustrate some of this. It
|
|
now has a document level variable called "hi" which holds the
|
|
greeting. Its value is used as the prompt in the first form. Once
|
|
the first form plays the greeting, it goes to the form named
|
|
"say_goodbye", which prompts the user with "Goodbye!" Because the
|
|
second form does not transition to another dialog, it causes the
|
|
document to be exited.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml 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"
|
|
version="2.0">
|
|
<meta name="author" content="John Doe"/>
|
|
<meta name="maintainer" content="hello-support@hi.example.com"/>
|
|
<var name="hi" expr="'Hello World!'"/>
|
|
<form>
|
|
<block>
|
|
<value expr="hi"/>
|
|
<goto next="#say_goodbye"/>
|
|
</block>
|
|
</form>
|
|
<form id="say_goodbye">
|
|
<block>
|
|
Goodbye!
|
|
</block>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>Alternatively the forms can be combined:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml 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"
|
|
version="2.0">
|
|
<meta name="author" content="John Doe"/>
|
|
<meta name="maintainer" content="hello-support@hi.example.com"/>
|
|
<var name="hi" expr="'Hello World!'"/>
|
|
<form>
|
|
<block>
|
|
<value expr="hi"/> Goodbye!
|
|
</block>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>Attributes of <vxml> include:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 2: vxml attributes">
|
|
<caption align="bottom">Table 2: <vxml>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>version</th>
|
|
<td>The version of VoiceXML of this
|
|
document (required). The current version number is 2.0.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>xmlns</th>
|
|
<td>The designated namespace for VoiceXML
|
|
(required). The namespace for VoiceXML is defined to be
|
|
http://www.w3.org/2001/vxml.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>xml:base</th>
|
|
<td>The base URI for this document as
|
|
defined in <a href="#ref_XML-BASE" shape="rect">[XML-BASE]</a>.
|
|
As in <a href="#ref_HTML" shape="rect">[HTML]</a>, a URI which
|
|
all relative references within the document take as their
|
|
base.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>xml:lang</th>
|
|
<td>The <a href="#term-language"
|
|
shape="rect">language identifier</a> for this document .
|
|
If omitted, the value is a platform-specific default.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>application</th>
|
|
<td>The URI of this document's
|
|
application root document, if any.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Language information is inherited down the document hierarchy:
|
|
the value of "xml:lang" is inherited by elements which also
|
|
define the "xml:lang" attribute, such as <grammar> and
|
|
<prompt>, unless these elements specify an alternative
|
|
value.</p>
|
|
|
|
<h3 id="L1843"><a id="dml1.5.2" name="dml1.5.2"
|
|
shape="rect">1.5.2 Executing a Multi-Document
|
|
Application</a></h3>
|
|
|
|
<p>Normally, each document runs as an isolated application. In
|
|
cases where you want multiple documents to work together as one
|
|
application, you select one document to be the <i>application
|
|
root document</i>, and the rest to be <i>application leaf
|
|
documents</i>. Each leaf document names the root document in its
|
|
<vxml> element.</p>
|
|
|
|
<p>When this is done, every time the interpreter is told to load
|
|
and execute a leaf document in this application, it first loads
|
|
the application root document if it is not already loaded. The
|
|
application root document remains loaded until the interpreter is
|
|
told to load a document that belongs to a different application.
|
|
Thus one of the following two conditions always holds during
|
|
interpretation:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>The application root document is loaded and the user is
|
|
executing in it: there is no leaf document.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The application root document and a single leaf document are
|
|
both loaded and the user is executing in the leaf document.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>If there is a chain of subdialogs defined in separate
|
|
documents, then there may be more than one leaf document loaded
|
|
although execution will only be in one of these documents.</p>
|
|
|
|
<p>When a leaf document load causes a root document load, none of
|
|
the dialogs in the root document are executed. Execution begins
|
|
in the leaf document.</p>
|
|
|
|
<p>There are several benefits to multi-document applications.</p>
|
|
|
|
<ul>
|
|
<li>The root document's variables are available for use by the
|
|
leaf documents, so that information can be shared and
|
|
retained.</li>
|
|
|
|
<li>Root document <property> elements specify default
|
|
values for properties used in the leaf documents.</li>
|
|
|
|
<li>Common ECMAScript code can be defined in root document
|
|
<script> elements and used in the leaf documents.</li>
|
|
|
|
<li>Root document <catch> elements define default event
|
|
handling for the leaf documents.</li>
|
|
|
|
<li>Document-scoped grammars in the root document are active when
|
|
the user is in a leaf document, so that the user is able to
|
|
interact with forms, links, and menus in the root document.</li>
|
|
</ul>
|
|
|
|
<p>Here is a two-document application illustrating this:</p>
|
|
|
|
<p><b>Application root document</b> (app-root.vxml)</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml 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"
|
|
version="2.0">
|
|
<var name="bye" expr="'Ciao'"/>
|
|
<link next="operator_xfer.vxml">
|
|
<grammar type="application/srgs+xml" root="root" version="1.0">
|
|
<rule id="root" scope="public">operator</rule>
|
|
</grammar>
|
|
</link>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p><b>Leaf document</b> (leaf.vxml)</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml 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"
|
|
version="2.0" application="app-root.vxml">
|
|
<form id="say_goodbye">
|
|
<field name="answer">
|
|
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
|
|
<prompt>Shall we say <value expr="application.bye"/>?</prompt>
|
|
<filled>
|
|
<if cond="answer">
|
|
<exit/>
|
|
</if>
|
|
<clear namelist="answer"/>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>In this example, the application is designed so that leaf.vxml
|
|
must be loaded first. Its application attribute specifies that
|
|
app-root.vxml should be used as the application root document.
|
|
So, app-root.vxml is then loaded, which creates the application
|
|
variable bye and also defines a link that navigates to
|
|
operator-xfer.vxml whenever the user says "operator". The user
|
|
starts out in the say_goodbye form:</p>
|
|
|
|
<blockquote>
|
|
<p>C: Shall we say Ciao?</p>
|
|
|
|
<p>H: Si.</p>
|
|
|
|
<p>C: I did not understand what you said. <span class="stage">(a
|
|
platform-specific default message.)</span></p>
|
|
|
|
<p>C: Shall we say Ciao?</p>
|
|
|
|
<p>H: Ciao</p>
|
|
|
|
<p>C: I did not understand what you said.</p>
|
|
|
|
<p>H: Operator.</p>
|
|
|
|
<p>C: <span class="stage">(Goes to operator_xfer.vxml, which
|
|
transfers the caller to a human operator.)</span></p>
|
|
</blockquote>
|
|
|
|
<p>Note that when the user is in a multi-document application, at
|
|
most two documents are loaded at any one time: the application
|
|
root document and, unless the user is actually interacting with
|
|
the application root document, an application leaf document. A
|
|
root document's <vxml> element does not have an application
|
|
attribute specified. A leaf document's <vxml> element does
|
|
have an application attribute specified. An interpreter always
|
|
has an application root document loaded; it does not always have
|
|
an application leaf document loaded.</p>
|
|
|
|
<p><a id="appNameDefn" name="appNameDefn" shape="rect">The
|
|
<i>name</i> of the interpreter's current application is the
|
|
application root document's absolute URI</a>. The absolute URI
|
|
includes a query string, if present, but it does not include a
|
|
fragment identifier. The interpreter remains in the same
|
|
application as long as the name remains the same. When the name
|
|
changes, a new application is entered and its root context is
|
|
initialized. The application's root context consists of the
|
|
variables, grammars, catch elements, scripts, and properties in
|
|
application scope.</p>
|
|
|
|
<p>During a user session an interpreter transitions from one
|
|
document to another as requested by <choice>, <goto>
|
|
<link>, <subdialog>, and <submit> elements.
|
|
Some transitions are within an application, others are between
|
|
applications. The preservation or initialization of the root
|
|
context depends on the type of transition:</p>
|
|
|
|
<dl>
|
|
<dt>Root to Leaf Within Application</dt>
|
|
|
|
<dd>A root to leaf transition within the same application occurs
|
|
when the current document is a root document and the target
|
|
document's application attribute's value resolves to the same
|
|
absolute URI as the name of the current application. The
|
|
application root document and its context are preserved.</dd>
|
|
|
|
<dt>Leaf to Leaf Within Application</dt>
|
|
|
|
<dd>A leaf to leaf transition within the same application occurs
|
|
when the current document is a leaf document and the target
|
|
document's application attribute's value resolves to the same
|
|
absolute URI as the name of the current application. The
|
|
application root document and its context are preserved.</dd>
|
|
|
|
<dt>Leaf to Root Within Application</dt>
|
|
|
|
<dd>A leaf to root transition within the same application occurs
|
|
when the current document is a leaf document and the target
|
|
document's absolute URI is the same as the name of the current
|
|
application. The current application root document and its
|
|
context are preserved when the transition is caused by a
|
|
<choice>, <goto>, or <link> element. The root
|
|
context is initialized when a <submit> element causes the
|
|
leaf to root transition, because a <submit> always results
|
|
in a fetch of its URI.</dd>
|
|
|
|
<dt>Root to Root</dt>
|
|
|
|
<dd>A root to root transition occurs when the current document is
|
|
a root document and the target document is a root document, i.e.
|
|
it does not have an application attribute. The root context is
|
|
initialized with the application root document returned by the
|
|
caching policy in <a href="#dml6.1.2" shape="rect">Section
|
|
6.1.2</a>. The caching policy is consulted even when the <a
|
|
href="#appNameDefn" shape="rect">name</a> of the target
|
|
application and the current application are the same.</dd>
|
|
|
|
<dt>Subdialog</dt>
|
|
|
|
<dd>A subdialog invocation occurs when a root or leaf document
|
|
executes a <subdialog> element. As discussed in <a
|
|
href="#dml2.3.4" shape="rect">Section 2.3.4</a>, subdialog
|
|
invocation creates a new execution context. The application root
|
|
document and its context in the calling document's execution
|
|
context are preserved untouched during subdialog execution, and
|
|
are used again once the subdialog returns. A subdialog's new
|
|
execution context has its own root context and, possibly, leaf
|
|
context. When the subdialog is invoked with a non-empty URI
|
|
reference, the caching policy in <a href="#dml6.1.2"
|
|
shape="rect">Section 6.1.2</a> is used to acquire the root and
|
|
leaf documents that will be used to initialize the new root and
|
|
leaf contexts. If a subdialog is invoked with an empty URI
|
|
reference and a fragment identifier, e.g. "#sub1", the root and
|
|
leaf documents remain unchanged, and therefore the current root
|
|
and leaf documents will be used to initialize the new root and
|
|
leaf contexts.</dd>
|
|
|
|
<dt>Inter-Application Transitions</dt>
|
|
|
|
<dd>All other transitions are between applications which cause
|
|
the application root context to be initialized with the next
|
|
application's root document.</dd>
|
|
</dl>
|
|
|
|
<p>If a document refers to a non-existent application root
|
|
document, an error.badfetch event is thrown. If a document's
|
|
application attribute refers to a document that also has an
|
|
application attribute specified, an error.semantic event is
|
|
thrown.</p>
|
|
|
|
<p>The following diagrams illustrate the effect of the
|
|
transitions between root and leaf documents on the application
|
|
root context. In these diagrams, boxes represent documents, box
|
|
texture changes identify root context initialization, solid
|
|
arrows symbolize transitions to the URI in the arrow's label,
|
|
dashed vertical arrows indicate an application attribute whose
|
|
URI is the arrow's label.</p>
|
|
|
|
<p class="fig"><img
|
|
alt="Transitions that Preserve the Root Context"
|
|
src="Images/image021.gif" /><br />
|
|
Figure 3: Transitions that Preserve the Root Context<br
|
|
clear="none" />
|
|
</p>
|
|
|
|
<p>In this diagram, all the documents belong to the same
|
|
application. The transitions are identified by the numbers 1-4
|
|
across the top of the figure. They are:</p>
|
|
|
|
<ol>
|
|
<li>A transition to URI A results in document 1, the application
|
|
context is initialized from document 1's content. Assume that
|
|
this is the first document in the session. The current
|
|
application's name is A.</li>
|
|
|
|
<li>Document 1 specifies a transition to URI B, which yields
|
|
document 2. Document 2's application attribute equals URI A. The
|
|
root is document 1 with its context preserved. This is a root to
|
|
leaf transition within the same application.</li>
|
|
|
|
<li>Document 2 specifies a transition to URI C, which yields
|
|
another leaf document, document 3. Its application attribute also
|
|
equals URI A. The root is document 1 with its context preserved.
|
|
This is a leaf to leaf transition within the same
|
|
application.</li>
|
|
|
|
<li>Document 3 specifies a transition to URI A using a
|
|
<choice>, <goto>, or <link>. Document 1 is used
|
|
with its root context intact. This is a leaf to root transition
|
|
within the same application.</li>
|
|
</ol>
|
|
|
|
<p>The next diagram illustrates transitions which initialize the
|
|
root context.</p>
|
|
|
|
<p class="fig"><img
|
|
alt="Transitions that Initialize the Root Context"
|
|
src="Images/image022.gif" /><br />
|
|
Figure 4: Transitions that Initialize the Root Context<br
|
|
clear="none" />
|
|
</p>
|
|
|
|
<ol start="5">
|
|
<li>Document 1 specifies a transition to its own URI A. The
|
|
resulting document 4 does not have an application attribute, so
|
|
it is considered a root document, and the root context is
|
|
initialized. This is a root to root transition.</li>
|
|
|
|
<li>Document 4 specifies a transition to URI D, which yields a
|
|
leaf document 5. Its application attribute is different: URI E. A
|
|
new application is being entered. URI E produces the root
|
|
document 6. The root context is initialized from the content of
|
|
document 6. This is an inter-application transition.</li>
|
|
|
|
<li>Document 5 specifies a transition to URI A. The cache check
|
|
returns document 4 which does not have an application attribute
|
|
and therefore belongs to application A, so the root context is
|
|
initialized. Initialization occurs even though this application
|
|
and this root document were used earlier in the session. This is
|
|
an inter-application transition.</li>
|
|
</ol>
|
|
|
|
<h3 id="L1999"><a id="dml1.5.3" name="dml1.5.3"
|
|
shape="rect">1.5.3 Subdialogs</a></h3>
|
|
|
|
<p>A subdialog is a mechanism for decomposing complex sequences
|
|
of dialogs to better structure them, or to create reusable
|
|
components. For example, the solicitation of account information
|
|
may involve gathering several pieces of information, such as
|
|
account number, and home telephone number. A customer care
|
|
service might be structured with several independent applications
|
|
that could share this basic building block, thus it would be
|
|
reasonable to construct it as a subdialog. This is illustrated in
|
|
the example below. The first document, app.vxml, seeks to adjust
|
|
a customer's account, and in doing so must get the account
|
|
information and then the adjustment level. The account
|
|
information is obtained by using a subdialog element that invokes
|
|
another VoiceXML document to solicit the user input. While the
|
|
second document is being executed, the calling dialog is
|
|
suspended, awaiting the return of information. The second
|
|
document provides the results of its user interactions using a
|
|
<return> element, and the resulting values are accessed
|
|
through the variable defined by the name attribute on the
|
|
<subdialog> element.</p>
|
|
|
|
<p><b>Customer Service Application</b> (app.vxml)</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml 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"
|
|
version="2.0">
|
|
<form id="billing_adjustment">
|
|
<var name="account_number"/>
|
|
<var name="home_phone"/>
|
|
<subdialog name="accountinfo" src="acct_info.vxml#basic">
|
|
<filled>
|
|
<!-- Note the variable defined by "accountinfo" is
|
|
returned as an ECMAScript object and it contains two
|
|
properties defined by the variables specified in the
|
|
"return" element of the subdialog. -->
|
|
|
|
<assign name="account_number" expr="accountinfo.acctnum"/>
|
|
<assign name="home_phone" expr="accountinfo.acctphone"/>
|
|
</filled>
|
|
</subdialog>
|
|
|
|
<field name="adjustment_amount">
|
|
<grammar type="application/srgs+xml" src="/grammars/currency.grxml"/>
|
|
<prompt>
|
|
What is the value of your account adjustment?
|
|
</prompt>
|
|
<filled>
|
|
<submit next="/cgi-bin/updateaccount"/>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p><b>Document Containing Account Information Subdialog</b>
|
|
(acct_info.vxml)</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml 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"
|
|
version="2.0">
|
|
<form id="basic">
|
|
<field name="acctnum">
|
|
<grammar type="application/srgs+xml" src="/grammars/digits.grxml"/>
|
|
<prompt> What is your account number? </prompt>
|
|
</field>
|
|
<field name="acctphone">
|
|
<grammar type="application/srgs+xml" src="/grammars/phone_numbers.grxml"/>
|
|
<prompt> What is your home telephone number? </prompt>
|
|
<filled>
|
|
<!-- The values obtained by the two fields are supplied
|
|
to the calling dialog by the "return" element. -->
|
|
<return namelist="acctnum acctphone"/>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>Subdialogs add a new execution context when they are
|
|
invoked.The subdialog could be a new dialog within the existing
|
|
document, or a new dialog within a new document.</p>
|
|
|
|
<p>Subdialogs can be composed of several documents. Figure 5
|
|
shows the execution flow where a sequence of documents (D)
|
|
transitions to a subdialog (SD) and then back.</p>
|
|
|
|
<p class="fig"><img
|
|
alt="subdialog composed of several documents, returning from the last subdialog document"
|
|
src="Images/image019.gif" /><br />
|
|
Figure 5: Subdialog composed of several documents<br
|
|
clear="none" />
|
|
returning from the last subdialog document.</p>
|
|
|
|
<p>The execution context in dialog D2 is suspended when it
|
|
invokes the subdialog SD1 in document sd1.vxml. This subdialog
|
|
specifies execution is to be transfered to the dialog in sd2.vxml
|
|
(using <goto>). Consequently, when the dialog in sd2.vxml
|
|
returns, control is returned directly to dialog D2.</p>
|
|
|
|
<p>Figure 6 shows an example of a multi-document subdialog where
|
|
control is transferred from one subdialog to another.</p>
|
|
|
|
<p class="fig"><img
|
|
alt="subdialog composed of several documents, returning from the first subdialog document"
|
|
src="Images/image020.gif" /><br />
|
|
Figure 6: Subdialog composed of several documents<br
|
|
clear="none" />
|
|
returning from the first subdialog document.</p>
|
|
|
|
<p>The subdialog in sd1.vxml specifies that control is to be
|
|
transfered to a second subdialog, SD2, in sd2.vxml. When
|
|
executing SD2, there are two suspended contexts: the dialog
|
|
context in D2 is suspending awaiting SD1 to return; and the
|
|
dialog context in SD1 awaiting SD2 to return. When SD2 returns,
|
|
control is returned to the SD1. It in turn returns control to
|
|
dialog D2.</p>
|
|
|
|
<h3 id="LXXXXq234523421341"><a id="dml1.5.4" name="dml1.5.4"
|
|
shape="rect">1.5.4 Final Processing</a></h3>
|
|
|
|
<p>Under certain circumstances (in particular, while the VoiceXML
|
|
interpreter is processing a disconnect event) the interpreter may
|
|
continue executing in the <em>final processing state</em> after
|
|
there is no longer a connection to allow the interpreter to
|
|
interact with the end user. The purpose of this state is to allow
|
|
the VoiceXML application to perform any necessary final cleanup,
|
|
such as submitting information to the application server. For
|
|
example, the following <catch> element will catch the
|
|
connection.disconnect.hangup event and execute in the final
|
|
processing state:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<catch event="connection.disconnect.hangup">
|
|
<submit namelist="myExit" next="http://mysite/exit.jsp"/>
|
|
</catch>
|
|
</pre>
|
|
|
|
<p>While in the final processing state the application must
|
|
remain in the transitioning state and may not enter the waiting
|
|
state (as described in <a href="#dml4.1.8" shape="rect">Section
|
|
4.1.8</a>). Thus for example the application should not enter
|
|
<field>, <record>, or <transfer> while in the
|
|
final processing state. The VoiceXML interpreter must exit if the
|
|
VoiceXML application attempts to enter the waiting state while in
|
|
the final processing state.</p>
|
|
|
|
<p>Aside from this restriction, execution of the VoiceXML
|
|
application continues normally while in the final processing
|
|
state. Thus for example the application may transition between
|
|
documents while in the final processing state, and the
|
|
interpreter must exit if no form item is eligible to be selected
|
|
(as described in <a href="#dml2.1.1" shape="rect">Section
|
|
2.1.1</a>).</p>
|
|
|
|
<!--- CHAPTER 1: END =-->
|
|
<!--- CHAPTER 2: BEGIN =-->
|
|
<h1 id="L2052"><a id="dml2" name="dml2" shape="rect">2. Dialog
|
|
Constructs</a></h1>
|
|
|
|
<h2 id="L2055"><a id="dml2.1" name="dml2.1" shape="rect">2.1
|
|
Forms</a></h2>
|
|
|
|
<p>Forms are the key component of VoiceXML documents. A form
|
|
contains:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>A set of <i>form items</i>, elements that are visited in the
|
|
main loop of the form interpretation algorithm. Form items are
|
|
subdivided into <i>input items</i> that can be 'filled' by user
|
|
input and <i>control items</i> that cannot.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Declarations of non-form item variables.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Event handlers.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>"Filled" actions, blocks of procedural logic that execute when
|
|
certain combinations of input item variables are assigned.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>Form attributes are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 3: form attributes">
|
|
<caption align="bottom">Table 3: <form>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>id</th>
|
|
<td>The name of the form. If specified,
|
|
the form can be referenced within the document or from another
|
|
document. For instance <form id="weather">, <goto
|
|
next="#weather">.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>scope</th>
|
|
<td>The default scope of the form's
|
|
grammars. If it is dialog then the form grammars are active only
|
|
in the form. If the scope is document, then the form grammars are
|
|
active during any dialog in the same document. If the scope is
|
|
document and the document is an application root document, then
|
|
the form grammars are active during any dialog in any document of
|
|
this application. Note that the scope of individual form grammars
|
|
takes precedence over the default scope; for example, in non-root
|
|
documents a form with the default scope "dialog", and a form
|
|
grammar with the scope "document", then that grammar is active in
|
|
any dialog in the document.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>This section describes some of the concepts behind forms, and
|
|
then gives some detailed examples of their operation.</p>
|
|
|
|
<h3 id="L2116"><a id="dml2.1.1" name="dml2.1.1"
|
|
shape="rect">2.1.1 Form Interpretation</a></h3>
|
|
|
|
<p>Forms are interpreted by an implicit form interpretation
|
|
algorithm (FIA). The FIA has a main loop that repeatedly selects
|
|
a form item and then visits it. The selected form item is the
|
|
first in document order whose guard condition is not satisfied.
|
|
For instance, a field's default guard condition tests to
|
|
see if the field's form item variable has a value, so that
|
|
if a simple form contains only fields, the user will be prompted
|
|
for each field in turn.</p>
|
|
|
|
<p>Interpreting a form item generally involves:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>Selecting and playing one or more prompts;</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Collecting a user input, either a response that fills in one
|
|
or more input items, or a throwing of some event (help, for
|
|
instance); and</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Interpreting any <filled> actions that pertained to the
|
|
newly filled in input items.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>The FIA ends when it interprets a transfer of control
|
|
statement (e.g. a <goto> to another dialog or document, or
|
|
a <submit> of data to the document server). It also ends
|
|
with an implied <exit> when no form item remains eligible
|
|
to select.</p>
|
|
|
|
<p>The FIA is described in more detail in <a href="#dml2.1.6"
|
|
shape="rect">Section 2.1.6</a>.</p>
|
|
|
|
<h3 id="L2142"><a id="dml2.1.2" name="dml2.1.2"
|
|
shape="rect">2.1.2 Form Items</a></h3>
|
|
|
|
<p>Form items are the elements that can be visited in the main
|
|
loop of the form interpretation algorithm. Input items direct the
|
|
FIA to gather a result for a specific element. When the FIA
|
|
selects a control item, the control item may contain a block of
|
|
procedural code to execute, or it may tell the FIA to set up the
|
|
initial prompt-and-collect for a mixed initiative form.</p>
|
|
|
|
<h4 id="L2149"><a id="dml2.1.2.1" name="dml2.1.2.1"
|
|
shape="rect">2.1.2.1 Input Items</a></h4>
|
|
|
|
<p>An input item specifies an <i>input item variable</i> to
|
|
gather from the user. Input items have prompts to tell the user
|
|
what to say or key in, grammars that define the allowed inputs,
|
|
and event handlers that process any resulting events. An input
|
|
item may also have a <filled> element that defines an
|
|
action to take just after the input item variable is filled.
|
|
Input items consist of:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 4: input items">
|
|
<caption align="bottom">Table 4: Input Items</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th><field></th>
|
|
<td>An input item whose value is obtained
|
|
via ASR or DTMF grammars.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><record></th>
|
|
<td>An input item whose value is an audio
|
|
clip recorded by the user. A <record> element could collect
|
|
a voice mail message, for instance.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><transfer></th>
|
|
<td>An input item which transfers the
|
|
user to another telephone number. If the transfer returns
|
|
control, the field variable will be set to the result
|
|
status.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><object></th>
|
|
<td>This input item invokes a
|
|
platform-specific "object" with various parameters. The result of
|
|
the platform object is an ECMAScript Object. One platform object
|
|
could be a builtin dialog that gathers credit card information.
|
|
Another could gather a text message using some proprietary DTMF
|
|
text entry method. There is no requirement for implementations to
|
|
provide platform-specific objects, although implementations must
|
|
handle the <object> element by throwing
|
|
error.unsupported.objectname if the particular platform-specific
|
|
object is not supported (note that 'objectname' in
|
|
error.unsupported.objectname is a fixed string, so not
|
|
substituted with the name of the unsupported object; more
|
|
specific error information may be provided in the event
|
|
"_message" special variable as described in <a href="#dml5.2.2"
|
|
shape="rect">Section 5.2.2</a>).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><subdialog></th>
|
|
<td>A <subdialog> input item is
|
|
roughly like a function call. It invokes another dialog on the
|
|
current page, or invokes another VoiceXML document. It returns an
|
|
ECMAScript Object as its result.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h4 id="L2202"><a id="dml2.1.2.2" name="dml2.1.2.2"
|
|
shape="rect">2.1.2.2 Control Items</a></h4>
|
|
|
|
<p>There are two types of control items:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 5: control items">
|
|
<caption align="bottom">Table 5: Control Items</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th><block></th>
|
|
<td>A sequence of procedural statements
|
|
used for prompting and computation, but not for gathering input.
|
|
A block has a (normally implicit) form item variable that is set
|
|
to true just before it is interpreted.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><initial></th>
|
|
<td>This element controls the initial
|
|
interaction in a mixed initiative form. Its prompts should be
|
|
written to encourage the user to say something matching a form
|
|
level grammar. When at least one input item variable is filled as
|
|
a result of recognition during an <initial> element, the
|
|
form item variable of <initial> becomes true, thus removing
|
|
it as an alternative for the FIA.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L2231"><a id="dml2.1.3" name="dml2.1.3"
|
|
shape="rect">2.1.3 Form Item Variables and Conditions</a></h3>
|
|
|
|
<p>Each form item has an associated <i>form item variable</i>,
|
|
which by default is set to undefined when the form is entered.
|
|
This form item variable will contain the result of interpreting
|
|
the form item. An input item's form item variable is also
|
|
called an <i>input item variable</i>, and it holds the value
|
|
collected from the user. A form item variable can be given a name
|
|
using the name attribute, or left nameless, in which case an
|
|
internal name is generated.</p>
|
|
|
|
<p>Each form item also has a <i>guard condition</i>, which
|
|
governs whether or not that form item can be selected by the form
|
|
interpretation algorithm. The default guard condition just tests
|
|
to see if the form item variable has a value. If it does, the
|
|
form item will not be visited.</p>
|
|
|
|
<p>Typically, input items are given names, but control items are
|
|
not. Generally form item variables are not given initial values
|
|
and additional guard conditions are not specified. But sometimes
|
|
there is a need for more detailed control. One form may have a
|
|
form item variable initially set to hide a field, and later
|
|
cleared (e.g., using <clear>) to force the field's
|
|
collection. Another field may have a guard condition that
|
|
activates it only when it has not been collected, and when two
|
|
other fields have been filled. A block item could execute only
|
|
when some condition holds true. Thus, fine control can be
|
|
exercised over the order in which form items are selected and
|
|
executed by the FIA, however in general, many dialogs can be
|
|
constructed without resorting to this level of complexity.</p>
|
|
|
|
<p>In summary, all form items have the following attributes:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 6: common form item attributes">
|
|
<caption align="bottom">Table 6: Common Form Item
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>name</th>
|
|
<td>The name of a dialog-scoped form item
|
|
variable that will hold the value of the form item.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>The initial value of the form item
|
|
variable; default is ECMAScript undefined. If initialized to a
|
|
value, then the form item will not be executed unless the form
|
|
item variable is cleared.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>cond</th>
|
|
<td>An expression to evaluate in
|
|
conjunction with the test of the form item variable. If absent,
|
|
this defaults to true, or in the case of <initial>, a test
|
|
to see if any input item variable has been filled in.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L2286"><a id="dml2.1.4" name="dml2.1.4"
|
|
shape="rect">2.1.4 Directed Forms</a></h3>
|
|
|
|
<p>The simplest and most common type of form is one in which the
|
|
form items are executed exactly once in sequential order to
|
|
implement a computer-directed interaction. Here is a weather
|
|
information service that uses such a form.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="weather_info">
|
|
<block>Welcome to the weather information service.</block>
|
|
<field name="state">
|
|
<prompt>What state?</prompt>
|
|
<grammar src="state.grxml" type="application/srgs+xml"/>
|
|
<catch event="help">
|
|
Please speak the state for which you want the weather.
|
|
</catch>
|
|
</field>
|
|
<field name="city">
|
|
<prompt>What city?</prompt>
|
|
<grammar src="city.grxml" type="application/srgs+xml"/>
|
|
<catch event="help">
|
|
Please speak the city for which you want the weather.
|
|
</catch>
|
|
</field>
|
|
<block>
|
|
<submit next="/servlet/weather" namelist="city state"/>
|
|
</block>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>This dialog proceeds sequentially:</p>
|
|
|
|
<blockquote>
|
|
<p>C (computer): Welcome to the weather information service. What
|
|
state?</p>
|
|
|
|
<p>H (human): Help</p>
|
|
|
|
<p>C: Please speak the state for which you want the weather.</p>
|
|
|
|
<p>H: Georgia</p>
|
|
|
|
<p>C: What city?</p>
|
|
|
|
<p>H: Tblisi</p>
|
|
|
|
<p>C: I did not understand what you said. What city?</p>
|
|
|
|
<p>H: Macon</p>
|
|
|
|
<p>C: The conditions in Macon Georgia are sunny and clear at 11
|
|
AM ...</p>
|
|
</blockquote>
|
|
|
|
<p>The form interpretation algorithm's first iteration
|
|
selects the first block, since its (hidden) form item variable is
|
|
initially undefined. This block outputs the main prompt, and its
|
|
form item variable is set to true. On the FIA's second
|
|
iteration, the first block is skipped because its form item
|
|
variable is now defined, and the state field is selected because
|
|
the dialog variable state is undefined. This field prompts the
|
|
user for the state, and then sets the variable state to the
|
|
answer. A detailed description of the filling of form item
|
|
variables from a field-level grammar may be found in <a
|
|
href="#dml3.1.6" shape="rect">Section 3.1.6</a>. The third form
|
|
iteration prompts and collects the city field. The fourth
|
|
iteration executes the final block and transitions to a different
|
|
URI.</p>
|
|
|
|
<p>Each field in this example has a prompt to play in order to
|
|
elicit a response, a grammar that specifies what to listen for,
|
|
and an event handler for the help event. The help event is thrown
|
|
whenever the user asks for assistance. The help event handler
|
|
catches these events and plays a more detailed prompt.</p>
|
|
|
|
<p>Here is a second directed form, one that prompts for credit
|
|
card information:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="get_card_info">
|
|
<block>We now need your credit card type, number,
|
|
and expiration date.</block>
|
|
<field name="card_type">
|
|
<prompt count="1">What kind of credit card
|
|
do you have?</prompt>
|
|
<prompt count="2">Type of card?</prompt>
|
|
<!-- This is an inline grammar. -->
|
|
<grammar type="application/srgs+xml" root="r2" version="1.0">
|
|
<rule id="r2" scope="public">
|
|
<one-of>
|
|
<item>visa</item>
|
|
<item>master <item repeat="0-1">card</item></item>
|
|
<item>amex</item>
|
|
<item>american express</item>
|
|
</one-of>
|
|
</rule>
|
|
</grammar>
|
|
<help> Please say Visa, MasterCard, or American Express.</help>
|
|
</field>
|
|
|
|
<field name="card_num">
|
|
<grammar type="application/srgs+xml" src="/grammars/digits.grxml"/>
|
|
<prompt count="1">What is your card number?</prompt>
|
|
<prompt count="2">Card number?</prompt>
|
|
<catch event="help">
|
|
<if cond="card_type =='amex' || card_type =='american express'">
|
|
Please say or key in your 15 digit card number.
|
|
<else/>
|
|
Please say or key in your 16 digit card number.
|
|
</if>
|
|
</catch>
|
|
<filled>
|
|
<if cond="(card_type == 'amex' || card_type =='american express')
|
|
&amp;&amp; card_num.length != 15">
|
|
American Express card numbers must have 15 digits.
|
|
<clear namelist="card_num"/>
|
|
<throw event="nomatch"/>
|
|
<elseif cond="card_type != 'amex'
|
|
&amp;&amp; card_type !='american express'
|
|
&amp;&amp; card_num.length != 16"/>
|
|
MasterCard and Visa card numbers have 16 digits.
|
|
<clear namelist="card_num"/>
|
|
<throw event="nomatch"/>
|
|
</if>
|
|
</filled>
|
|
</field>
|
|
|
|
<field name="expiry_date">
|
|
<grammar type="application/srgs+xml" src="/grammars/digits.grxml"/>
|
|
<prompt count="1">What is your card's expiration date?</prompt>
|
|
<prompt count="2">Expiration date?</prompt>
|
|
<help>
|
|
Say or key in the expiration date, for example one two oh one.
|
|
</help>
|
|
<filled>
|
|
<!-- validate the mmyy -->
|
|
<var name="mm"/>
|
|
<var name="i" expr="expiry_date.length"/>
|
|
<if cond="i == 3">
|
|
<assign name="mm" expr="expiry_date.substring(0,1)"/>
|
|
<elseif cond="i == 4"/>
|
|
<assign name="mm" expr="expiry_date.substring(0,2)"/>
|
|
</if>
|
|
<if cond="mm == '' || mm &lt; 1 || mm &gt; 12">
|
|
<clear namelist="expiry_date"/>
|
|
<throw event="nomatch"/>
|
|
</if>
|
|
</filled>
|
|
</field>
|
|
|
|
<field name="confirm">
|
|
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
|
|
<prompt>
|
|
I have <value expr="card_type"/> number
|
|
<value expr="card_num"/>, expiring on
|
|
<value expr="expiry_date"/>.
|
|
Is this correct?
|
|
</prompt>
|
|
<filled>
|
|
<if cond="confirm">
|
|
<submit next="place_order.asp"
|
|
namelist="card_type card_num expiry_date"/>
|
|
</if>
|
|
<clear namelist="card_type card_num expiry_date confirm"/>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>Note that the grammar alternatives 'amex' and 'american
|
|
express' return literal values which need to be handled
|
|
separately in the conditional expressions. <a href="#dml3.1.5"
|
|
shape="rect">Section 3.1.5</a> describes how semantic attachments
|
|
in the grammar can be used to return a single representation of
|
|
these inputs.</p>
|
|
|
|
<p>The dialog might go something like this:</p>
|
|
|
|
<blockquote>
|
|
<p>C: We now need your credit card type, number, and expiration
|
|
date.</p>
|
|
|
|
<p>C: What kind of credit card do you have?</p>
|
|
|
|
<p>H: Discover</p>
|
|
|
|
<p>C: I did not understand what you said. <span class="stage">(a
|
|
platform-specific default message.)</span></p>
|
|
|
|
<p>C: Type of card? <span class="stage">(the second prompt is
|
|
used now.)</span></p>
|
|
|
|
<p>H: Shoot. <span class="stage">(fortunately treated as "help"
|
|
by this platform)</span></p>
|
|
|
|
<p>C: Please say Visa, MasterCard, or American Express.</p>
|
|
|
|
<p>H: Uh, Amex. <span class="stage">(this platform ignores
|
|
"uh")</span></p>
|
|
|
|
<p>C: What is your card number?</p>
|
|
|
|
<p>H: One two three four ... wait ...</p>
|
|
|
|
<p>C: I did not understand what you said.</p>
|
|
|
|
<p>C: Card number?</p>
|
|
|
|
<p>H: <span class="stage">(uses DTMF)</span> 1 2 3 4 5 6 7 8 9 0
|
|
1 2 3 4 5 #</p>
|
|
|
|
<p>C: What is your card's expiration date?</p>
|
|
|
|
<p>H: one two oh one</p>
|
|
|
|
<p>C: I have Amex number 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 expiring
|
|
on 1 2 0 1. Is this correct?</p>
|
|
|
|
<p>H: Yes</p>
|
|
</blockquote>
|
|
|
|
<p>Fields are the major building blocks of forms. A field
|
|
declares a variable and specifies the prompts, grammars, DTMF
|
|
sequences, help messages, and other event handlers that are used
|
|
to obtain it. Each field declares a VoiceXML form item variable
|
|
in the form's dialog scope. These may be submitted once the
|
|
form is filled, or copied into other variables.</p>
|
|
|
|
<p>Each field has its own speech and/or DTMF grammars, specified
|
|
explicitly using <grammar> elements, or implicitly using
|
|
the type attribute. The type attribute is used for builtin
|
|
grammars, like digits, boolean, or number.</p>
|
|
|
|
<p>Each field can have one or more prompts. If there is one, it
|
|
is repeatedly used to prompt the user for the value until one is
|
|
provided. If there are many, prompts are selected for playback
|
|
according to the prompt selection algorithm (see <a
|
|
href="#dml4.1.6" shape="rect">Section 4.1.6</a>). The count
|
|
attribute can be used to determine which prompts to use on each
|
|
attempt. In the example, prompts become shorter. This is called
|
|
<i>tapered prompting</i>.</p>
|
|
|
|
<p>The <catch event="help"> elements are event handlers
|
|
that define what to do when the user asks for help. Help messages
|
|
can also be tapered. These can be abbreviated, so that the
|
|
following two elements are equivalent:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<catch event="help">
|
|
Please say visa, mastercard, or amex.
|
|
</catch>
|
|
|
|
<help>
|
|
Please say visa, mastercard, or amex.
|
|
</help>
|
|
</pre>
|
|
|
|
<p>The <filled> element defines what to do when the user
|
|
provides a recognized input for that field. One use is to specify
|
|
integrity constraints over and above the checking done by the
|
|
grammars, as with the date field above.</p>
|
|
|
|
<h3 id="L2400"><a id="dml2.1.5" name="dml2.1.5"
|
|
shape="rect">2.1.5 Mixed Initiative Forms</a></h3>
|
|
|
|
<p>The last section talked about forms implementing rigid,
|
|
computer-directed conversations. To make a form <i>mixed
|
|
initiative</i>, where both the computer and the human direct
|
|
the conversation, it must have one or more form-level grammars.
|
|
The dialog may be written in several ways. One common authoring
|
|
tyle combines an <initial> element that prompts for a
|
|
general response with <field> elements that prompt for
|
|
specific information. This is illustrated in the example
|
|
below. More complex techniques, such as using the 'cond'
|
|
attribute on <field> elements, may achieve a similar
|
|
effect.</p>
|
|
|
|
<p>If a <i>form</i> has form-level grammars:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>Its input items can be filled in any order.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>More than one input item can be filled as a result of a single
|
|
user utterance.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>Only input items (and not control items) can be filled as a
|
|
result of matching a form-level grammar. The filling of field
|
|
variables when using a form-level grammar is described in <a
|
|
href="#dml3.1.6" shape="rect">Section 3.1.6</a>.</p>
|
|
|
|
<p>Also, the form's grammars can be active when the user is
|
|
in other dialogs. If a document has two forms on it, say a car
|
|
rental form and a hotel reservation form, and both forms have
|
|
grammars that are active for that document, a user could respond
|
|
to a request for hotel reservation information with information
|
|
about the car rental, and thus direct the computer to talk about
|
|
the car rental instead. The user can speak to any active grammar,
|
|
and have input items set and actions taken in response.</p>
|
|
|
|
<p><b>Example.</b> Here is a second version of the weather
|
|
information service, showing mixed initiative. It has been
|
|
"enhanced" for illustrative purposes with advertising and with a
|
|
confirmation of the city and state:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="weather_info">
|
|
|
|
<grammar src="cityandstate.grxml" type="application/srgs+xml"/>
|
|
|
|
<!-- Caller can't barge in on today's advertisement. -->
|
|
<block>
|
|
<prompt bargein="false">
|
|
Welcome to the weather information service.
|
|
<audio src="http://www.online-ads.example.com/wis.wav"/>
|
|
</prompt>
|
|
</block>
|
|
|
|
<initial name="start">
|
|
<prompt>
|
|
For what city and state would you like the weather?
|
|
</prompt>
|
|
<help>
|
|
Please say the name of the city and
|
|
state for which you would like a weather report.
|
|
</help>
|
|
<!-- If user is silent, reprompt once, then
|
|
try directed prompts. -->
|
|
<noinput count="1"> <reprompt/></noinput>
|
|
<noinput count="2"> <reprompt/>
|
|
<assign name="start" expr="true"/></noinput>
|
|
</initial>
|
|
|
|
<field name="state">
|
|
<prompt>What state?</prompt>
|
|
<help>
|
|
Please speak the state for which you want the weather.
|
|
</help>
|
|
</field>
|
|
|
|
<field name="city">
|
|
<prompt>Please say the city in <value expr="state"/>
|
|
for which you want the weather.</prompt>
|
|
<help>Please speak the city for which you
|
|
want the weather.</help>
|
|
<filled>
|
|
<!-- Most of our customers are in LA. -->
|
|
<if cond="city == 'Los Angeles' &amp;&amp; state == undefined">
|
|
<assign name="state" expr="'California'"/>
|
|
</if>
|
|
</filled>
|
|
</field>
|
|
|
|
<field name="go_ahead" modal="true">
|
|
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
|
|
<prompt>Do you want to hear the weather for
|
|
<value expr="city"/>, <value expr="state"/>?
|
|
</prompt>
|
|
<filled>
|
|
<if cond="go_ahead">
|
|
<prompt bargein="false">
|
|
<audio src="http://www.online-ads.example.com/wis2.wav"/>
|
|
</prompt>
|
|
<submit next="/servlet/weather" namelist="city state"/>
|
|
</if>
|
|
<clear namelist="start city state go_ahead"/>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>Here is a transcript showing the advantages for even a novice
|
|
user:</p>
|
|
|
|
<blockquote>
|
|
<p>C: Welcome to the weather information service. Buy Joe's
|
|
Spicy Shrimp Sauce.</p>
|
|
|
|
<p>C: For what city and state would you like the weather?</p>
|
|
|
|
<p>H: Uh, California.</p>
|
|
|
|
<p>C: Please say the city in California for which you want the
|
|
weather.</p>
|
|
|
|
<p>H: San Francisco, please.</p>
|
|
|
|
<p>C: Do you want to hear the weather for San Francisco,
|
|
California?</p>
|
|
|
|
<p>H: No</p>
|
|
|
|
<p>C: For what city and state would you like the weather?</p>
|
|
|
|
<p>H: Los Angeles.</p>
|
|
|
|
<p>C: Do you want to hear the weather for Los Angeles,
|
|
California?</p>
|
|
|
|
<p>H: Yes</p>
|
|
|
|
<p>C: Don't forget, buy Joe's Spicy Shrimp Sauce
|
|
tonight!</p>
|
|
|
|
<p>C: Mostly sunny today with highs in the 80s. Lows tonight from
|
|
the low 60s ...</p>
|
|
</blockquote>
|
|
|
|
<p>The go_ahead field has its modal attribute set to true. This
|
|
causes all grammars to be disabled except the ones defined in the
|
|
current form item, so that the only grammar active during this
|
|
field is the grammar for boolean.</p>
|
|
|
|
<p>An experienced user can get things done much faster (but is
|
|
still forced to listen to the ads):</p>
|
|
|
|
<blockquote>
|
|
<p>C: Welcome to the weather information service. Buy Joe's
|
|
Spicy Shrimp Sauce.</p>
|
|
|
|
<p>C: What ...</p>
|
|
|
|
<p>H <span class="stage">(barging in)</span>: LA</p>
|
|
|
|
<p>C: Do you ...</p>
|
|
|
|
<p>H <span class="stage">(barging in)</span>: Yes</p>
|
|
|
|
<p>C: Don't forget, buy Joe's Spicy Shrimp Sauce
|
|
tonight!</p>
|
|
|
|
<p>C: Mostly sunny today with highs in the 80s. Lows tonight from
|
|
the low 60s ...</p>
|
|
</blockquote>
|
|
|
|
<h4 id="L2501"><a id="dml2.1.5.1" name="dml2.1.5.1"
|
|
shape="rect">2.1.5.1 Controlling the order of field
|
|
collection.</a></h4>
|
|
|
|
<p>The form interpretation algorithm can be customized in several
|
|
ways. One way is to assign a value to a form item variable, so
|
|
that its form item will not be selected. Another is to use
|
|
<clear> to set a form item variable to undefined; this
|
|
forces the FIA to revisit the form item again.</p>
|
|
|
|
<p>Another method is to explicitly specify the next form item to
|
|
visit using <goto nextitem>. This forces an immediate
|
|
transfer to that form item even if any cond attribute present
|
|
evaluates to "false". No variables, conditions or counters in
|
|
the targeted form item will be reset. The form item's prompt
|
|
will be played even if it has already been visited. If the
|
|
<goto nextitem> occurs in a <filled> action, the rest
|
|
of the <filled> action and any pending <filled>
|
|
actions will be skipped.</p>
|
|
|
|
<p>Here is an example <goto nextitem> executed in response
|
|
to the exit event:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<link event="exit">
|
|
<grammar type="application/srgs+xml" src="/grammars/exit.grxml"/>
|
|
</link>
|
|
|
|
<form id="survey_2000_03_30">
|
|
<catch event="exit">
|
|
<reprompt/>
|
|
<goto nextitem="confirm_exit"/>
|
|
</catch>
|
|
<block>
|
|
<prompt>
|
|
Hello, you have been called at random to answer questions
|
|
critical to U.S. foreign policy.
|
|
</prompt>
|
|
</block>
|
|
|
|
<field name="q1">
|
|
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
|
|
<prompt>Do you agree with the IMF position on
|
|
privatizing certain functions of Burkina Faso's
|
|
agriculture ministry?</prompt>
|
|
</field>
|
|
|
|
<field name="q2">
|
|
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
|
|
<prompt>If this privatization occurs, will its
|
|
effects be beneficial mainly to Ouagadougou and
|
|
Bobo-Dioulasso?</prompt>
|
|
</field>
|
|
|
|
<field name="q3">
|
|
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
|
|
<prompt>Do you agree that sorghum and millet output
|
|
might thereby increase by as much as four percent per
|
|
annum?</prompt>
|
|
</field>
|
|
|
|
<block>
|
|
<submit next="register" namelist="q1 q2 q3"/>
|
|
</block>
|
|
|
|
<field name="confirm_exit">
|
|
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
|
|
<prompt>You have elected to exit. Are you
|
|
sure you want to do this, and perhaps adversely affect
|
|
U.S. foreign policy vis-a-vis sub-Saharan Africa for
|
|
decades to come?</prompt>
|
|
<filled>
|
|
<if cond="confirm_exit">
|
|
Okay, but the U.S. State Department is displeased.
|
|
<exit/>
|
|
<else/>
|
|
Good, let's pick up where we left off.
|
|
<clear namelist="confirm_exit"/>
|
|
</if>
|
|
</filled>
|
|
<catch event="noinput nomatch">
|
|
<throw event="exit"/>
|
|
</catch>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>If the user says "exit" in response to any of the survey
|
|
questions, an exit event is thrown by the platform and caught by
|
|
the <catch> event handler. This handler directs that
|
|
confirm_exit be the next visited field. The confirm_exit field
|
|
would not be visited during normal completion of the survey
|
|
because the preceding <block> element transfers control to
|
|
the registration script.</p>
|
|
|
|
<h3 id="L2516"><a id="dml2.1.6" name="dml2.1.6"
|
|
shape="rect">2.1.6 Form Interpretation Algorithm</a></h3>
|
|
|
|
<p>We've presented the form interpretation algorithm (FIA)
|
|
at a conceptual level. In this section we describe it in more
|
|
detail. A more formal description is provided in <a
|
|
href="#dmlAFIA" shape="rect">Appendix C</a>.</p>
|
|
|
|
<h4 id="L2526"><a id="dml2.1.6.1" name="dml2.1.6.1"
|
|
shape="rect">2.1.6.1 Initialization Phase</a></h4>
|
|
|
|
<p>Whenever a form is entered, it is initialized. Internal prompt
|
|
counter variables (in the form's dialog scope) are reset to
|
|
1. Each variable (form-level <var> elements and form item
|
|
variables) is initialized, in document order, to undefined or to
|
|
the value of the relevant expr attribute.</p>
|
|
|
|
<h4 id="L2533"><a id="dml2.1.6.2" name="dml2.1.6.2"
|
|
shape="rect">2.1.6.2 Main Loop</a></h4>
|
|
|
|
<p>The main loop of the FIA has three phases:</p>
|
|
|
|
<p>The <i>select</i> phase: the next unfilled form item is
|
|
selected for visiting.</p>
|
|
|
|
<p>The <em>collect</em> phase: the selected <em>form item</em> is
|
|
visited, which prompts the user for input, enables the
|
|
appropriate grammars, and then waits for and collects an
|
|
<em>input</em> (such as a spoken phrase or DTMF key presses) or
|
|
an <em>event</em> (such as a request for help or a no input
|
|
timeout).</p>
|
|
|
|
<p>The <em>process</em> phase: an input is processed by filling
|
|
form items and executing <filled> elements to perform
|
|
actions such as input validation. An event is processed by
|
|
executing the appropriate event handler for that event type.</p>
|
|
|
|
<p>Note that the FIA may be given an input (a set of grammar
|
|
slot/slot value pairs) that was collected while the user was in a
|
|
different form's FIA. In this case the first iteration of
|
|
the main loop skips the select and collect phases, and goes right
|
|
to the process phase with that input. Also note that if an
|
|
error occurs in the select or collect phase that causes an event
|
|
to be generated, the event is thrown and the FIA moves directly
|
|
into the process phase.</p>
|
|
|
|
<h4 id="L2566"><a id="dml2.1.6.2.1" name="dml2.1.6.2.1"
|
|
shape="rect">2.1.6.2.1 Select phase</a></h4>
|
|
|
|
<p>The purpose of the select phase is to select the next form
|
|
item to visit. This is done as follows:</p>
|
|
|
|
<p>If a <goto> from the last main loop iteration's
|
|
process phase specified a <goto nextitem>, then the
|
|
specified form item is selected.</p>
|
|
|
|
<p>Otherwise the first form item whose <em>guard condition</em>
|
|
is false is chosen to be visited. If an error occurs while
|
|
checking guard conditions, the event is thrown which skips the
|
|
collect phase, and is handled in the process phase.</p>
|
|
|
|
<p>If no guard condition is false, and the last iteration
|
|
completed the form without encountering an explicit transfer of
|
|
control, the FIA does an implicit <exit> operation
|
|
(similarly, if execution proceeds outside of a form, such as when
|
|
an error is generated outside of a form, and there is no explicit
|
|
transfer of control, the interpreter will perform an implicit
|
|
<exit> operation).</p>
|
|
|
|
<h4 id="L2582"><a id="dml2.1.6.2.2" name="dml2.1.6.2.2"
|
|
shape="rect">2.1.6.2.2 Collect phase</a></h4>
|
|
|
|
<p>The purpose of the collect phase is to collect an input or an
|
|
event. The selected form item is <em>visited</em>, which performs
|
|
actions that depend on the type of form item:</p>
|
|
|
|
<p>If a <field> or <record> is visited,
|
|
the FIA selects and queues up any prompts based on the
|
|
item's prompt counter and the prompt conditions. Then it
|
|
activates and listens for the field level grammar(s) and any
|
|
active higher-level grammars, and waits for the item to be
|
|
filled or for some event to be generated.</p>
|
|
|
|
<p>If a <transfer> is visited, the prompts are queued based
|
|
on the item's prompt counter and the prompt conditions. The
|
|
item grammars are activated. The queue is played before the
|
|
transfer is executed.</p>
|
|
|
|
<p>If a <subdialog> or <object> is visited, the
|
|
prompts are queued based on the item's prompt counter and
|
|
the prompt conditions. Grammars are not activated. Instead, the
|
|
input collection behavior is specified by the executing context
|
|
for the subdialog or object. The queue is not played before the
|
|
subdialog or object is executed, but instead should be played
|
|
during the subsequent input collection.</p>
|
|
|
|
<p>If an <initial> is visited, the FIA selects and queues
|
|
up prompts based on the <initial>'s prompt counter
|
|
and prompt conditions. Then it listens for the form level
|
|
grammar(s) and any active higher-level grammars. It waits for a
|
|
grammar recognition or for an event.</p>
|
|
|
|
<p>A <block> element is visited by setting its form item
|
|
variable to true, evaluating its content, and then bypassing the
|
|
process phase. No input is collected, and the next iteration of
|
|
the FIA's main loop is entered.</p>
|
|
|
|
<h4 id="L2610"><a id="dml2.1.6.2.3" name="dml2.1.6.2.3"
|
|
shape="rect">2.1.6.2.3 Process phase</a></h4>
|
|
|
|
<p>The purpose of the process phase is to process the input or
|
|
event collected during the previous phases, as follows:</p>
|
|
|
|
<ul>
|
|
<li>If an event (such as a noinput or a hangup) occurred, then
|
|
the applicable catch element is identified and executed.
|
|
Selection of the applicable catch element starts in the scope of
|
|
the current form item and then proceeds outward by enclosing
|
|
dialog scopes. This can cause the FIA to terminate (e.g. if it
|
|
transitions to a different dialog or document or it does an
|
|
<exit>), or it can cause the FIA to go into the next
|
|
iteration of the main loop (e.g. as when the default help event
|
|
handler is executed).</li>
|
|
|
|
<li>If an input matches a grammar from a <link> then that
|
|
link's transition is executed, or its event is thrown. If
|
|
the <link> throws an event, the event is processed in the
|
|
context of the current form item (e.g. <initial>,
|
|
<field>, <transfer>, and so forth).</li>
|
|
|
|
<li>If an input matches a grammar in a form other than the
|
|
current form, then the FIA terminates, the other form is
|
|
initialized, and that form's FIA is started with this input
|
|
in its process phase.</li>
|
|
</ul>
|
|
|
|
<p>If an input matches a grammar in this form, then:</p>
|
|
|
|
<ul>
|
|
<li>The semantic result from the grammar is mapped into one or
|
|
more form item variables as described in <a href="#dml3.1.6"
|
|
shape="rect">Section 3.1.6</a>.</li>
|
|
|
|
<li>The <filled> actions triggered by these assignments are
|
|
identified as described in <a href="#dml2.4" shape="rect">Section
|
|
2.4</a>.</li>
|
|
|
|
<li>Each identified <filled> action is executed in document
|
|
order. If a <submit>, <disconnect>, <exit>,
|
|
<return>, <goto> or <throw> is encountered, the
|
|
remaining <filled> elements are not executed, and the FIA
|
|
either terminates or continues in the next main loop iteration.
|
|
<reprompt> does not terminate the FIA (the name suggests an
|
|
action), but rather just sets a flag that affects the treatment
|
|
of prompts on the subsequent iteration of the FIA. If an event is
|
|
thrown during the execution of a <filled>, event handler
|
|
selection starts in the scope of the <filled>, which could
|
|
be a form item or the form itself, and then proceeds outward by
|
|
enclosing dialog scopes.</li>
|
|
</ul>
|
|
|
|
<p>After completion of the process phase, interpretation
|
|
continues by returning to the select phase.</p>
|
|
|
|
<p>A more detailed form interpretation algorithm can be found in
|
|
<a href="#dmlAFIA" shape="rect">Appendix C.</a></p>
|
|
|
|
<h2 id="L2652"><a id="dml2.2" name="dml2.2" shape="rect">2.2
|
|
Menus</a></h2>
|
|
|
|
<p>A <i>menu</i> is a convenient syntactic shorthand for a form
|
|
containing a single anonymous field that prompts the user to make
|
|
a choice and transitions to different places based on that
|
|
choice. Like a regular form, it can have its grammar scoped such
|
|
that it is active when the user is executing another dialog. The
|
|
following menu offers the user three choices:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<menu>
|
|
<prompt>
|
|
Welcome home. Say one of: <enumerate/>
|
|
</prompt>
|
|
<choice next="http://www.sports.example.com/vxml/start.vxml">
|
|
Sports
|
|
</choice>
|
|
<choice next="http://www.weather.example.com/intro.vxml">
|
|
Weather
|
|
</choice>
|
|
<choice next="http://www.stargazer.example.com/voice/astronews.vxml">
|
|
Stargazer astrophysics news
|
|
</choice>
|
|
<noinput>Please say one of <enumerate/></noinput>
|
|
</menu>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>This dialog might proceed as follows:</p>
|
|
|
|
<blockquote>
|
|
<p>C: Welcome home. Say one of: sports; weather; Stargazer
|
|
astrophysics news.</p>
|
|
|
|
<p>H: Astrology.</p>
|
|
|
|
<p>C: I did not understand what you said. <span class="stage">(a
|
|
platform-specific default message.)</span></p>
|
|
|
|
<p>C: Welcome home. Say one of: sports; weather; Stargazer
|
|
astrophysics news.</p>
|
|
|
|
<p>H: sports.</p>
|
|
|
|
<p>C: <span class="stage">(proceeds to
|
|
http://www.sports.example.com/vxml/start.vxml)</span></p>
|
|
</blockquote>
|
|
|
|
<h3 id="L221"><a id="dml2.2.1" name="dml2.2.1" shape="rect">2.2.1
|
|
menu element</a></h3>
|
|
|
|
<p>This identifies the menu, and determines the scope of its
|
|
grammars. The menu element's attributes are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 7: menu attributes">
|
|
<caption align="bottom">Table 7: <menu>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>id</th>
|
|
<td>The identifier of the menu. It allows
|
|
the menu to be the target of a <goto> or a
|
|
<submit>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>scope</th>
|
|
<td>The menu's grammar scope. If it
|
|
is dialog (the default), the menu's grammars are only
|
|
active when the user transitions into the menu. If the scope is
|
|
document, its grammars are active over the whole document (or if
|
|
the menu is in the application root document, any loaded document
|
|
in the application).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>dtmf</th>
|
|
<td>When set to true, the first nine
|
|
choices that have not explicitly specified a value for the dtmf
|
|
attribute are given the implicit ones "1", "2", etc. Remaining
|
|
choices that have not explicitly specified a value for the dtmf
|
|
attribute will not be assigned DTMF values (and thus cannot be
|
|
matched via a DTMF keypress). If there are choices which have
|
|
specified their own DTMF sequences to be something other than
|
|
"*", "#", or "0", an error.badfetch will be thrown. The default
|
|
is false.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>accept</th>
|
|
<td>When set to "exact" (the default),
|
|
the text of the choice elements in the menu defines the exact
|
|
phrase to be recognized. When set to "approximate", the text of
|
|
the choice elements defines an approximate recognition phrase (as
|
|
described under <a href="#dml2.2.5" shape="rect">Section
|
|
2.2.5</a>). Each <choice> can override this setting.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L222"><a id="dml2.2.2" name="dml2.2.2" shape="rect">2.2.2
|
|
choice element</a></h3>
|
|
|
|
<p>The <choice> element serves several purposes:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>It may specify a speech grammar, defined either using a
|
|
<grammar> element or automatically generated by the process
|
|
described in <a href="#dml2.2.5" shape="rect">Section
|
|
2.2.5</a>.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>It may specify a DTMF grammar, as discussed in <a
|
|
href="#dml2.2.3" shape="rect">Section 2.2.3</a>.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The contents may be used to form the <enumerate> prompt
|
|
string. This is described in <a href="#dml2.2.4"
|
|
shape="rect">Section 2.2.4</a>.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>And it specifies either an event to be thrown or the URI to go
|
|
to when the choice is selected.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>The choice element's attributes are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 8: choice attributes">
|
|
<caption align="bottom">Table 8: <choice>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>dtmf</th>
|
|
<td>The DTMF sequence for this choice. It
|
|
is equivalent to a simple DTMF <grammar> and DTMF
|
|
properties (<a href="#dml6.3.3" shape="rect">Section 6.3.3</a>)
|
|
apply to recognition of the sequence. Unlike DTMF grammars,
|
|
whitespace is optional: dtmf="123#" is equivalent to dtmf="1 2 3
|
|
#".</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>accept</th>
|
|
<td>Override the setting for accept in
|
|
<menu> for this particular choice. When set to "exact" (the
|
|
default), the text of the choice element defines the exact phrase
|
|
to be recognized. When set to "approximate", the text of the
|
|
choice element defines an approximate recognition phrase (as
|
|
described under <a href="#dml2.2.5" shape="rect">Section
|
|
2.2.5</a>).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>next</th>
|
|
<td>The URI of next dialog or
|
|
document.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>Specify an expression to evaluate as
|
|
a URI to transition to instead of specifying a next.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>event</th>
|
|
<td>Specify an event to be thrown instead
|
|
of specifying a next.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>eventexpr</th>
|
|
<td>An ECMAScript expression evaluating
|
|
to the name of the event to be thrown.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>message</th>
|
|
<td>A message string providing additional
|
|
context about the event being thrown. The message is available as
|
|
the value of a variable within the scope of the catch element,
|
|
see <a href="#dml5.2.2" shape="rect">Section 5.2.2</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>messageexpr</th>
|
|
<td>An ECMAScript expression evaluating
|
|
to the message string.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchaudio</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchaudio
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchhint</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
documentfetchhint property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchtimeout</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchtimeout
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxage</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the documentmaxage
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxstale</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
documentmaxstale property.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Exactly one of "next", "expr", "event" or "eventexpr" must be
|
|
specified; otherwise, an error.badfetch event is thrown. Exactly
|
|
one of "message" or "messageexpr" may be specified; otherwise, an
|
|
error.badfetch event is thrown.</p>
|
|
|
|
<p>If a <grammar> element is specified in <choice>,
|
|
then the external grammar is used instead of an automatically
|
|
generated grammar. This allows the developer to precisely control
|
|
the <choice> grammar; for example:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<menu>
|
|
<choice next="http://www.sports.example.com/vxml/start.vxml">
|
|
<grammar src="sports.grxml" type="application/srgs+xml"/>
|
|
Sports
|
|
</choice>
|
|
<choice next="http://www.weather.example.com/intro.vxml">
|
|
<grammar src="weather.grxml" type="application/srgs+xml"/>
|
|
Weather
|
|
</choice>
|
|
<choice next="http://www.stargazer.example.com/voice/astronews.vxml">
|
|
<grammar src="astronews.grxml" type="application/srgs+xml"/>
|
|
Stargazer astrophysics
|
|
</choice>
|
|
</menu>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<br />
|
|
|
|
|
|
<h3 id="L223"><a id="dml2.2.3" name="dml2.2.3" shape="rect">2.2.3
|
|
DTMF in Menus</a></h3>
|
|
|
|
<p>Menus can rely purely on speech, purely on DTMF, or both in
|
|
combination by including a <property> element in the
|
|
<menu>. Here is a DTMF-only menu with explicit DTMF
|
|
sequences given to each choice, using the choice's dtmf
|
|
attribute:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<menu>
|
|
<property name="inputmodes" value="dtmf"/>
|
|
<prompt>
|
|
For sports press 1, For weather press 2, For Stargazer
|
|
astrophysics press 3.
|
|
</prompt>
|
|
<choice dtmf="1" next="http://www.sports.example.com/vxml/start.vxml"/>
|
|
<choice dtmf="2" next="http://www.weather.example.com/intro.vxml"/>
|
|
<choice dtmf="3" next="http://www.stargazer.example.com/astronews.vxml"/>
|
|
</menu>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>Alternatively, you can set the <menu>'s dtmf
|
|
attribute to true to assign sequential DTMF digits to each of the
|
|
first nine choices that have not specified their own DTMF
|
|
sequences: the first choice has DTMF "1", and so on:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<menu dtmf="true">
|
|
<property name="inputmodes" value="dtmf"/>
|
|
<prompt>
|
|
For sports press 1, For weather
|
|
press 2, For Stargazer astrophysics press 3.
|
|
</prompt>
|
|
<choice next="http://www.sports.example.com/vxml/start.vxml"/>
|
|
<choice next="http://www.weather.example.com/intro.vxml"/>
|
|
<choice dtmf="0" next="#operator"/>
|
|
<choice next="http://www.stargazer.example.com/voice/astronews.vxml"/>
|
|
</menu>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<h3 id="L224"><a id="dml2.2.4" name="dml2.2.4" shape="rect">2.2.4
|
|
enumerate element</a></h3>
|
|
|
|
<p>The <enumerate> element is an automatically generated
|
|
description of the choices available to the user. It specifies a
|
|
template that is applied to each choice in the order they appear
|
|
in the menu. If it is used with no content, a default template
|
|
that lists all the choices is used, determined by the interpreter
|
|
context. If it has content, the content is the template
|
|
specifier. This specifier may refer to two special variables:
|
|
_prompt is the choice's prompt, and _dtmf is a normalized
|
|
representation (i.e. a single whitespace between DTMF tokens)
|
|
of the choice's assigned DTMF sequence (note that if no DTMF
|
|
sequence is assigned to the choice element, or if a
|
|
<grammar> element is specified in <choice>, then
|
|
the _dtmf variable is assigned the ECMAScript undefined value ).
|
|
For example, if the menu were rewritten as</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<menu dtmf="true">
|
|
<prompt>
|
|
Welcome home.
|
|
<enumerate>
|
|
For <value expr="_prompt"/>, press <value
|
|
expr="_dtmf"/>.
|
|
</enumerate>
|
|
</prompt>
|
|
<choice next="http://www.sports.example.com/vxml/start.vxml">
|
|
sports </choice>
|
|
<choice next="http://www.weather.example.com/intro.vxml">
|
|
weather </choice>
|
|
<choice next="http://www.stargazer.example.com/voice/astronews.vxml">
|
|
Stargazer astrophysics news
|
|
</choice>
|
|
</menu>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>then the menu's prompt would be:</p>
|
|
|
|
<blockquote>
|
|
<p>C: Welcome home. For sports, press 1. For weather, press 2.
|
|
For Stargazer astrophysics news, press 3.</p>
|
|
</blockquote>
|
|
|
|
<p>The <enumerate> element may be used within the prompts
|
|
and the catch elements associated with <menu> elements and
|
|
with <field> elements that contain <option> elements,
|
|
as discussed in <a href="#dml2.3.1.3" shape="rect">Section
|
|
2.3.1.3</a>. An error.semantic event is thrown if
|
|
<enumerate> is used elsewhere (for example,
|
|
<enumerate> within an <enumerate>).</p>
|
|
|
|
<h3 id="L225"><a id="dml2.2.5" name="dml2.2.5" shape="rect">2.2.5
|
|
Grammar Generation</a></h3>
|
|
|
|
<p>Any <i>choice phrase</i> specifies a set of words and phrases
|
|
to listen for. A choice phrase is constructed from the PCDATA of
|
|
the elements contained directly or indirectly in a <choice>
|
|
element of a <menu>, or in the <option> element of a
|
|
<field>.</p>
|
|
|
|
<p>If the accept attribute is "exact" then the user must say the
|
|
entire phrase in the same order in which they occur in the choice
|
|
phrase.</p>
|
|
|
|
<p>If the accept attribute is "approximate", then the choice may
|
|
be matched when a user says a subphrase of the expression. For
|
|
example, in response to the prompt "Stargazer astrophysics news"
|
|
a user could say "Stargazer", "astrophysics", "Stargazer news",
|
|
"astrophysics news", and so on. The equivalent grammar may be
|
|
language and platform dependent.</p>
|
|
|
|
<p>As an example of using "exact" and "approximate" in different
|
|
choices, consider this example:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<menu accept="approximate">
|
|
<choice next="http://www.stargazer.example.com/voice/astronews.vxml">
|
|
Stargazer Astrophysics News </choice>
|
|
<choice accept="exact"
|
|
next="http://www.physicsweekly.com/voice/example.vxml">
|
|
Physics Weekly </choice>
|
|
<choice accept="exact"
|
|
next="http://www.particlephysics.com/voice/example.vxml">
|
|
Particle Physics Update </choice>
|
|
<choice next="http://www.astronomytoday.com/voice/example.vxml">
|
|
Astronomy Today </choice>
|
|
</menu>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>Because "approximate" is specified for the first choice, the
|
|
user may say a subphrase when matching the first choice; for
|
|
instance, "Stargazer" or "Astrophysics News". However, because
|
|
"exact" is specified in the second and third choices, only a
|
|
complete phrase will match: "Physics Weekly" and "Particle
|
|
Physics Update".</p>
|
|
|
|
<h3 id="L226"><a id="dml2.2.6" name="dml2.2.6" shape="rect">2.2.6
|
|
Interpretation Model</a></h3>
|
|
|
|
<p>A menu behaves like a form with a single field that does all
|
|
the work. The menu prompts become field prompts. The menu event
|
|
handlers become the field event handlers. The menu grammars
|
|
become <i>form</i> grammars. As with forms, grammar matches in
|
|
menu will update the application.lastresult$ array. These
|
|
variables are described in <a href="#dml5.1.5"
|
|
shape="rect">Section 5.1.5</a>. Generated grammars must always
|
|
produce simple results whose interpretation and utterance values
|
|
are identical.</p>
|
|
|
|
<p>Upon entry, the menu's grammars are built and enabled,
|
|
and the prompt is played. When the user input matches a choice,
|
|
control transitions according to the value of the next, expr,
|
|
event or eventexpr attribute of the <choice>, only one of
|
|
which may be specified. If an event attribute is specified but
|
|
its event handler does not cause the interpreter to exit or
|
|
transition control, then the FIA will clear the form item
|
|
variable of the menu's anonymous field, causing the menu to be
|
|
executed again.</p>
|
|
|
|
<h2 id="L2931"><a id="dml2.3" name="dml2.3" shape="rect">2.3 Form
|
|
Items</a></h2>
|
|
|
|
<p>A <i>form item</i> is an element of a <form> that can be
|
|
visited during form interpretation. These elements are
|
|
<field>, <block>, <initial>, <subdialog>,
|
|
<object>, <record>, and <transfer>.</p>
|
|
|
|
<p>All form items have the following characteristics:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>They have a result variable, specified by the name attribute.
|
|
This variable may be given an initial value with the expr
|
|
attribute.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>They have a guard condition specified with the cond attribute.
|
|
A form item is visited if it is not filled and its cond is not
|
|
specified or evaluates, after conversion to boolean, to true.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>Form items are subdivided into <i>input items</i>, those that
|
|
define the form's input item variables, and <i>control
|
|
items</i>, those that help control the gathering of the
|
|
form's input items. Input items (<field>,
|
|
<subdialog>, <object>, <record>, and
|
|
<transfer>) generally may contain the following
|
|
elements:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p><filled> elements containing some action to execute
|
|
after the result input item variable is filled in.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p><property> elements to specify properties that are in
|
|
effect for this input item (the <initial> form item can
|
|
also contain this element).</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p><prompt> elements to specify prompts to be played when
|
|
this element is visited.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p><grammar> elements to specify allowable spoken and
|
|
character input for this input item (<subdialog> and
|
|
<object> cannot contain this element).</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p><catch> elements and catch shorthands that are in effect
|
|
for this input item (the <initial> form item can also
|
|
contain this element).</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>Each input item may have an associated set of <i>shadow
|
|
variables</i>. Shadow variables are used to return results from
|
|
the execution of an input item, other than the value stored under
|
|
the name attribute. For example, it may be useful to know the
|
|
confidence level that was obtained as a result of a recognized
|
|
grammar in a <field> element. A shadow variable is
|
|
referenced as <i>name</i>$.<i>shadowvar</i> where <i>name</i> is
|
|
the value of the form item's name attribute, and
|
|
<i>shadowvar</i> is the name of a specific shadow variable.
|
|
Shadow variables are writeable and can be modified by the
|
|
application. For example, the <field> element returns a
|
|
shadow variable confidence. The example below illustrates how
|
|
this shadow variable is accessed.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="get_state">
|
|
<field name="state">
|
|
<prompt> Please say the name of a state. </prompt>
|
|
<grammar src="http://mygrammars.example.com/states.gram"
|
|
type="application/srgs"/>
|
|
<filled>
|
|
<if cond="state$.confidence &lt; 0.4">
|
|
<throw event="nomatch"/>
|
|
</if>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>In the example, the confidence of the result is examined, and
|
|
the result is rejected if the confidence is too low.</p>
|
|
|
|
<h3 id="L2999"><a id="dml2.3.1" name="dml2.3.1"
|
|
shape="rect">2.3.1 field element</a></h3>
|
|
|
|
<p>A field specifies an input item to be gathered from the user.
|
|
The field element's attributes are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 9: field attributes">
|
|
<caption align="bottom">Table 9: <field>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>name</th>
|
|
<td>The form item variable in the dialog
|
|
scope that will hold the result. The name must be unique among
|
|
form items in the form. If the name is not unique, then a
|
|
badfetch error is thrown when the document is fetched. The name
|
|
must conform to the variable naming conventions in <a
|
|
href="#dml5.1" shape="rect">Section 5.1</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>The initial value of the form item
|
|
variable; default is ECMAScript undefined. If initialized to a
|
|
value, then the form item will not be visited unless the form
|
|
item variable is cleared.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>cond</th>
|
|
<td>An expression that must evaluate to
|
|
true after conversion to boolean in order for the form item to be
|
|
visited. The form item can also be visited if the attribute is
|
|
not specified.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>type</th>
|
|
<td>The type of field, i.e., the name of
|
|
a builtin grammar type (see <a href="#dmlABuiltins"
|
|
shape="rect">Appendix P</a>). Platform support for builtin
|
|
grammar types is optional. If the specified builtin type is
|
|
not supported by the platform, an error.unsupported.builtin event
|
|
is thrown.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>slot</th>
|
|
<td>The name of the grammar slot used to
|
|
populate the variable (if it is absent, it defaults to the
|
|
variable name). This attribute is useful in the case where the
|
|
grammar format being used has a mechanism for returning sets of
|
|
slot/value pairs and the slot names differ from the form item
|
|
variable names.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>modal</th>
|
|
<td>If this is false (the default) all
|
|
active grammars are turned on while collecting this field. If
|
|
this is true, then only the field's grammars are enabled:
|
|
all others are temporarily disabled.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>The shadow variables of a <field> element with the name
|
|
<i>name</i> are given in Table 10. The values of the utterance,
|
|
inputmode and interpretation shadow variables must
|
|
be the same as those in application.lastresult$ (see <a
|
|
href="#dml5.1.5" shape="rect">Section 5.1.5</a>).</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 10: field shadow variables">
|
|
<caption align="bottom">Table 10: <field> Shadow
|
|
Variables</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th><b><i>name</i>$.utterance</b> </th>
|
|
<td>The raw string of words that were
|
|
recognized. The exact tokenization and spelling is
|
|
platform-specific (e.g. "five hundred thirty" or "5 hundred 30"
|
|
or even "530"). In the case of a DTMF grammar, this variable will
|
|
contain the matched digit string.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><b><i>name</i>$.inputmode</b> </th>
|
|
<td>The mode in which user input was
|
|
provided: dtmf or voice.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><b><i>name</i>$.interpretation</b>
|
|
</th>
|
|
<td>An ECMAScript variable containing the
|
|
interpretation as described in <a href="#dml3.1.5"
|
|
shape="rect">Section 3.1.5</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><b><i>name</i>$.confidence</b> </th>
|
|
<td>
|
|
<p>The confidence level for the <i>name</i> field and may range
|
|
from 0.0-1.0. A value of 0.0 indicates minimum confidence, and a
|
|
value of 1.0 indicates maximum confidence.</p>
|
|
|
|
<p>A platform may use the utterance confidence (the value of
|
|
application.lastresult$.confidence) as the value of
|
|
<i>name</i>$.confidence. This distinction between field and
|
|
utterance level confidence is platform-dependent.</p>
|
|
|
|
<p>More specific interpretation of a confidence value is
|
|
platform-dependent since its computation is likely to differ
|
|
between platforms.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h4 id="L3180"><a id="dml2.3.1.1" name="dml2.3.1.1"
|
|
shape="rect">2.3.1.1. Fields Using Explicit Grammars</a></h4>
|
|
|
|
<p>Explicit grammars can be specified via a URI, which can be
|
|
absolute or relative:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<field name="flavor">
|
|
<prompt>What is your favorite ice cream?</prompt>
|
|
<grammar src="../grammars/ice_cream.grxml"
|
|
type="application/srgs+xml"/>
|
|
</field>
|
|
</pre>
|
|
|
|
<p>Grammars can be specified inline, for example using a W3C ABNF
|
|
grammar:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<field name="flavor">
|
|
<prompt>What is your favorite flavor?</prompt>
|
|
<help>Say one of vanilla, chocolate, or strawberry.</help>
|
|
<grammar mode="voice" type="application/srgs">
|
|
#ABNF 1.0;
|
|
$options = vanilla | chocolate | strawberry
|
|
</grammar>
|
|
</field>
|
|
</pre>
|
|
|
|
<p>If both the <grammar> src attribute and an inline
|
|
grammar are specified, then an error.badfetch is thrown.</p>
|
|
|
|
<h4 id="L3292"><a id="dml2.3.1.2" name="dml2.3.1.2"
|
|
shape="rect">2.3.1.2. Explicit Grammars with
|
|
Platform-specific Builtins</a></h4>
|
|
|
|
<p>Platform support for builtin resources such as speech
|
|
grammars, DTMF grammars and audio files is optional. These
|
|
resources are accessed using platform-specific URIs, such as
|
|
"http://localhost:5000/grammar/boolean", or platform-specific
|
|
schemes such as the commonly used 'builtin' scheme,
|
|
"<i>builtin:</i>grammar/boolean".</p>
|
|
|
|
<p>If a platform supports access to builtin resources, then it
|
|
should support access to fundamental builtin grammars (see <a
|
|
href="#dmlABuiltins" shape="rect">Appendix P</a>); for
|
|
example</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<grammar src="builtin:grammar/boolean"/>
|
|
<grammar src="builtin:dtmf/boolean"/>
|
|
</pre>
|
|
|
|
<p>where the first <grammar> references the builtin boolean
|
|
speech grammar, and the second references the builtin boolean
|
|
DTMF grammar.</p>
|
|
|
|
<p>By definition the following:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<field type="<i>sample</i>">
|
|
<prompt>Prompt for builtin grammar</prompt>
|
|
</field>
|
|
</pre>
|
|
|
|
<p>is equivalent to the following platform-specific builtin
|
|
grammars :</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<field>
|
|
<grammar src="builtin:grammar/<i>sample</i>"/>
|
|
<grammar src="builtin:dtmf/<i>sample</i>"/>
|
|
<prompt>Prompt for builtin grammar</prompt>
|
|
</field>
|
|
</pre>
|
|
|
|
<p>where <i>sample</i> is one of the fundamental builtin field
|
|
types (e.g., boolean, date, etc.).</p>
|
|
|
|
<p>In addition, platform-specific builtin URI schemes may be used
|
|
to access grammars that are supported by particular interpreter
|
|
contexts. It is recommended that platform-specific builtin grammar
|
|
names begin with the string "x-", as this namespace will not be
|
|
used in future versions of the standard.</p>
|
|
|
|
<p>Examples of platform-specific builtin grammars:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<grammar src="builtin:grammar/x-<i>sample</i>"/>
|
|
<grammar src="builtin:dtmf/x-<i>sample</i>"/>
|
|
</pre>
|
|
|
|
<h4 id="L3193"><a id="dml2.3.1.3" name="dml2.3.1.3"
|
|
shape="rect">2.3.1.3. Fields Using Option Lists</a></h4>
|
|
|
|
<p>When a simple set of alternatives is all that is needed to
|
|
specify the legal input values for a field, it may be more
|
|
convenient to use an option list than a grammar. An option list
|
|
is represented by a set of <option> elements contained in a
|
|
<field> element. Each <option> element contains
|
|
PCDATA that is used to generate a speech grammar. This follows
|
|
the grammar generation method described for <choice> in <a
|
|
href="#dml2.2.5" shape="rect">Section 2.2.5</a> . Attributes may
|
|
be used to specify a DTMF sequence for each option and to control
|
|
the value assigned to the field's form item variable. When an
|
|
option is chosen, the value attribute determines the
|
|
interpretation value for the field's shadow variable and for
|
|
application.lastresult$.</p>
|
|
|
|
<p>The following field offers the user three choices and assigns
|
|
the value of the value attribute of the selected option to the
|
|
maincourse variable:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<field name="maincourse">
|
|
<prompt>
|
|
Please select an entree. Today, we are featuring <enumerate/>
|
|
</prompt>
|
|
|
|
<option dtmf="1" value="fish"> swordfish </option>
|
|
<option dtmf="2" value="beef"> roast beef </option>
|
|
<option dtmf="3" value="chicken"> frog legs </option>
|
|
|
|
<filled>
|
|
<submit next="/cgi-bin/maincourse.cgi"
|
|
method="post" namelist="maincourse"/>
|
|
</filled>
|
|
</field>
|
|
</pre>
|
|
|
|
<p>This conversation might sound like:</p>
|
|
|
|
<blockquote>
|
|
<p>C: Please select an entree. Today, we're featuring
|
|
swordfish; roast beef; frog legs.</p>
|
|
|
|
<p>H: frog legs</p>
|
|
|
|
<p>C: <span class="stage">(assigns "chicken" to "maincourse",
|
|
then submits "maincourse=chicken" to /maincourse.cgi)</span></p>
|
|
</blockquote>
|
|
|
|
<p>The following example shows proper and improper use of
|
|
<enumerate> in a catch element of a form with several
|
|
fields containing <option> elements:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form>
|
|
<block>
|
|
We need a few more details to complete your order.
|
|
</block>
|
|
<field name="color">
|
|
<prompt>Which color?</prompt>
|
|
<option>red</option>
|
|
<option>blue</option>
|
|
<option>green</option>
|
|
</field>
|
|
<field name="size">
|
|
<prompt>Which size?</prompt>
|
|
<option>small</option>
|
|
<option>medium</option>
|
|
<option>large</option>
|
|
</field>
|
|
<field name="quantity">
|
|
<grammar type="application/srgs+xml" src="/grammars/number.grxml"/>
|
|
<prompt>How many?</prompt>
|
|
</field>
|
|
<block>
|
|
Thank you. Your order is being processed.
|
|
<submit next="details.cgi" namelist="color size quantity"/>
|
|
</block>
|
|
<catch event="help nomatch">
|
|
Your options are <enumerate/>.
|
|
</catch>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>A scenario might be:</p>
|
|
|
|
<p>C: We need a few more details to complete your order. Which
|
|
color?</p>
|
|
|
|
<p>H: help. (throws "help" event caught by form-level
|
|
<catch>)</p>
|
|
|
|
<p>C: Your options are red, blue, green.</p>
|
|
|
|
<p>H: red.</p>
|
|
|
|
<p>C: Which size?</p>
|
|
|
|
<p>H: 7 (throws "nomatch" event caught by form-level
|
|
<catch>)</p>
|
|
|
|
<p>C: Your options are small, medium, large.</p>
|
|
|
|
<p>H: small.</p>
|
|
|
|
<p>In the steps above, the <enumerate/> in the form-level
|
|
catch had something to enumerate: the <option> elements in
|
|
the "color" and "size" <field> elements. The next
|
|
<field>, however, is different:</p>
|
|
|
|
<p>C: How many?</p>
|
|
|
|
<p>H: a lot. (throws "nomatch" event caught by form-level
|
|
<catch>)</p>
|
|
|
|
<p>The form-level <catch>'s use of <enumerate> causes
|
|
an "error.semantic" event to be thrown because the "quantity"
|
|
<field> does not contain any <option> elements that
|
|
can be enumerated.</p>
|
|
|
|
<p>One solution is to add a field-level <catch> to the
|
|
"quantity" <field>:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<catch event="help nomatch">
|
|
Please say the number of items to be ordered.
|
|
</catch>
|
|
</pre>
|
|
|
|
<p>The "nomatch" event would then be caught locally, resulting in
|
|
the following possible completion of the scenario:</p>
|
|
|
|
<p>C: Please say the number of items to be ordered.</p>
|
|
|
|
<p>H: 50</p>
|
|
|
|
<p>C: Thank you. Your order is being processed.</p>
|
|
|
|
<p>The <enumerate> element is also discussed in <a
|
|
href="#dml2.2.4" shape="rect">Section 2.2.4</a>.</p>
|
|
|
|
<p>The attributes of <option> are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 11: option attributes">
|
|
<caption align="bottom">Table 11: <option>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>dtmf</th>
|
|
<td>An optional DTMF sequence for
|
|
this option. It is equivalent to a simple DTMF
|
|
<grammar> and DTMF properties (<a href="#dml6.3.3"
|
|
shape="rect">Section 6.3.3</a>) apply to recognition of the
|
|
sequence. Unlike DTMF grammars, whitespace is optional:
|
|
dtmf="123#" is equivalent to dtmf="1 2 3 #". If unspecified,
|
|
no DTMF sequence is associated with this option so it cannot
|
|
be matched using DTMF.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>accept</th>
|
|
<td>When set to "exact" (the default),
|
|
the text of the option element defines the exact phrase to be
|
|
recognized. When set to "approximate", the text of the option
|
|
element defines an approximate recognition phrase (as described
|
|
in <a href="#dml2.2.5" shape="rect">Section 2.2.5</a>).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>value</th>
|
|
<td>The string to assign to the
|
|
field's form item variable when a user selects this option,
|
|
whether by speech or DTMF. The default assignment is the CDATA
|
|
content of the <option> element with leading and trailing
|
|
white space removed. If this does not exist, then the DTMF
|
|
sequence is used instead. If neither CDATA content nor a
|
|
dtmf sequence is specified, then the default assignment is
|
|
undefined and the field's form item variable is not
|
|
filled.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>The use of <option> does not preclude the simultaneous
|
|
use of <grammar>. The result would be the match from either
|
|
'grammar', not unlike the occurrence of two <grammar>
|
|
elements in the same <field> representing a disjunction of
|
|
choices.</p>
|
|
|
|
<h3 id="L3429"><a id="dml2.3.2" name="dml2.3.2"
|
|
shape="rect">2.3.2 block element</a></h3>
|
|
|
|
<p>This element is a form item. It contains executable content
|
|
that is executed if the block's form item variable is
|
|
undefined and the block's cond attribute, if any, evaluates to
|
|
true.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<block>
|
|
Welcome to Flamingo, your source for lawn ornaments.
|
|
</block>
|
|
</pre>
|
|
|
|
<p>The form item variable is automatically set to true just
|
|
before the block is entered. Therefore, blocks are typically
|
|
executed just once per form invocation.</p>
|
|
|
|
<p>Sometimes you may need more control over blocks. To do this,
|
|
you can name the form item variable, and set or clear it to
|
|
control execution of the <block>. This variable is declared
|
|
in the dialog scope of the form.</p>
|
|
|
|
<p>Attributes of <block> include:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 12: block attributes">
|
|
<caption align="bottom">Table 12: <block>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>name</th>
|
|
<td>The name of the form item variable
|
|
used to track whether this block is eligible to be executed;
|
|
defaults to an inaccessible internal variable.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>The initial value of the form item
|
|
variable; default is ECMAScript undefined. If initialized to a
|
|
value, then the form item will not be visited unless the form
|
|
item variable is cleared.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>cond</th>
|
|
<td>An expression that must evaluate to
|
|
true after conversion to boolean in order for the form item to be
|
|
visited.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L3475"><a id="dml2.3.3" name="dml2.3.3"
|
|
shape="rect">2.3.3. initial element</a></h3>
|
|
|
|
<p>In a typical mixed initiative form, an <initial> element
|
|
is visited when the user is initially being prompted for
|
|
form-wide information, and has not yet entered into the directed
|
|
mode where each field is visited individually. Like input items,
|
|
it has prompts, catches, and event counters. Unlike input items,
|
|
<initial> has no grammars, and no <filled> action.
|
|
For instance:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="get_from_and_to_cities">
|
|
<grammar src="http://www.directions.example.com/grammars/from_to.grxml"
|
|
type="application/srgs+xml"/>
|
|
<block>
|
|
Welcome to the Driving Directions By Phone.
|
|
</block>
|
|
<initial name="bypass_init">
|
|
<prompt>
|
|
Where do you want to drive from and to?
|
|
</prompt>
|
|
<nomatch count="1">
|
|
Please say something like "from Atlanta Georgia to Toledo Ohio".
|
|
</nomatch>
|
|
<nomatch count="2">
|
|
I'm sorry, I still don't understand.
|
|
I'll ask you for information one piece at a time.
|
|
<assign name="bypass_init" expr="true"/>
|
|
<reprompt/>
|
|
</nomatch>
|
|
</initial>
|
|
<field name="from_city">
|
|
<grammar src="http://www.directions.example.com/grammars/city.grxml"
|
|
type="application/srgs+xml"/>
|
|
<prompt>From which city are you leaving?</prompt>
|
|
</field>
|
|
<field name="to_city">
|
|
<grammar src="http://www.directions.example.com/grammars/city.grxml"
|
|
type="application/srgs+xml"/>
|
|
<prompt>Which city are you going to?</prompt>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>If an event occurs while visiting an <initial>, then one
|
|
of its event handlers executes. As with other form items,
|
|
<initial> continues to be eligible to be visited while its
|
|
form item variable is undefined and while its cond attribute is
|
|
true. If one or more of the input item variables is set by user
|
|
input, then all <initial> form item variables are set to
|
|
true, before any <filled> actions are executed.</p>
|
|
|
|
<p>An <initial> form item variable can be manipulated
|
|
explicitly to disable, or re-enable the <initial>'s
|
|
eligibility to the FIA. For example, in the program above, the
|
|
<initial>'s form item variable is set on the second nomatch
|
|
event. This causes the FIA to no longer consider the
|
|
<initial> and to choose the next form item, which is a
|
|
<field> to prompt explicitly for the origination city.
|
|
Similarly, an <initial>'s form item variable could be
|
|
cleared, so that <initial> gets selected again by the
|
|
FIA.</p>
|
|
|
|
<p>More than one <initial> may be specified in the same
|
|
form. When the form is entered only the first <initial> in
|
|
document order that is eligible according to its cond attribute
|
|
will be visited. After the first form item variable is filled,
|
|
all <initial> form item variables are set to true so that
|
|
they are not visited. Explicitly clearing the <initial>s
|
|
can allow them to be reused, and even allow a different
|
|
<initial> to be selected on subsequent iterations of the
|
|
FIA.</p>
|
|
|
|
<p>The cond attribute can also be used to select which
|
|
<initial> to use in a given iteration. An application could
|
|
provide multiple <initial>s but mark them for use only
|
|
under special circumstances by using their cond attribute; for
|
|
example, if the cond attribute were used to test for novice
|
|
versus advanced operation mode, and only use the <initial>s
|
|
in advanced mode. Furthermore, if the first <initial> in
|
|
document order specified a value for its cond attribute which was
|
|
never fulfilled, then it would never be executed. If all
|
|
<initial>s had cond values which prevented their selection,
|
|
then none would be executed.</p>
|
|
|
|
<p>Normal grammar scoping rules apply when visiting an
|
|
<initial>, as described in <a href="#dml3.1.3"
|
|
shape="rect">Section 3.1.3.</a>. In particular, no grammars
|
|
scoped to a <field> are active.</p>
|
|
|
|
<p>Note: explicit assignment of values to input item variables
|
|
does not affect the value of an <initial>'s form item
|
|
variable.</p>
|
|
|
|
<p>Attributes of <initial> include:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 13: initial attributes">
|
|
<caption align="bottom">Table 13: <initial>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>name</th>
|
|
<td>The name of a form item variable used
|
|
to track whether the <initial> is eligible to execute;
|
|
defaults to an inaccessible internal variable.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>The initial value of the form item
|
|
variable; default is ECMAScript undefined. If initialized to a
|
|
value, then the form item will not be visited unless the form
|
|
item variable is cleared.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>cond</th>
|
|
<td>An expression that must evaluate to
|
|
true after conversion to boolean in order for the form item to be
|
|
visited.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L3525"><a id="dml2.3.4" name="dml2.3.4"
|
|
shape="rect">2.3.4 subdialog element</a></h3>
|
|
|
|
<p>Subdialogs are a mechanism for reusing common dialogs and
|
|
building libraries of reusable applications.</p>
|
|
|
|
<p>The <subdialog> element invokes a 'called' dialog (known
|
|
as the <i>subdialog</i>) identified by its src or srcexpr
|
|
attribute in the 'calling' dialog. The subdialog executes in a
|
|
new execution context that includes all the declarations and
|
|
state information for the subdialog, the subdialog's document,
|
|
and the subdialog's application root (if present), with counters
|
|
reset, and variables initialized. The subdialog proceeds until
|
|
the execution of a <return> or <exit> element, or
|
|
until no form items remain eligible for the FIA to select
|
|
(equivalent to an <exit>). A <return> element causes
|
|
control and data to be returned to the calling dialog (<a
|
|
href="#dml5.3.10" shape="rect">Section 5.3.10</a>). When the
|
|
subdialog returns, its execution context is deleted, and
|
|
execution resumes in the calling dialog with any appropriate
|
|
<filled> elements.</p>
|
|
|
|
<p>The subdialog context and the context of the called dialog are
|
|
independent, even if the dialogs are in the same document.
|
|
Variables in the scope chain of the calling dialog are not shared
|
|
with the called subdialog: there is no sharing of variable
|
|
instances between execution contexts. Even when the subdialog is
|
|
specified in the same document as the calling dialog, its
|
|
execution context contains different variable instances. When the
|
|
subdialog and calling dialog are in different documents but share
|
|
a root document, the subdialog's root variables are likewise
|
|
different instances. All variable bindings applied in the
|
|
subdialog context are lost on return to the calling context.</p>
|
|
|
|
<p>Within the subdialog context, however, normal scoping rules
|
|
for grammars, events and variables apply. Active grammars in a
|
|
subdialog include default grammars defined by the interpreter
|
|
context and appropriately scoped grammars in <link>,
|
|
<menu> and <form> elements in the subdialog's
|
|
document and its root document. Event handling and variable
|
|
binding likewise follow the standard scoping hierarchy.</p>
|
|
|
|
<p>From a programming perspective, subdialogs behave differently
|
|
from subroutines because the calling and called contexts are
|
|
independent. While a subroutine can access variable instances in
|
|
its calling routine, a subdialog cannot access the same variable
|
|
instance defined in its calling dialog. Similarly, subdialogs do
|
|
not follow the event percolation model in languages like Java
|
|
where an event thrown in a method automatically percolates up to
|
|
the calling context if not handled in the called context. Events
|
|
thrown in a subdialog are treated by event handlers defined
|
|
within its context; they can only be passed to the calling
|
|
context by a local event handler which explicitly returns the
|
|
event to the calling context (see <a href="#dml5.3.10"
|
|
shape="rect">Section 5.3.10</a>).</p>
|
|
|
|
<p>The subdialog is specified by the URI reference in the
|
|
<subdialog>'s src or srcexpr attribute (see <a
|
|
href="#ref_RFC2396" shape="rect">[RFC2396]</a>). If this
|
|
URI reference contains an absolute or relative URI, which may
|
|
include a query string, then that URI is fetched and the
|
|
subdialog is found in the resulting document. If the
|
|
<subdialog> has a namelist attribute, then those variables
|
|
are added to the query string of the URI.</p>
|
|
|
|
<p>If the URI reference contains only a fragment (i.e., no
|
|
absolute or relative URI), and if there is no namelist attribute,
|
|
then there is no fetch: the subdialog is found in the current
|
|
document.</p>
|
|
|
|
<p>The URI reference's fragment, if any, specifies the subdialog
|
|
to invoke. When there is no fragment, the subdialog invoked is
|
|
the lexically first dialog in the document.</p>
|
|
|
|
<p>If the URI reference is not valid (i.e. the dialog or document
|
|
does not exist), an error.badfetch must be thrown. Note that for
|
|
errors which occur during a dialog or document transition, the
|
|
scope in which errors are handled is platform specific.</p>
|
|
|
|
<p>The attributes are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 14: subdialog attributes">
|
|
<caption align="bottom">Table 14: <subdialog>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>name</th>
|
|
<td>The result returned from the
|
|
subdialog, an ECMAScript object whose properties are the ones
|
|
defined in the namelist attribute of the <return>
|
|
element.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>The initial value of the form item
|
|
variable; default is ECMAScript undefined. If initialized to a
|
|
value, then the form item will not be visited unless the form
|
|
item variable is cleared.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>cond</th>
|
|
<td>An expression that must evaluate to
|
|
true after conversion to boolean in order for the form item to be
|
|
visited.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>namelist</th>
|
|
<td>The list of variables to submit. The
|
|
default is to submit no variables. If a namelist is supplied, it
|
|
may contain individual variable references which are submitted
|
|
with the same qualification used in the namelist. Declared
|
|
VoiceXML and ECMAScript variables can be referenced. If an
|
|
undeclared variable is referenced in the namelist, then an
|
|
error.semantic is thrown (<a href="#dml5.1.1"
|
|
shape="rect">Section 5.1.1</a>).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>src</th>
|
|
<td>The URI of the subdialog.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>srcexpr</th>
|
|
<td>An ECMAScript expression yielding the
|
|
URI of the subdialog</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>method</th>
|
|
<td>See <a href="#dml5.3.8"
|
|
shape="rect">Section 5.3.8</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>enctype</th>
|
|
<td>See <a href="#dml5.3.8"
|
|
shape="rect">Section 5.3.8</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchaudio</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchaudio
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchtimeout</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchtimeout
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchhint</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
documentfetchhint property</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxage</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the documentmaxage
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxstale</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
documentmaxstale property.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Exactly one of "src" or "srcexpr" must be specified;
|
|
otherwise, an error.badfetch event is thrown.</p>
|
|
|
|
<p>The <subdialog> element may contain elements common to
|
|
all form items, and may also contain <param> elements.
|
|
The <param> elements of a <subdialog> specify the
|
|
parameters to pass to the subdialog. These parameters must be
|
|
declared as <var> elements in the form executed as
|
|
the subdialog or an error.semantic will be thrown. When a
|
|
subdialog initializes, the subdialog's form level
|
|
<var> elements are initialized in document order to
|
|
the value specified by the <param> element with the
|
|
corresponding name. The parameter values are computed by
|
|
evaluating the <param> expr attribute in the context of
|
|
the <param> element. An expr attribute in the <var>
|
|
element is ignored in this case. If no corresponding
|
|
<param> is specified to <var> element, an expr
|
|
attribute is used as a default value, or the variable is
|
|
undefined if the expr attribute is unspecified as with the
|
|
regular <form> element.</p>
|
|
|
|
<p>In the example below, the birthday of an individual is used to
|
|
validate their driver's license. The src attribute of the
|
|
subdialog refers to a form that is within the same document. The
|
|
<param> element is used to pass the birthday value to the
|
|
subdialog.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<!-- form dialog that calls a subdialog -->
|
|
<form>
|
|
<subdialog name="result" src="#getdriverslicense">
|
|
<param name="birthday" expr="'2000-02-10'"/>
|
|
<filled>
|
|
<submit next="http://myservice.example.com/cgi-bin/process"/>
|
|
</filled>
|
|
</subdialog>
|
|
</form>
|
|
|
|
<!-- subdialog to get drivers license -->
|
|
<form id="getdriverslicense">
|
|
<var name="birthday"/>
|
|
<field name="drivelicense">
|
|
<grammar src="http://grammarlib/drivegrammar.grxml"
|
|
type="application/srgs+xml"/>
|
|
<prompt> Please say your drivers license number. </prompt>
|
|
<filled>
|
|
<if cond="validdrivelicense(drivelicense,birthday)">
|
|
<var name="status" expr="true"/>
|
|
<else/>
|
|
<var name="status" expr="false"/>
|
|
</if>
|
|
<return namelist="drivelicense status"/>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>The driver's license value is returned to calling
|
|
dialog, along with a status variable in order to indicate whether
|
|
the license is valid or not.</p>
|
|
|
|
<p>This example also illustrates the convenience of using
|
|
<param> as a means for forwarding data to the subdialog as
|
|
a means of instantiating values in the subdialog without using
|
|
server side scripting. An alternate solution that uses scripting,
|
|
is shown below.</p>
|
|
|
|
<h5 id="Document">Document with form that calls a subdialog</h5>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form>
|
|
<field name="birthday">
|
|
<grammar type="application/srgs+xml" src="/grammars/date.grxml"/>
|
|
What is your birthday?
|
|
</field>
|
|
<subdialog name="result"
|
|
src="/cgi-bin/getlib#getdriverslicense"
|
|
namelist="birthday">
|
|
<filled>
|
|
<submit next="http://myservice.example.com/cgi-bin/process"/>
|
|
</filled>
|
|
</subdialog>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<h5 id="Document1">Document containing the subdialog
|
|
<i>(generated by /cgi-bin/getlib)</i></h5>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="getdriverslicense">
|
|
<var name="birthday" expr="'1980-02-10'"/>
|
|
<!-- Generated by server script -->
|
|
<field name="drivelicense">
|
|
<grammar src="http://grammarlib/drivegrammar.grxml"
|
|
type="application/srgs+xml"/>
|
|
<prompt>
|
|
Please say your drivers license number.
|
|
</prompt>
|
|
<filled>
|
|
<if cond="validdrivelicense(drivelicense,birthday)">
|
|
<var name="status" expr="true"/>
|
|
<else/>
|
|
<var name="status" expr="false"/>
|
|
</if>
|
|
<return namelist="drivelicense status"/>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>In the above example, a server side script had to generate the
|
|
document and embed the birthday value.</p>
|
|
|
|
<p>One last example is shown below that illustrates a subdialog
|
|
to capture general credit card information. First the subdialog
|
|
is defined in a separate document; it is intended to be reusable
|
|
across different applications. It returns a status, the credit
|
|
card number, and the expiry date; if a result cannot be obtained,
|
|
the status is returned with value "no_result".</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<!-- Example of subdialog to collect credit card information. -->
|
|
<!-- file is at http://www.somedomain.example.com/ccn.vxml -->
|
|
<form id="getcredit">
|
|
<var name="status" expr="'no_result'"/>
|
|
|
|
<field name="creditcardnum">
|
|
<prompt>
|
|
What is your credit card number?
|
|
</prompt>
|
|
<help>
|
|
I am trying to collect your credit card information.
|
|
<reprompt/>
|
|
</help>
|
|
<nomatch>
|
|
<return namelist="status"/>
|
|
</nomatch>
|
|
<grammar src="ccn.grxml" type="application/srgs+xml"/>
|
|
</field>
|
|
|
|
<field name="expirydate">
|
|
<grammar type="application/srgs+xml" src="/grammars/date.grxml"/>
|
|
<prompt>
|
|
What is the expiry date of this card?
|
|
</prompt>
|
|
<help>
|
|
I am trying to collect the expiry date of the credit
|
|
card number you provided.
|
|
<reprompt/>
|
|
</help>
|
|
<nomatch>
|
|
<return namelist="status"/>
|
|
</nomatch>
|
|
</field>
|
|
|
|
<block>
|
|
<assign name="status" expr="'result'"/>
|
|
<return namelist="status creditcardnum expirydate"/>
|
|
</block>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>An application that includes a calling dialog is shown below.
|
|
It obtains the name of a software product and operating system
|
|
using a mixed initiative dialog, and then solicits credit card
|
|
information using the subdialog.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<!-- Example main program -->
|
|
<!-- http://www.somedomain.example.com/main.vxml -->
|
|
<!-- calls subdialog ccn.vxml -->
|
|
|
|
<!-- assume this gets defined by some dialog -->
|
|
<var name="username"/>
|
|
|
|
<form id="buysoftware">
|
|
<var name="ccn"/>
|
|
<var name="exp"/>
|
|
<grammar src="buysoftware.grxml" type="application/srgs+xml"/>
|
|
<initial name="start">
|
|
<prompt>
|
|
Please tell us the software product you wish to buy
|
|
and the operating system on which it must run.
|
|
</prompt>
|
|
<noinput>
|
|
<assign name="start" expr="true"/>
|
|
</noinput>
|
|
</initial>
|
|
|
|
<field name="product">
|
|
<prompt>
|
|
Which software product would you like to buy?
|
|
</prompt>
|
|
</field>
|
|
|
|
<field name="operatingsystem">
|
|
<prompt>
|
|
Which operating system does this software need to run on?
|
|
</prompt>
|
|
</field>
|
|
|
|
<subdialog name="cc_results"
|
|
src="http://somedomain.example.com/ccn.vxml">
|
|
<filled>
|
|
<if cond="cc_results.status=='no_result'">
|
|
Sorry, your credit card information could not be
|
|
Obtained. This order is cancelled.
|
|
<exit/>
|
|
<else/>
|
|
<assign name="ccn" expr="cc_results.creditcardnum"/>
|
|
<assign name="exp" expr="cc_results.expirydate"/>
|
|
</if>
|
|
</filled>
|
|
</subdialog>
|
|
|
|
<block>
|
|
We will now process your order. Please hold.
|
|
<submit next="www.somedomain.example.com/process_order.asp"
|
|
namelist="username product operatingsystem ccn exp"/>
|
|
</block>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<h3 id="L3697"><a id="dml2.3.5" name="dml2.3.5"
|
|
shape="rect">2.3.5. object element</a></h3>
|
|
|
|
<p>A VoiceXML implementation platform may expose
|
|
platform-specific functionality for use by a VoiceXML application
|
|
via the <object> element. The <object> element makes
|
|
direct use of its own content during initialization (e.g.
|
|
<param> child element) and execution. As a result,
|
|
<object> content cannot be treated as alternative content.
|
|
Notice that like other input items, <object> has prompts
|
|
and catch elements. It may also have <filled> actions.</p>
|
|
|
|
<p>For example, a platform-specific credit card collection object
|
|
could be accessed like this:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<object
|
|
name="debit"
|
|
classid="method://credit-card/gather_and_debit"
|
|
data="http://www.recordings.example.com/prompts/credit/jesse.jar">
|
|
<param name="amount" expr="document.amt"/>
|
|
<param name="vendor" expr="vendor_num"/>
|
|
</object>
|
|
</pre>
|
|
|
|
<p>In this example, the <param> element (<a href="#dml6.4"
|
|
shape="rect">Section 6.4</a>) is used to pass parameters to the
|
|
object when it is invoked. When this <object> is executed,
|
|
it returns an ECMAScript object as the value of its form item
|
|
variable. This <block> presents the values returned from
|
|
the credit card object:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<block>
|
|
<prompt>
|
|
The card type is <value expr="debit.card"/>.
|
|
</prompt>
|
|
|
|
<prompt>
|
|
The card number is <value expr="debit.card_no"/>.
|
|
</prompt>
|
|
|
|
<prompt>
|
|
The expiration date is <value expr="debit.expiry_date"/>.
|
|
</prompt>
|
|
|
|
<prompt>
|
|
The approval code is <value expr="debit.approval_code"/>.
|
|
</prompt>
|
|
|
|
<prompt>The confirmation number is
|
|
<value expr="debit.conf_no"/>.
|
|
</prompt>
|
|
</block>
|
|
</pre>
|
|
|
|
<p>As another example, suppose that a platform has a feature that
|
|
allows the user to enter arbitrary text messages using a
|
|
telephone keypad.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="gather_pager_message">
|
|
<object name="message"
|
|
classid="builtin://keypad-text-input">
|
|
<prompt>
|
|
Enter your message by pressing your keypad once
|
|
per letter. For a space, enter star. To end the
|
|
message, press the pound sign.
|
|
</prompt>
|
|
</object>
|
|
|
|
<block>
|
|
<assign name="document.pager_message" expr="message.text"/>
|
|
<goto next="#confirm_pager_message"/>
|
|
</block>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>The user is first prompted for the pager message, then keys it
|
|
in. The <block> copies the message to the variable
|
|
document.pager_message.</p>
|
|
|
|
<p>Attributes of <object> include:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 15: object attributes">
|
|
<caption align="bottom">Table 15: <object>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>name</th>
|
|
<td>When the object is evaluated, it sets
|
|
this variable to an ECMAScript value whose type is defined by the
|
|
object.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>The initial value of the form item
|
|
variable; default is ECMAScript undefined. If initialized to a
|
|
value, then the form item will not be visited unless the form
|
|
item variable is cleared.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>cond</th>
|
|
<td>An expression that must evaluate to
|
|
true after conversion to boolean in order for the form item to be
|
|
visited.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>classid</th>
|
|
<td>The URI specifying the location of
|
|
the object's implementation. The URI conventions are
|
|
platform-dependent.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>codebase</th>
|
|
<td>The base path used to resolve
|
|
relative URIs specified by classid, data, and archive. It
|
|
defaults to the base URI of the current document.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>codetype</th>
|
|
<td>The content type of data expected
|
|
when downloading the object specified by classid. When absent it
|
|
defaults to the value of the type attribute.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>data</th>
|
|
<td>The URI specifying the location of
|
|
the object's data. If it is a relative URI, it is
|
|
interpreted relative to the codebase attribute.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>type</th>
|
|
<td>The content type of the data
|
|
specified by the data attribute.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>archive</th>
|
|
<td>A space-separated list of URIs for
|
|
archives containing resources relevant to the object, which may
|
|
include the resources specified by the classid and data
|
|
attributes. URIs which are relative are interpreted relative to
|
|
the codebase attribute.<br />
|
|
<br />
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchhint</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
objectfetchhint property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchtimeout</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchtimeout
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxage</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the objectmaxage
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxstale</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the objectmaxstale
|
|
property.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>There is no requirement for implementations to provide
|
|
platform-specific objects, although implementations must handle
|
|
the <object> element by throwing
|
|
error.unsupported.objectname if the particular platform-specific
|
|
object is not supported (note that 'objectname' in
|
|
error.unsupported.objectname is a fixed string, so not
|
|
substituted with the name of the unsupported object). If
|
|
an implementation does this, it is considered to be supporting
|
|
the <object> element.</p>
|
|
|
|
<p>The object itself is responsible for determining whether
|
|
parameter names or values it receives are invalid. If so, the
|
|
<object> element throws an error. The error may be either
|
|
object-specific or one of the standard errors listed in <a
|
|
href="#dml5.2.6" shape="rect">Section 5.2.6</a>.</p>
|
|
|
|
<h3 id="L3844"><a id="dml2.3.6" name="dml2.3.6"
|
|
shape="rect">2.3.6. record element</a></h3>
|
|
|
|
<p>The <record> element is an input item that collects a
|
|
recording from the user. A reference to the recorded audio is
|
|
stored in the input item variable, which can be played back
|
|
(using the expr attribute on <audio>) or submitted to a
|
|
server, as shown in this example:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form>
|
|
<property name="bargein" value="true"/>
|
|
<block>
|
|
<prompt>
|
|
Riley is not available to take your call.
|
|
</prompt>
|
|
</block>
|
|
<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"
|
|
method="post" namelist="msg"/>
|
|
</if>
|
|
<clear/>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>The user is prompted to record a message, and then records it.
|
|
The recording terminates when one of the following conditions is
|
|
met: the interval of final silence occurs, a DTMF key is pressed,
|
|
the maximum recording time is exceeded, or the caller hangs up.
|
|
The recording is played back, and if the user approves it, is
|
|
sent on to the server for storage using the HTTP POST method.
|
|
Notice that like other input items, <record> has grammar,
|
|
prompt and catch elements. It may also have <filled>
|
|
actions.</p>
|
|
|
|
<p class="fig"><img
|
|
alt="Timing diagram showing an example of prompting a user for input,
|
|
then recording the user's voice." src="Images/image026.gif"
|
|
width="600" /><br />
|
|
Figure 7: Timing of prompts, audio recording, and DTMF input</p>
|
|
|
|
<p>When a user hangs up during recording, the recording
|
|
terminates and a connection.disconnect.hangup event is thrown.
|
|
However, audio recorded up until the hangup is available through
|
|
the <record> variable. Applications, such as simple
|
|
voicemail services, can then return audio data to a server even
|
|
after disconnection:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<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>
|
|
<catch event="connection.disconnect.hangup">
|
|
<submit next="./voicemail_server.asp"/>
|
|
</catch>
|
|
</record>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>A <i>recording begins</i> at the earliest after the playback
|
|
of any prompts (including the 'beep' tone if defined). As an
|
|
optimization, a platform may begin recording when the user starts
|
|
speaking.</p>
|
|
|
|
<p>A timeout interval is defined to begin immediately after
|
|
prompt playback (including the 'beep' tone if defined) and its
|
|
duration is determined by the 'timeout' property. If the timeout
|
|
interval is exceeded before recording begins, then a
|
|
<noinput> event is thrown.</p>
|
|
|
|
<p>A maxtime interval is defined to begin when recording begins
|
|
and its duration is determined by a 'maxtime' attribute. If the
|
|
maxtime interval is exceeded before recording ends, then the
|
|
recording is terminated and the maxtime shadow variable is set to
|
|
'true'.</p>
|
|
|
|
<p>A <i>recording ends</i> when an event is thrown, DTMF or
|
|
speech input matches an active grammar, or the maxtime interval
|
|
is exceeded. As an optimization, a platform may end recording
|
|
after a silence interval (set by the 'finalsilence' attribute)
|
|
indicating the user has stopped speaking.</p>
|
|
|
|
<p>If no audio is collected during execution of <record>,
|
|
then the record variable remains unfilled (<a
|
|
href="#unfilled_record" shape="rect">note</a>). This can occur,
|
|
for example, when DTMF or speech input is received during prompt
|
|
playback or before the timeout interval expires. In particular,
|
|
if no audio is collected before the user terminates recording
|
|
with DTMF input matching a local DTMF grammar (or when the
|
|
dtmfterm attribute is set to true), then the record variable is
|
|
not filled (so shadow variables are not set), and the FIA applies
|
|
as normal without a noinput event being thrown. However,
|
|
information about the input may be available in these situations
|
|
via application.lastresult$
|
|
as described in <a href="#dml5.1.5" shape="rect">Section
|
|
5.1.5</a>.</p>
|
|
|
|
<p>The <record> element contains a 'dtmfterm' attribute as
|
|
a developer convenience. A 'dtmfterm' attribute with the value
|
|
'true' is equivalent to the definition of a local DTMF grammar
|
|
which matches any DTMF input. The dtmfterm attribute has
|
|
priority over specified local DTMF grammars.</p>
|
|
|
|
<p>Any DTMF keypress matching an active grammar terminates
|
|
recording. DTMF keypresses not matching an active grammar are
|
|
ignored (and therefore do not terminate or otherwise affect
|
|
recording) and may optionally be removed from the signal by the
|
|
platform.</p>
|
|
|
|
<p>Platform support for recognition of speech grammars during
|
|
recording is optional. If the platform supports simultaneous
|
|
recognition and recording, then spoken input matching an
|
|
active non-local speech grammar terminates recording and the
|
|
FIA is invoked, transferring execution to the element
|
|
containing the grammar. The 'terminating' speech input is
|
|
accessible via application.lastresult$. The audio of the
|
|
recognized 'terminating' speech input is not available and is
|
|
not part of the recording. Note that, unlike DTMF, speech
|
|
recognition input cannot be used just to terminate recording:
|
|
if local speech grammars are specified, they are treated as
|
|
inactive (i.e. they are ignored), even if the platform supports
|
|
simultaneous recognition and recording.</p>
|
|
|
|
<p>If the termination grammar matched is a local grammar, the
|
|
recording is placed in the record variable. Otherwise, the record
|
|
variable is left unfilled (<a href="#unfilled_record"
|
|
shape="rect">note</a>) and the form interpretation algorithm is
|
|
invoked. In each case, application.lastresult$ is assigned.</p>
|
|
|
|
<p><i><a id="unfilled_record" name="unfilled_record"
|
|
shape="rect">note</a></i> Although the record variable is not
|
|
filled with a recording in this case, a match of a non-local
|
|
grammar may nevertheless result in an assignment of some value to
|
|
the record variable (see <a href="#dml3.1.6" shape="rect">Section
|
|
3.1.6</a>).</p>
|
|
|
|
<p>The attributes of <record> are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 16: record attributes">
|
|
<caption align="bottom">Table 16: <record>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>name</th>
|
|
<td>
|
|
<p>The input item variable that will hold the recording.</p>
|
|
|
|
<p>Note that how this variable is implemented may vary between
|
|
platforms (although all platforms must support its behaviour in
|
|
<audio> and <submit> as described in this
|
|
specification).</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>The initial value of the form item
|
|
variable; default is ECMAScript undefined. If initialized to a
|
|
value, then the form item will not be visited unless the form
|
|
item variable is cleared.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>cond</th>
|
|
<td>An expression that must evaluate to
|
|
true after conversion to boolean in order for the form item to be
|
|
visited.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>modal</th>
|
|
<td>If this is true (the default) all
|
|
non-local speech and DTMF grammars are not active while making
|
|
the recording. If this is false, non-local speech and DTMF
|
|
grammars are active.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>beep</th>
|
|
<td>If true, a tone is emitted just prior
|
|
to recording. Defaults to false.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxtime</th>
|
|
<td>The maximum duration to record.
|
|
The value is a Time Designation (see <a href="#dml6.5"
|
|
shape="rect">Section 6.5</a>). Defaults to a
|
|
platform-specific value.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>finalsilence</th>
|
|
<td>The interval of silence that
|
|
indicates end of speech. The value is a Time Designation
|
|
(see <a href="#dml6.5" shape="rect">Section 6.5</a>).
|
|
Defaults to a platform-specific value.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>dtmfterm</th>
|
|
<td>If true, any DTMF keypress not
|
|
matched by an active grammar will be treated as a match of an
|
|
active (anonymous) local DTMF grammar. Defaults to true.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>type</th>
|
|
<td>The media format of the resulting
|
|
recording. Platforms must support the audio file formats
|
|
specified in <a href="#dmlAAudioFormats" shape="rect">Appendix
|
|
E</a> (other formats may also be supported). Defaults to a
|
|
platform-specific format which should be one of the required
|
|
formats.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>The <record> element has the following shadow variables
|
|
set after the recording has been made:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 17: record shadow variables">
|
|
<caption align="bottom">Table 17: <record> Shadow
|
|
Variables</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th><b><i>name</i>$.duration</b> </th>
|
|
<td>The duration of the recording in
|
|
milliseconds.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><b><i>name</i>$.size</b> </th>
|
|
<td>The size of the recording in
|
|
bytes.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><b><i>name</i>$.termchar</b> </th>
|
|
<td>If the dtmfterm attribute is true,
|
|
and the user terminates the recording by pressing a DTMF key,
|
|
then this shadow variable is the key pressed (e.g. "#").
|
|
Otherwise it is undefined.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><b><i>name</i>$.maxtime</b> </th>
|
|
<td>Boolean, true if the recording was
|
|
terminated because the maxtime duration was reached.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L4002"><a id="dml2.3.7" name="dml2.3.7"
|
|
shape="rect">2.3.7. transfer element</a></h3>
|
|
|
|
<p>The <transfer> element directs the interpreter to
|
|
connect the caller to another entity (e.g. telephone line or
|
|
another voice application). During the transfer operation, the
|
|
current interpreter session is suspended.</p>
|
|
|
|
<p>There are a variety of ways an implementation platform can
|
|
initiate a transfer, including "bridge", "blind", network-based
|
|
redirect (sometimes referred to as "take back and transfer"),
|
|
"switchhook transfer", etc. Bridge and blind transfer types are
|
|
supported; the others are highly dependent upon specific platform
|
|
and network features and configuration and therefore are outside
|
|
the scope of this specification.</p>
|
|
|
|
<p>The <transfer> element is optional, though platforms
|
|
should support it. Platforms that support <transfer> may
|
|
support bridge or blind transfer types, or both. Platforms that
|
|
support either type of transfer may optionally support bargein
|
|
input modes of DTMF, speech recognition, or both, during the call
|
|
transfer to drop the far-end. Blind transfer attempts can only
|
|
be cancelled up to the point the outgoing call begins.</p>
|
|
|
|
<p>Attributes are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 18: transfer attributes">
|
|
<caption align="bottom">Table 18: <transfer>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>name</th>
|
|
<td>Stores the outcome of a bridge
|
|
transfer attempt. In the case of a blind transfer, this variable
|
|
is undefined.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>The initial value of the form item
|
|
variable; default is ECMAScript undefined. If initialized to a
|
|
value, then the form item will not be visited unless the form
|
|
item variable is cleared.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>cond</th>
|
|
<td>An expression that must evaluate to
|
|
true in order for the form item to be visited.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>dest</th>
|
|
<td>The URI of the destination
|
|
(telephone, IP telephony address). Platforms must support the
|
|
tel: URL syntax described in <a href="#ref_RFC2806"
|
|
shape="rect">[RFC2806]</a> and may support other URI-based
|
|
addressing schemes.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>destexpr</th>
|
|
<td>An ECMAScript expression yielding the
|
|
URI of the destination.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>bridge</th>
|
|
<td>
|
|
<p>Determines whether the platform remains in the connection with
|
|
the caller and callee.</p>
|
|
|
|
<dl>
|
|
<dt>bridge="true"</dt>
|
|
|
|
<dd>
|
|
<p><i>Bridge transfer.</i> The platform adds the callee to the
|
|
connection. Document interpretation suspends until the
|
|
transferred call terminates. The platform remains in the
|
|
connection for the duration of the transferred call; listening
|
|
during transfer is controlled by any included
|
|
<grammar>s.</p>
|
|
|
|
<p>If the caller disconnects by going onhook or if the network
|
|
disconnects the caller, the platform throws a
|
|
connection.disconnect.hangup event.</p>
|
|
|
|
<p>If the connection is released for any other reason, that
|
|
outcome is reported in the name attribute (see the following
|
|
table).</p>
|
|
</dd>
|
|
|
|
<dt>bridge="false"</dt>
|
|
|
|
<dd>
|
|
<p><i>Blind transfer (default).</i> The platform redirects the
|
|
caller to the callee without remaining in the connection, and
|
|
does not monitor the outcome.</p>
|
|
|
|
<p>The platform throws a connection.disconnect.transfer
|
|
immediately, regardless of whether the transfer was successful or
|
|
not.</p>
|
|
</dd>
|
|
</dl>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>connecttimeout</th>
|
|
<td>The time to wait while trying to
|
|
connect the call before returning the noanswer condition.
|
|
The value is a Time Designation (see <a href="#dml6.5"
|
|
shape="rect">Section 6.5</a>). Only applies if bridge is
|
|
true. Default is platform specific.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th height="56">maxtime</th>
|
|
<td height="56">The time that the call
|
|
is allowed to last, or 0s if no limit is imposed. The value is
|
|
a Time Designation (see <a href="#dml6.5" shape="rect">Section
|
|
6.5</a>). Only applies if bridge is true. Default is 0s.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>transferaudio</th>
|
|
<td>
|
|
<p>The URI of audio source to play while the transfer attempt is
|
|
in progress (before far-end answer).</p>
|
|
|
|
<p>If the resource cannot be fetched, the error is ignored and
|
|
the transfer continues; what the caller hears is
|
|
platform-dependent.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th height="120">aai</th>
|
|
<td height="120">
|
|
<p>Application-to-application information. A string containing
|
|
data sent to an application on the far-end, available in the
|
|
session variable session.connection.aai.</p>
|
|
|
|
<p>The transmission of aai data may depend upon signaling network
|
|
gateways and data translation (e.g. ISDN to SIP); the status of
|
|
data sent to a remote site is not known or reported.</p>
|
|
|
|
<p>Although all platforms must support the aai attribute,
|
|
platforms are not required to send aai data and need not support
|
|
receipt of aai data. Platforms that cannot receive aai data must
|
|
set the session.connection.aai variable to the ECMAScript
|
|
undefined value. The underlying transmission mechanism may impose
|
|
data length limits.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th height="120">aaiexpr</th>
|
|
<td height="120">
|
|
<p>An ECMAScript expression yielding the AAI data.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Exactly one of "dest" or "destexpr" may be specified;
|
|
otherwise, an error.badfetch event is thrown. Likewise, exactly
|
|
one of "aai" or "aaiexpr" may be specified; otherwise, an
|
|
error.badfetch event is thrown.</p>
|
|
|
|
<h4 id="L40021"><a id="dml2.3.7.1" name="dml2.3.7.1"
|
|
shape="rect">2.3.7.1 Blind Transfer</a></h4>
|
|
|
|
<p>With a blind transfer, an attempt is made to connect the
|
|
original caller with the callee. Any prompts preceding the
|
|
<transfer>, as well as prompts within the <transfer>,
|
|
are queued and played before the transfer attempt begins; bargein
|
|
properties apply as normal.</p>
|
|
|
|
<p class="fig"><img
|
|
alt="The VoiceXML implementation platform is not part of the audio connection between the caller and callee after a blind transfer. "
|
|
src="Images/image023.gif" /><br />
|
|
Figure 8: Audio Connections during a blind transfer:
|
|
<transfer bridge="false"></p>
|
|
|
|
<p>Any audio source specified by the transferaudio attribute is
|
|
ignored since no audio can be played from the platform to the
|
|
caller during the transfer attempt. Whether the connection is
|
|
successful or not, the implementation platform cannot regain
|
|
control of the connections.</p>
|
|
|
|
<p>Connection status is not available. For example, it is not
|
|
possible to know whether the callee was busy, when a successful
|
|
call ends, etc. However, some error conditions may be reported if
|
|
known to the platform, such as if the caller is not authorized to
|
|
call the destination, or if the destination URI is malformed.
|
|
These are platform-specific, but should follow the naming
|
|
convention of other transfer form item variable values.</p>
|
|
|
|
<p>The caller can cancel the transfer attempt before the outgoing
|
|
call begins by barging in with a speech or DTMF command that
|
|
matches an active grammar during the playback of any queued
|
|
audio.</p>
|
|
|
|
<p>In this case, the form item variable is set, and the following
|
|
shadow variables are set:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="88%" border="1"
|
|
summary="Table 19: transfer shadow variables">
|
|
<caption align="bottom">Table 19: <transfer> Shadow
|
|
Variables</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th><b><i>name</i>$.duration</b></th>
|
|
<td>
|
|
<p>The duration of a call transfer in seconds.</p>
|
|
|
|
<p>The duration is 0 if a call attempt was terminated by the
|
|
caller (using a voice or DTMF command) before the outgoing call
|
|
begins.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><b><i>name</i>$.inputmode</b></th>
|
|
<td>
|
|
<p>The input mode of the terminating command (dtmf or voice), or
|
|
undefined if the transfer was not terminated by a grammar
|
|
match.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><b><i>name</i>$.utterance</b></th>
|
|
<td>The utterance text used if transfer
|
|
was terminated by speech recognition input or the DTMF result if
|
|
the transfer was terminated by DTMF input; otherwise it is
|
|
undefined.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Also, the application.lastresult$ variable will be filled as
|
|
described in <a href="#dml5.1.5" shape="rect">Section
|
|
5.1.5</a>.</p>
|
|
|
|
<p>If the caller disconnects by hanging up during a call transfer
|
|
attempt before the connection to the callee begins, a
|
|
connection.disconnect.hangup event will be thrown, and dialog
|
|
execution will transition to a handler for the hangup event (if
|
|
one exists). The form item variable, and thus shadow variables,
|
|
will not be set.</p>
|
|
|
|
<p>Once the transfer begins and the interpreter disconnects from
|
|
the session, the platform throws connection.disconnect.transfer
|
|
and document interpretation continues normally.</p>
|
|
|
|
<p>Any connection between the caller and callee remains in place
|
|
regardless of document execution.</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="96%" border="1"
|
|
summary="Table 20: blind transfer">
|
|
<caption align="bottom">Table 20: Blind Transfer
|
|
Outcomes</caption>
|
|
|
|
<tr bgcolor="#eeeeee">
|
|
<th width="11%">Action</th>
|
|
<td width="11%"><b>Value of form<br
|
|
clear="none" />
|
|
item variable</b> </td>
|
|
<td width="37%"><b>Event or Error</b>
|
|
</td>
|
|
<td width="41%"><b>Reason</b> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="11%">transfer begins</th>
|
|
<td width="11%"><i>undefined</i></td>
|
|
<td width="37%">connection.disconnect.transfer</td>
|
|
<td width="41%">An attempt has been made
|
|
to transfer the caller to another line and will not return.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="11%">caller cancels transfer
|
|
before outgoing call begins</th>
|
|
<td width="11%">near_end_disconnect</td>
|
|
<td width="37%"> </td>
|
|
<td width="41%">The caller cancelled the
|
|
transfer attempt via a DTMF or voice command before the outgoing
|
|
call begins (during playback of queued audio).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="11%">transfer ends</th>
|
|
<td width="11%">unknown</td>
|
|
<td width="37%"> </td>
|
|
<td width="41%">The transfer ended but
|
|
the reason is not known.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h4 id="L40022"><a id="dml2.3.7.2" name="dml2.3.7.2"
|
|
shape="rect">2.3.7.2 Bridge Transfer</a></h4>
|
|
|
|
<p>For a bridge transfer, the platform connects the caller to the
|
|
callee in a full duplex conversation.</p>
|
|
|
|
<p class="fig"><img
|
|
alt="VoiceXML implementation platform (party B) involved in a bridge transfer between a caller
|
|
and callee." src="Images/image024.gif" /><br />
|
|
Figure 9: Audio Connections during a bridge transfer:
|
|
<transfer bridge="true"></p>
|
|
|
|
<p>Any prompts preceding the <transfer>, as well as
|
|
prompts within the <transfer>, are queued and played before
|
|
the transfer attempt begins. The bargein control applies
|
|
normally. Specification of bargeintype is ignored; "hotword" is
|
|
set by default.</p>
|
|
|
|
<p>The caller can cancel the transfer attempt before the outgoing
|
|
call begins by barging in with a speech or DTMF command that
|
|
matches an active grammar during the playback of any queued
|
|
audio.</p>
|
|
|
|
<h5 id="L400221"><a id="dml2.3.7.2.1" name="dml2.3.7.2.1"
|
|
shape="rect">2.3.7.2.1 Listening for user input during a
|
|
transfer</a></h5>
|
|
|
|
<p>Platforms may optionally support listening for caller commands
|
|
to terminate the transfer by specifying one or more grammars
|
|
inside the <transfer> element. The <transfer>
|
|
element is modal in that no grammar defined outside its scope is
|
|
active. The platform will monitor during playing of prompts and
|
|
during the entire length of the transfer connecting and talking
|
|
phases:</p>
|
|
|
|
<ul>
|
|
<li>DTMF input from the caller matching an included DTMF
|
|
grammar</li>
|
|
|
|
<li>an utterance from the caller matching an included speech
|
|
grammar</li>
|
|
</ul>
|
|
|
|
<p>A successful match will terminate the transfer (the connection
|
|
to the callee); document interpretation continues normally.
|
|
An unsuccessful match is ignored. If no grammars are specified,
|
|
the platform will not listen to input from the caller.</p>
|
|
|
|
<p>The platform does not monitor in-band signals or voice input
|
|
from the callee.</p>
|
|
|
|
<h5 id="L400222"><a id="dml2.3.7.2.2" name="dml2.3.7.2.2"
|
|
shape="rect">2.3.7.2.2 Handling caller, callee, or network
|
|
disconnections</a></h5>
|
|
|
|
<p>While attempting to connect to the callee, the platform
|
|
monitors call progress indicators (in-band and/or out-of-band,
|
|
depending upon the particular connection type and protocols). For
|
|
the duration of a successful transfer, the platform monitors for
|
|
(out-of-band) telephony events, such as disconnect, on both call
|
|
legs.</p>
|
|
|
|
<p>If the callee disconnects, the caller resumes his session with
|
|
the interpreter. If the caller disconnects, the platform
|
|
disconnects the callee, and document interpretation continues
|
|
normally. If both the caller and callee are disconnected by the
|
|
network, document interpretation continues normally.</p>
|
|
|
|
<p>The possible outcomes for a bridge transfer before the
|
|
connection to the callee is established are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="94%" border="1"
|
|
summary="Table 21: bridged transfer outcomes prior to connection">
|
|
<caption align="bottom">Table 21: Bridged Transfer Outcomes Prior
|
|
to Connection Being Established</caption>
|
|
|
|
<tr bgcolor="#eeeeee">
|
|
<th width="14%">Action</th>
|
|
<td width="16%"><b>Value of form<br
|
|
clear="none" />
|
|
item variable</b> </td>
|
|
<td width="31%"><b>Event</b> </td>
|
|
<td width="39%"><b>Reason</b> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="14%">caller disconnects</th>
|
|
<td width="16%"> </td>
|
|
<td width="31%">connection.disconnect.hangup</td>
|
|
<td width="39%">The caller hung up.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="16%">caller disconnects
|
|
callee</th>
|
|
<td width="23%">near_end_disconnect</td>
|
|
<td width="32%"> </td>
|
|
<td width="29%">The caller forced the
|
|
callee to disconnect via a DTMF or voice command.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="14%">callee busy</th>
|
|
<td width="16%">busy</td>
|
|
<td width="31%"> </td>
|
|
<td width="39%">The callee was busy.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="14%">network busy</th>
|
|
<td width="16%">network_busy</td>
|
|
<td width="31%"> </td>
|
|
<td width="39%">An intermediate network
|
|
refused the call.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="14%">callee does not
|
|
answer</th>
|
|
<td width="16%">noanswer</td>
|
|
<td width="31%"> </td>
|
|
<td width="39%">There was no answer
|
|
within the time specified by the connecttimeout attribute.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="14%">---</th>
|
|
<td width="16%">unknown</td>
|
|
<td width="31%"> </td>
|
|
<td width="39%">The transfer ended but
|
|
the reason is not known.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>The possible outcomes for a bridge transfer after the
|
|
connection to the callee is established are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="94%" border="1"
|
|
summary="Table 22: bridged transfer outcomes after connection">
|
|
<caption align="bottom">Table 22: Bridged Transfer Outcomes After
|
|
Connection Established</caption>
|
|
|
|
<tbody>
|
|
<tr bgcolor="#eeeeee">
|
|
<th width="16%">Action</th>
|
|
<td width="23%"><b>Value of form<br
|
|
clear="none" />
|
|
item variable</b> </td>
|
|
<td width="32%"><b>Event</b> </td>
|
|
<td width="29%"><b>Reason</b> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="16%">caller disconnects</th>
|
|
<td width="23%"> </td>
|
|
<td width="32%">connection.disconnect.hangup</td>
|
|
<td width="29%">The caller hung up.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="16%">caller disconnects</th>
|
|
<td width="23%">near_end_disconnect</td>
|
|
<td width="32%"> </td>
|
|
<td width="29%">The caller forced the
|
|
callee to disconnect via a DTMF or voice command.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="16%">platform disconnects
|
|
callee</th>
|
|
<td width="23%">maxtime_disconnect</td>
|
|
<td width="32%"> </td>
|
|
<td width="29%">
|
|
<p>The callee was disconnected by the platform because the call
|
|
duration reached the value of maxtime attribute.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="16%">network disconnects
|
|
callee</th>
|
|
<td width="23%">network_disconnect</td>
|
|
<td width="32%"> </td>
|
|
<td width="29%">
|
|
<p>The network disconnected the callee from the platform.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="16%">callee disconnects</th>
|
|
<td width="23%">far_end_disconnect</td>
|
|
<td width="32%"> </td>
|
|
<td width="29%">The callee hung up.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="16%">---</th>
|
|
<td width="23%">unknown</td>
|
|
<td width="32%"> </td>
|
|
<td width="29%">The transfer ended but
|
|
the reason is not known.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>If the caller disconnects by hanging up (either during a call
|
|
transfer or call transfer attempt), the connection to the callee
|
|
(if one exists) is dropped, a connection.disconnect.hangup event
|
|
will be thrown, and dialog execution will transition to a handler
|
|
for the hangup event (if one exists). The form item variable, and
|
|
thus shadow variables, will not be set.</p>
|
|
|
|
<p>If execution of <transfer> continues normally, then its
|
|
form item variable is set, and the following shadow variables
|
|
will be set:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="88%" border="1"
|
|
summary="Table 23: transfer shadow variables">
|
|
<caption align="bottom">Table 23: <transfer> Shadow
|
|
Variables</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th><b><i>name</i>$.duration</b> </th>
|
|
<td>
|
|
<p>The duration of a call transfer in seconds.</p>
|
|
|
|
<p>The duration is 0 if a call attempt was terminated by the
|
|
caller (using a voice or DTMF command) prior to being
|
|
answered.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><b><i>name</i>$.inputmode</b> </th>
|
|
<td>The input mode of the terminating
|
|
command (dtmf or voice) or undefined if the transfer was not
|
|
terminated by a grammar match.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><b><i>name</i>$.utterance</b> </th>
|
|
<td>The utterance text used if transfer
|
|
was terminated by speech recognition input or the DTMF result
|
|
if the transfer was terminated by DTMF input; otherwise it is
|
|
undefined.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>If the transfer was terminated by speech recognition input,
|
|
then application.lastresult$ is assigned as usual.</p>
|
|
|
|
<h5 id="L400223"><a id="dml2.3.7.2.3" name="dml2.3.7.2.3"
|
|
shape="rect">2.3.7.2.3 Audio during bridge transfer
|
|
attempt</a></h5>
|
|
|
|
<p>During a bridge transfer, it might be desirable to play audio
|
|
to the caller while the platform attempts to connect to the
|
|
callee. For example, an advertisement ("Buy Joe's Spicy Shrimp
|
|
Sauce") or informational message ("Your call is very important to
|
|
us; please wait while we connect you to the next available
|
|
agent.") might be provided in place of call progress information
|
|
(ringing, busy, network announcements, etc.).</p>
|
|
|
|
<p>At the point the outgoing call begins, audio specified
|
|
by transferaudio begins playing. Playing of transferaudio
|
|
terminates when the answer status of the far-end connection is
|
|
determined. This status isn't always known, since the far-end
|
|
switch can play audio (such as a special information tone, busy
|
|
tone, network busy tone, or a recording saying the connection
|
|
can't be made) with out actually "answering" the call.</p>
|
|
|
|
<p>If a specified audio file play duration is shorter than the
|
|
time it takes to connect the far-end, the caller may hear
|
|
silence, platform-specific audio, or call progress information,
|
|
depending upon the platform.</p>
|
|
|
|
<h4 id="L40023"><a id="dml2.3.7.3" name="dml2.3.7.3"
|
|
shape="rect">2.3.7.3 Transfer Errors and Events</a></h4>
|
|
|
|
<p>One of the following events may be thrown during a
|
|
transfer:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="91%" border="1"
|
|
summary="Table 24: events thrown during transfer">
|
|
<caption align="bottom">Table 24: Events Thrown During
|
|
Transfer</caption>
|
|
|
|
<tr bgcolor="#eeeeee">
|
|
<th width="42%">Event</th>
|
|
<td width="40%"><b>Reason</b> </td>
|
|
<td width="18%"><b>Transfer<br
|
|
clear="none" />
|
|
type</b> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><b>connection.disconnect.hangup</b>
|
|
</th>
|
|
<td>The caller hung up.</td>
|
|
<td>bridge</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="42%">
|
|
<b>connection.disconnect.transfer</b> </th>
|
|
<td width="40%">An attempt has been made
|
|
to transfer the caller to another line and will not return.</td>
|
|
<td width="18%">blind</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>If a transfer attempt could not be made, one of the following
|
|
errors will be thrown:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="91%" border="1"
|
|
summary="Table 25: errors for transfer failure">
|
|
<caption align="bottom">Table 25: Transfer Attempt Error
|
|
Events</caption>
|
|
|
|
<tbody>
|
|
<tr bgcolor="#eeeeee">
|
|
<th width="42%">Error</th>
|
|
<td width="40%"><b>Reason</b> </td>
|
|
<td width="18%"><b>Transfer<br
|
|
clear="none" />
|
|
type</b> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="42%">
|
|
<dl>
|
|
<dt><b>error.connection.noauthorization</b></dt>
|
|
</dl>
|
|
</th>
|
|
<td>The caller is not allowed to call the
|
|
destination.</td>
|
|
<td>blind and bridge</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>
|
|
<dl>
|
|
<dt><b>error.connection.baddestination</b></dt>
|
|
</dl>
|
|
</th>
|
|
<td width="40%">The destination URI is
|
|
malformed.</td>
|
|
<td width="18%">blind and bridge</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="42%">
|
|
<dl>
|
|
<dt><b>error.connection.noroute</b></dt>
|
|
</dl>
|
|
</th>
|
|
<td width="40%">The platform is not able
|
|
to place a call to the destination.</td>
|
|
<td width="18%">bridge</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="42%">
|
|
<dl>
|
|
<dt><b>error.connection.noresource</b></dt>
|
|
</dl>
|
|
</th>
|
|
<td width="40%">The platform cannot
|
|
allocate resources to place the call.</td>
|
|
<td width="18%">bridge</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="42%">
|
|
<dl>
|
|
<dt><b>error.connection.<i>protocol.nnn</i></b></dt>
|
|
</dl>
|
|
</th>
|
|
<td width="40%">The protocol stack for
|
|
this connection raised an exception that does not correspond to
|
|
one of the other error.connection events.</td>
|
|
<td width="18%">bridge</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="42%">
|
|
<dl>
|
|
<dt><b>error.unsupported.transfer.blind</b></dt>
|
|
</dl>
|
|
</th>
|
|
<td width="40%">The platform does not
|
|
support blind transfer.</td>
|
|
<td width="18%">blind</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="42%">
|
|
<b>error.unsupported.transfer.bridge</b> </th>
|
|
<td width="40%">The platform does not
|
|
support bridge transfer.</td>
|
|
<td width="18%">bridge</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="42%">
|
|
<dl>
|
|
<dt><b>error.unsupported.uri</b></dt>
|
|
</dl>
|
|
</th>
|
|
<td width="40%">The platform does not
|
|
support the URI format used. The special variable _message (<a
|
|
href="#dml5.2.2" shape="rect">Section 5.2.2</a>) will contain the
|
|
string "The URI <i>x</i> is not a supported URI format" where
|
|
<i>x</i> is the URI from the dest or destexpr <transfer>
|
|
attributes.</td>
|
|
<td width="18%">blind and bridge</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h4 id="L40024"><a id="dml2.3.7.4" name="dml2.3.7.4"
|
|
shape="rect">2.3.7.4 Example</a></h4>
|
|
|
|
<p>The following example attempts to perform a bridge transfer
|
|
the caller to a another party, and wait for that conversation to
|
|
terminate. Prompts may be included before or within the
|
|
<transfer> element. This may be used to inform the caller
|
|
of what is happening, with a notice such as "Please wait while we
|
|
transfer your call." The <prompt> within the <block>,
|
|
and the <prompt> within <transfer> are queued and
|
|
played before actually performing the transfer. After the audio
|
|
queue is flushed, the outgoing call is initiated. By default, the
|
|
caller is connected to the outgoing telephony channel. The
|
|
"transferaudio" attribute specifies an audio file to be played to
|
|
the caller in place of audio from the far-end until the far-end
|
|
answers. If the audio source is longer than the connect time, the
|
|
audio will stop playing immediately upon far-end answer.</p>
|
|
|
|
<p class="fig"><img
|
|
alt="Sequence and timing diagram during a bridge transfer. "
|
|
src="Images/image025.gif" /><br />
|
|
Figure 10: Sequence and timing during an example of a bridge
|
|
transfer</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="xfer">
|
|
<var name="mydur" expr="0"/>
|
|
<block>
|
|
<!-- queued and played before starting the transfer -->
|
|
<prompt>
|
|
Calling Riley. Please wait.
|
|
</prompt>
|
|
</block>
|
|
|
|
<!-- Play music while attempting to connect to far-end -->
|
|
<!-- "hotword" bargeintype during transferaudio only -->
|
|
<!-- Wait up to 60 seconds for the far end to answer -->
|
|
<transfer name="mycall" dest="tel:+1-555-123-4567"
|
|
transferaudio="music.wav" connecttimeout="60s" bridge="true">
|
|
|
|
<!-- queued and played before starting the transfer -->
|
|
<!-- bargein properties apply during this prompt -->
|
|
<prompt>
|
|
Say cancel to disconnect this call at any time.
|
|
</prompt>
|
|
|
|
<!-- specify an external grammar to listen for "cancel" command -->
|
|
<grammar src="cancel.grxml" type="application/srgs+xml"/>
|
|
|
|
<filled>
|
|
<assign name="mydur" expr="mycall$.duration"/>
|
|
<if cond="mycall == 'busy'">
|
|
<prompt>
|
|
Riley's line is busy. Please call again later.
|
|
</prompt>
|
|
<elseif cond="mycall == 'noanswer'"/>
|
|
<prompt>
|
|
Riley can't answer the phone now. Please call
|
|
again later.
|
|
</prompt>
|
|
</if>
|
|
</filled>
|
|
</transfer>
|
|
|
|
<!-- submit call statistics to server -->
|
|
<block>
|
|
<submit namelist="mycall mydur" next="/cgi-bin/report"/>
|
|
</block>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<h2 id="L4272"><a id="dml2.4" name="dml2.4" shape="rect">2.4
|
|
Filled</a></h2>
|
|
|
|
<p>The <filled> element specifies an action to perform when
|
|
some combination of input items are filled. It may occur in two
|
|
places: as a child of the <form> element, or as a child of
|
|
an input item.</p>
|
|
|
|
<p>As a child of a <form> element, the <filled>
|
|
element can be used to perform actions that occur when a
|
|
combination of one or more input items is filled. For example,
|
|
the following <filled> element does a cross-check to ensure
|
|
that a starting city field differs from the ending city
|
|
field:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="get_starting_and_ending_cities">
|
|
<field name="start_city">
|
|
<grammar src="http://www.grammars.example.com/voicexml/city.grxml"
|
|
type="application/srgs+xml"/>
|
|
<prompt>What is the starting city?</prompt>
|
|
</field>
|
|
<field name="end_city">
|
|
<grammar src="http://www.grammars.example.com/voicexml/city.grxml"
|
|
type="application/srgs+xml"/>
|
|
<prompt>What is the ending city?</prompt>
|
|
</field>
|
|
<filled mode="all" namelist="start_city end_city">
|
|
<if cond="start_city == end_city">
|
|
<prompt>
|
|
You can't fly from and to the same city.
|
|
</prompt>
|
|
<clear/>
|
|
</if>
|
|
</filled>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>If the <filled> element appears inside an input item, it
|
|
specifies an action to perform after that input item is filled
|
|
in:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="get_city">
|
|
<field name="city">
|
|
<grammar type="application/srgs+xml"
|
|
src="http://www.ship-it.example.com/grammars/served_cities.grxml"/>
|
|
<prompt>What is the city?</prompt>
|
|
<filled>
|
|
<if cond="city == 'Novosibirsk'">
|
|
<prompt>
|
|
Note, Novosibirsk service ends next year.
|
|
</prompt>
|
|
</if>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>After each gathering of the user's input, all the input
|
|
items mentioned in the input are set, and then the interpreter
|
|
looks at each <filled> element in document order (no
|
|
preference is given to ones in input items vs. ones in the form).
|
|
Those whose conditions are matched by the utterance are then
|
|
executed in order, until there are no more, or until one
|
|
transfers control or throws an event.</p>
|
|
|
|
<p>Attributes include:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 26: filled attributes">
|
|
<caption align="bottom">Table 26: <filled>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>mode</th>
|
|
<td>Either all (the default), or any. If
|
|
any, this action is executed when any of the specified input
|
|
items is filled by the last user input. If all, this action is
|
|
executed when all of the mentioned input items are filled, and at
|
|
least one has been filled by the last user input. A
|
|
<filled> element in an input item cannot specify a mode;
|
|
if a mode is specified, then an error.badfetch is thrown by
|
|
the platform upon encountering the document.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>namelist</th>
|
|
<td>The input items to trigger on. For a
|
|
<filled> in a form, namelist defaults to the names
|
|
(explicit and implicit) of the form's input items. A
|
|
<filled> element in an input item cannot specify a namelist
|
|
(the namelist in this case is the input item name); if a
|
|
namelist is specified, then an error.badfetch is thrown by the
|
|
platform upon encountering the document. Note that control
|
|
items are not permitted in this list; an error.badfetch is
|
|
thrown when the document contains a <filled> element with a
|
|
namelist attribute referencing a control item variable.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h2 id="L4317"><a id="dml2.5" name="dml2.5" shape="rect">2.5
|
|
Links</a></h2>
|
|
|
|
<p>A <link> element may have one or more grammars which are
|
|
scoped to the element containing the <link>. A
|
|
"scope" attribute on the element containing the <link> has
|
|
no effect on the scope of the <link> grammars (for example,
|
|
when a <link> is contained in a <form> with
|
|
scope="document", the <link> grammars are scoped to the
|
|
form, not to the document). Grammar elements contained in
|
|
the <link> are not permitted to specify scope (see <a
|
|
shape="rect" href="#dml3.1.3">Section 3.1.3</a> for details).
|
|
When one of these grammars is matched, the link activates, and
|
|
either:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>Transitions to a new document or dialog (like <goto>),
|
|
or</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Throws an event (like <throw>).</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>For instance, this link activates when you say "books" or
|
|
press "2".</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<link next="http://www.voicexml.org/books/main.vxml">
|
|
<grammar mode="voice" version="1.0" root="root">
|
|
<rule id="root" scope="public">
|
|
<one-of>
|
|
<item>books</item>
|
|
<item>VoiceXML books</item>
|
|
</one-of>
|
|
</rule>
|
|
</grammar>
|
|
<grammar mode="dtmf" version="1.0" root="r2">
|
|
<rule id="r2" scope="public"> 2 </rule>
|
|
</grammar>
|
|
</link>
|
|
</pre>
|
|
|
|
<p>This link takes you to a dynamically determined dialog in the
|
|
current document:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<link expr="'#' + document.helpstate">
|
|
<grammar mode="voice" version="1.0" root="root">
|
|
<rule id="root" scope="public"> help </rule>
|
|
</grammar>
|
|
</link>
|
|
</pre>
|
|
|
|
<p>The <link> element can be a child of <vxml>,
|
|
<form>, or of the form items <field> and
|
|
<initial>. A link at the <vxml> level has grammars
|
|
that are active throughout the document. A link at the
|
|
<form> level has grammars active while the user is in that
|
|
form. If an application root document has a document-level link,
|
|
its grammars are active no matter what document of the
|
|
application is being executed.</p>
|
|
|
|
<p>If execution is in a modal form item, then link grammars at
|
|
the form, document or application level are not active.</p>
|
|
|
|
<p>You can also define a link that, when matched, throws an event
|
|
instead of going to a new document. This event is thrown at the
|
|
current location in the execution, not at the location where the
|
|
link is specified. For example, if the user matches this
|
|
link's grammar or enters '2' on the keypad, a help event is
|
|
thrown in the form item the user was visiting and is handled by
|
|
the best qualified <catch> in the item's scope (see <a
|
|
href="#dml5.2.4" shape="rect">Section 5.2.4</a> for further
|
|
details):</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<link dtmf="2" event="help">
|
|
<grammar mode="voice" version="1.0" root="r5">
|
|
<rule id="r5" scope="public">
|
|
<one-of>
|
|
<item>arrgh</item>
|
|
<item>alas all is lost</item>
|
|
<item>fie ye froward machine</item>
|
|
<item>I don't get it</item>
|
|
</one-of>
|
|
</rule>
|
|
</grammar>
|
|
</link>
|
|
</pre>
|
|
|
|
<p>When a link is matched, application.lastresult$ is assigned.
|
|
This allows callflow decisions to be made downstream based on the
|
|
actual semantic result. An example appears in <a href="#dml5.1.5"
|
|
shape="rect">Section 5.1.5</a>.</p>
|
|
|
|
<div>
|
|
<p>Conceptually the link element can be thought of as having two
|
|
parts: condition and action. The "condition" is the content of
|
|
the link element, i.e. the grammar(s) that must be matched in
|
|
order for the link to be activated. The "action" is specified by
|
|
the attributes of the element, i.e. where to transition or which
|
|
event to throw. The "condition" is resolved/evaluated lexically,
|
|
while the "action" is resolved/evaluated dynamically.
|
|
Specifically this means that</p>
|
|
|
|
<ul>
|
|
<li>any URIs in the content of the link are resolved lexically,
|
|
i.e. according to the base URI (see xml:base in <a
|
|
href="#dml1.5.1" shape="rect">Section 1.5.1</a>) for the document
|
|
in which the link is defined.</li>
|
|
|
|
<li>any URIs in an attribute of the link element are resolved
|
|
dynamically, i.e. according to the base URI in effect when the
|
|
link's grammar is matched.</li>
|
|
|
|
<li>any ECMAScript expressions in an attribute of the link
|
|
element are evaluated dynamically, i.e. in the scope and
|
|
execution context in effect when the grammar is matched.</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<p>Attributes of <link> are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 27: link attributes">
|
|
<caption align="bottom">Table 27: <link>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>next</th>
|
|
<td>The URI to go to. This URI is a
|
|
document (perhaps with an anchor to specify the starting dialog),
|
|
or a dialog in the current document (just a bare anchor).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>Like next, except that the URI is
|
|
dynamically determined by evaluating the given ECMAScript
|
|
expression.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>event</th>
|
|
<td>The event to throw when the user
|
|
matches one of the link grammars.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>eventexpr</th>
|
|
<td>An ECMAScript expression evaluating
|
|
to the name of the event to throw when the user matches one of
|
|
the link grammars.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>message</th>
|
|
<td>A message string providing additional
|
|
context about the event being thrown. The message is available as
|
|
the value of a variable within the scope of the catch element,
|
|
see <a href="#dml5.2.2" shape="rect">Section 5.2.2</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>messageexpr</th>
|
|
<td>An ECMAScript expression evaluating
|
|
to the message string.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>dtmf</th>
|
|
<td>The DTMF sequence for this link. It
|
|
is equivalent to a simple DTMF <grammar> and DTMF
|
|
properties (<a href="#dml6.3.3" shape="rect">Section 6.3.3</a>)
|
|
apply to recognition of the sequence. Unlike DTMF grammars,
|
|
whitespace is optional: dtmf="123#" is equivalent to dtmf="1 2 3
|
|
#". The attribute can be used at the same time as other
|
|
<grammar>s: the link is activated when user input matches a
|
|
link grammar or the DTMF sequence.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchaudio</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchaudio
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchhint</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
documentfetchhint property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchtimeout</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchtimeout
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxage</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the documentmaxage
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxstale</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
documentmaxstale property.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Exactly one of "next", "expr", "event" or "eventexpr" must be
|
|
specified; otherwise, an error.badfetch event is thrown. Exactly
|
|
one of "message" or "messageexpr" may be specified; otherwise, an
|
|
error.badfetch event is thrown.</p>
|
|
|
|
<!--- CHAPTER 2: END =-->
|
|
<!--- CHAPTER 3: BEGIN =-->
|
|
<h1 id="L4448"><a id="dml3" name="dml3" shape="rect">3. User
|
|
Input</a></h1>
|
|
|
|
<h2 id="L4451"><a id="dml3.1" name="dml3.1" shape="rect">3.1
|
|
Grammars</a></h2>
|
|
|
|
<h3 id="L4454"><a id="dml3.1.1" name="dml3.1.1"
|
|
shape="rect">3.1.1 Speech Grammars</a></h3>
|
|
|
|
<p>The <grammar> element is used to provide a speech
|
|
grammar that</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>specifies a set of utterances that a user may speak to perform
|
|
an action or supply information, and</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>for a matching utterance, returns a corresponding semantic
|
|
interpretation. This may be a simple value (such as a string), a
|
|
flat set of attribute-value pairs (such as day, month, and year),
|
|
or a nested object (for a complex request).</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>The <grammar> element is designed to accommodate any
|
|
grammar format that meets these two requirements. VoiceXML
|
|
platforms must support at least one common format, the XML Form
|
|
of the W3C Speech Recognition Grammar Specification <a
|
|
href="#ref_SRGS" shape="rect">[SRGS]</a>. VoiceXML platforms
|
|
should support the Augmented BNF (ABNF) Form of the
|
|
W3C Speech Recognition Grammar Specification <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a>. VoiceXML platforms may choose to
|
|
support grammar formats other than SRGS. For instance, a platform
|
|
might use the <grammar> element's support for PCDATA to
|
|
inline a proprietary grammar definition or use the "src" and
|
|
"type" attributes for an external one.</p>
|
|
|
|
<p>VoiceXML platforms must be a Conforming XML Form Grammar
|
|
Processor as defined in the W3C Speech Recognition Grammar
|
|
Specification <a href="#ref_SRGS" shape="rect">[SRGS]</a>. While
|
|
this requires a platform to process documents with one or more
|
|
"xml:lang" attributes defined, it does not require that the
|
|
platform must be multi-lingual. When an unsupported language is
|
|
encountered, the platform throws an
|
|
<b>error.unsupported.language</b> event which specifies the
|
|
unsupported language in its message variable.</p>
|
|
|
|
<h4 id="L400257965955">Elements of XML Form of SRGS</h4>
|
|
|
|
<p>The following elements are defined in the XML Form of the W3C
|
|
Speech Recognition Grammar Specification <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a> and are available in VoiceXML 2.0. This
|
|
document does not redefine these elements. Refer to the W3C
|
|
Speech Recognition Grammar Specification <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a> for definitions and examples.</p>
|
|
|
|
<div align="center">
|
|
<table cellspacing="0" cellpadding="4" width="80%" border="1"
|
|
summary="Table 28: SRGS Elements (XML Form)">
|
|
<caption align="bottom">Table 28: SRGS (XML Form)
|
|
Elements</caption>
|
|
|
|
<thead>
|
|
<tr>
|
|
<th>Element</th>
|
|
<th>Purpose</th>
|
|
<th>Section<br />
|
|
<small>(in <a href="#ref_SRGS" shape="rect">[SRGS]</a>)</small>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<tr class="stripe">
|
|
<td><grammar></td>
|
|
<td>Root element of an XML grammar</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-grammar/#S4"
|
|
shape="rect">4.</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><meta></td>
|
|
<td>Header declaration of meta content of
|
|
an HTTP equivalent</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-grammar/#S4.11.1"
|
|
shape="rect">4.11.1</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><metadata></td>
|
|
<td>Header declaration of XML metadata
|
|
content</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-grammar/#S4.11.2"
|
|
shape="rect">4.11.2</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><lexicon></td>
|
|
<td>Header declaration of a pronunciation
|
|
lexicon</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-grammar/#S4.10"
|
|
shape="rect">4.10</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><rule></td>
|
|
<td>Declare a named rule expansion of a
|
|
grammar</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-grammar/#S3"
|
|
shape="rect">3.</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><token></td>
|
|
<td>Define a word or other entity that
|
|
may serve as input</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-grammar/#S2.1"
|
|
shape="rect">2.1</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><ruleref></td>
|
|
<td>Refer to a rule defined locally or
|
|
externally</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-grammar/#S2.2"
|
|
shape="rect">2.2</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><item></td>
|
|
<td>Define an expansion with optional
|
|
repeating and probability</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-grammar/#S2.3"
|
|
shape="rect">2.3</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><one-of></td>
|
|
<td>Define a set of alternative rule
|
|
expansions</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-grammar/#S2.4"
|
|
shape="rect">2.4</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><example></td>
|
|
<td>Element contained within a rule
|
|
definition that provides an example of input that matches the
|
|
rule</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-grammar/#S3.3"
|
|
shape="rect">3.3</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><tag></td>
|
|
<td>Define an arbitrary string that to be
|
|
included inline in an expansion which may be used for semantic
|
|
interpretation</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-grammar/#S2.6"
|
|
shape="rect">2.6</a> </td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<h4 id="L4615"><a id="dml3.1.1.1" name="dml3.1.1.1"
|
|
shape="rect">3.1.1.1 Inline Grammars</a></h4>
|
|
|
|
<p>The <grammar> element may be used to specify an
|
|
<em>inline</em> grammar or an <em>external</em> grammar. An
|
|
inline grammar is specified by the content of a <grammar>
|
|
element and defines an entire grammar:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<grammar type="<em>media-type</em>" mode="voice">
|
|
<em>inline speech grammar</em>
|
|
</grammar>
|
|
</pre>
|
|
|
|
<p>It may be necessary in this case to enclose the content in a
|
|
CDATA section <a href="#ref_XML" shape="rect">[XML]</a>. For
|
|
inline grammars the type parameter specifies a media type that
|
|
governs the interpretation of the content of the <grammar>
|
|
element.</p>
|
|
|
|
<p>The following is an example of inline grammar defined by the
|
|
XML Form of the W3C Speech Recognition Grammar Specification <a
|
|
href="#ref_SRGS" shape="rect">[SRGS]</a>.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<grammar mode="voice" xml:lang="en-US" version="1.0" root="command">
|
|
<!-- Command is an action on an object -->
|
|
<!-- e.g. "open a window" -->
|
|
<rule id="command" scope="public">
|
|
<ruleref uri="#action"/> <ruleref uri="#object"/>
|
|
</rule>
|
|
|
|
<rule id="action">
|
|
<one-of>
|
|
<item> open </item>
|
|
<item> close </item>
|
|
<item> delete </item>
|
|
<item> move </item>
|
|
</one-of>
|
|
</rule>
|
|
|
|
<rule id="object">
|
|
<item repeat="0-1">
|
|
<one-of> <item> the </item> <item> a </item> </one-of>
|
|
</item>
|
|
<one-of>
|
|
<item> window </item>
|
|
<item> file </item>
|
|
<item> menu </item>
|
|
</one-of>
|
|
</rule>
|
|
</grammar>
|
|
</pre>
|
|
|
|
<p>The following is the equivalent example of the inline grammar
|
|
defined by the ABNF Form of the W3C Speech Recognition Grammar
|
|
Specification <a href="#ref_SRGS" shape="rect">[SRGS]</a>.
|
|
Because VoiceXML platforms are not required to support this
|
|
format it may be less portable.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<grammar mode="voice" type="application/srgs">
|
|
#ABNF 1.0;
|
|
language en-US;
|
|
mode voice;
|
|
root $command;
|
|
public $command = $action $object;
|
|
$action = open | close | delete | move;
|
|
$object = [the | a] (window | file | menu);
|
|
</grammar>
|
|
</pre>
|
|
|
|
<h4 id="L4720"><a id="dml3.1.1.2" name="dml3.1.1.2"
|
|
shape="rect">3.1.1.2 External Grammars</a></h4>
|
|
|
|
<p>An external grammar is specified by an element of the form</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<grammar src="<i>URI</i>" type="<i>media-type</i>"/>
|
|
</pre>
|
|
|
|
<p>The media type is optional in this case because the
|
|
interpreter context will attempt to determine the type
|
|
dynamically as described in <a href="#dml3.1.1.4"
|
|
shape="rect">Section 3.1.1.4</a>.</p>
|
|
|
|
<p>If the src attribute is defined and there is an inline grammar
|
|
as content of a grammar element then an error.badfetch event is
|
|
thrown.</p>
|
|
|
|
<p>The following is an example of a reference to an external
|
|
grammar written in the XML Form of the W3C Speech Recognition
|
|
Grammar Specification <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a>.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<grammar type="application/srgs+xml" src="http://www.grammar.example.com/date.grxml"/>
|
|
</pre>
|
|
|
|
<p>The following example is the equivalent grammar reference for
|
|
a grammar that is authored using the ABNF Form of the W3C Speech
|
|
Recognition Grammar Specification <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a>.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<grammar type="application/srgs" src="http://www.grammar.example.com/date.gram"/>
|
|
</pre>
|
|
|
|
<h4 id="L4754"><a id="dml3.1.1.3" name="dml3.1.1.3"
|
|
shape="rect">3.1.1.3 Grammar Weight</a></h4>
|
|
|
|
<p>A weight for the grammar can be specified by the weight
|
|
attribute:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<grammar weight="0.6" src="form.grxml" type="application/srgs+xml"/>
|
|
</pre>
|
|
|
|
<p>Grammar elements, including those in link, field and form
|
|
elements, can have a weight attribute. The grammar can be inline,
|
|
external or built-in.</p>
|
|
|
|
<p>Weights follow the definition of weights on alternatives in
|
|
the W3C Speech Recognition Grammar Specification <a
|
|
href="#ref_SRGS" shape="rect">[SRGS §2.4.1]</a>. A weight is
|
|
a simple positive floating point values without exponentials.
|
|
Legal formats are "n", "n.", ".n" and "n.n" where "n" is a
|
|
sequence of one or many digits.</p>
|
|
|
|
<p>A weight is nominally a multiplying factor in the likelihood
|
|
domain of a speech recognition search. A weight of "1.0" is
|
|
equivalent to providing no weight at all. A weight greater than
|
|
"1.0" positively biases the grammar and a weight less than "1.0"
|
|
negatively biases the grammar. If unspecified, the default weight
|
|
for any grammar is "1.0". If no weight is specified for any
|
|
grammar element then all grammars are equally likely.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<link event="help">
|
|
<grammar weight="0.5" mode="voice" version="1.0" root="help">
|
|
<rule id="help" scope="public">
|
|
<item repeat="0-1">Please</item> help
|
|
</rule>
|
|
</grammar>
|
|
</link>
|
|
|
|
<form>
|
|
<grammar src="form.grxml" type="application/srgs+xml"/>
|
|
<field name="expireDate">
|
|
<grammar weight="1.2" src="http://www.example.org/grammar/date"/>
|
|
</field>
|
|
</form>
|
|
</pre>
|
|
|
|
<p>In the example above, the semantics of weights is equivalent
|
|
to the following XML grammar.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<grammar root="r1" type="application/srgs+xml">
|
|
<rule id="r1">
|
|
<one-of>
|
|
<item weight="0.5"> <ruleref uri="#help"/> </item>
|
|
<item weight="1.0"> <ruleref uri="form.grxml"/> </item>
|
|
<item weight="1.2"> <ruleref uri="http://www.example.org/grammar/date"/></item>
|
|
</one-of>
|
|
</rule>
|
|
|
|
<rule id="help">
|
|
<item repeat="0-1">Please</item> help
|
|
</rule>
|
|
</grammar>
|
|
</pre>
|
|
|
|
<p>Implicit grammars, such as those in options, do not support
|
|
weights - use the <grammar> element instead for control
|
|
over grammar weight.</p>
|
|
|
|
<p>Grammar weights only affect grammar processing. They do not
|
|
directly affect the post processing of grammar results, including
|
|
grammar precedence when user input matches multiple active
|
|
grammar (see <a href="#dml3.1.4" shape="rect">Section
|
|
3.1.4</a>).</p>
|
|
|
|
<p>A weight has no effect on DTMF grammars (See <a
|
|
href="#dml3.1.2" shape="rect">Section 3.1.2</a>). Any weight
|
|
attribute specified in a grammar element whose mode attribute is
|
|
dtmf is ignored.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<!-- weight will be ignored -->
|
|
<grammar mode="dtmf" weight="0.3" src="http://www.example.org/dtmf/number"/>
|
|
</pre>
|
|
|
|
<p>Appropriate weights are difficult to determine, and guessing
|
|
weights does not always improve recognition performance.
|
|
Effective weights are usually obtained by study of real speech
|
|
and textual data on a particular platform. Furthermore, a grammar
|
|
weight is platform specific. Note that different ASR engines may
|
|
treat the same weight value differently. Therefore, the weight
|
|
value that works well on particular platform may generate
|
|
different results on other platforms.</p>
|
|
|
|
<h4 id="L4797"><a id="dml3.1.1.4" name="dml3.1.1.4"
|
|
shape="rect">3.1.1.4 Grammar Element</a></h4>
|
|
|
|
<p>Attributes of <grammar> inherited from the W3C Speech
|
|
Recognition Grammar Specification <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a> are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 29: grammar attributes inherited from SRGS">
|
|
<caption align="bottom">Table 29: <grammar> Attributes
|
|
Inherited from SRGS</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>version</th>
|
|
<td>Defines the version of the
|
|
grammar.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>xml:lang</th>
|
|
<td>The <a href="#term-language"
|
|
shape="rect">language identifier</a> of the grammar (for
|
|
example, "fr-CA" for Canadian French.) If omitted, the value is
|
|
inherited down from the document hierarchy.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>mode</th>
|
|
<td>Defines the mode of the grammar
|
|
following the modes of the W3C Speech Recognition Grammar
|
|
Specification <a href="#ref_SRGS" shape="rect">[SRGS]</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>root</th>
|
|
<td>Defines the rule which acts as the
|
|
root rule of the grammar.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>tag-format</th>
|
|
<td>Defines the tag content format for
|
|
all tags within the grammar.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>xml:base</th>
|
|
<td>Declares the base URI from which
|
|
relative URIs in the grammar are resolved.
|
|
|
|
<p>This base declaration has precedence over the <vxml>
|
|
base URI declaration. If a local declaration is omitted, the
|
|
value is inherited down the document hierarchy.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>The use and interpretation of these attributes is determined
|
|
as follows:</p>
|
|
|
|
<ol>
|
|
<li>Inline XML Form of SRGS: determined by W3C Speech Recognition
|
|
Grammar Specification which states that the version attribute is
|
|
required and must have the value is "1.0"; that the root
|
|
attribute is required and its value identifies which rule to
|
|
activate; and other attributes are optional (see <a
|
|
href="#ref_SRGS" shape="rect">[SRGS]</a> for further
|
|
details).</li>
|
|
|
|
<li>Inline ABNF Form of SRGS: any specified attributes must be
|
|
ignored by the platform</li>
|
|
|
|
<li>External XML and ABNF Forms of SRGS: any specified attributes
|
|
must be ignored by the platform</li>
|
|
|
|
<li>all other grammar types: the use and interpretation of any
|
|
specified attributes is platform-dependent</li>
|
|
</ol>
|
|
|
|
<p>Attributes of <grammar> added by VoiceXML 2.0 are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 30: grammar attributes added in voicexml">
|
|
<caption align="bottom">Table 30: <grammar> Attributes
|
|
Added in VoiceXML</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>src</th>
|
|
<td>The URI specifying the location of
|
|
the grammar and optionally a rulename within that grammar, if it
|
|
is external. The URI is interpreted as a rule reference as
|
|
defined in Section 2.2 of the Speech Recognition Grammar
|
|
Specification <a href="#ref_SRGS" shape="rect">[SRGS]</a> but not
|
|
all forms of rule reference are permitted from within VoiceXML.
|
|
The rule reference capabilities are described in detail below
|
|
this table.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>scope</th>
|
|
<td>Either "document", which makes the
|
|
grammar active in all dialogs of the current document (and
|
|
relevant application leaf documents), or "dialog", to make the
|
|
grammar active throughout the current form. If omitted, the
|
|
grammar scoping is resolved by looking at the parent element. See
|
|
<a href="#dml3.1.3" shape="rect">Section 3.1.3</a> for details on
|
|
scoping including precedence behavior.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>type</th>
|
|
<td>
|
|
<p>The preferred media type of the grammar. A resource indicated
|
|
by the URI reference in the src attribute may be available in one
|
|
or more media types. The author may specify the preferred
|
|
media-type via the type attribute. When the content represented
|
|
by a URI is available in many data formats, a VoiceXML platform
|
|
may use the preferred media-type to influence which of the
|
|
multiple formats is used. For instance, on a server implementing
|
|
HTTP content negotiation, the processor may use the preferred
|
|
media-type to order the preferences in the negotiation.</p>
|
|
|
|
<p>The resource representation delivered by dereferencing the URI
|
|
reference may be considered in terms of two types. The
|
|
<i>declared media-type</i> is the asserted value for the resource
|
|
and the <i>actual media-type</i> is the true format of its
|
|
content. The actual media-type should be the same as the declared
|
|
media-type, but this is not always the case (e.g. a misconfigured
|
|
HTTP server might return 'text/plain for an
|
|
'application/srgs+xml' document). A specific URI scheme may
|
|
require that the resource owner always, sometimes, or never
|
|
return a media-type. The declared media-type is the value
|
|
returned by the resource owner or, if none is returned, the
|
|
preferred media type. There may be no declared media-type if the
|
|
resource owner does not return a value and no preferred type is
|
|
specified. Whenever specified, the declared media-type is
|
|
authoritative.</p>
|
|
|
|
<p>Three special cases may arise. The declared media-type may not
|
|
be supported by the processor; in this case, an
|
|
error.unsupported.format is thrown by the platform. The declared
|
|
media-type may be supported but the actual media-type may not
|
|
match; an error.badfetch is thrown by the platform. Finally,
|
|
there may be no declared media-type; the behavior depends on the
|
|
specific URI scheme and the capabilities of the grammar
|
|
processor. For instance, HTTP 1.1 allows document intraspection
|
|
(see <a href="#ref_RFC2616" shape="rect">[RFC2616]</a>, section
|
|
7.2.1), the data scheme falls back to a default media type, and
|
|
local file access defines no guidelines. The following table
|
|
provides some informative examples:</p>
|
|
|
|
<table width="100%" border="1" cellpadding="3"
|
|
summary="Media type examples">
|
|
<tr>
|
|
<td width="20%" />
|
|
<td colspan="2" rowspan="1">
|
|
<div align="center"><b>HTTP 1.1 request</b></div>
|
|
</td>
|
|
<td colspan="2" rowspan="1">
|
|
<div align="center"><b>Local file access</b></div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td width="20%">Media-type returned by
|
|
the resource owner</td>
|
|
<td width="20%">text/plain</td>
|
|
<td width="20%">application/srgs+xml</td>
|
|
<td width="20%"><none></td>
|
|
<td><none></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td width="20%">Preferred media-type
|
|
appearing in the grammar</td>
|
|
<td colspan="2" rowspan="1">Not applicable; the returned type
|
|
takes precedence</td>
|
|
<td width="20%">application/srgs+xml</td>
|
|
<td><none></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td width="20%">Declared media-type</td>
|
|
<td width="20%">text/plain</td>
|
|
<td width="20%">application/srgs+xml</td>
|
|
<td width="20%">application/srgs+xml</td>
|
|
<td><none></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td width="20%">Behavior if the actual
|
|
media-type is application/srgs+xml</td>
|
|
<td width="20%">error.badfetch thrown;
|
|
the declared and actual types do not match</td>
|
|
<td colspan="2" rowspan="1">The declared and actual types match;
|
|
success if application/srgs+xml is supported by the processor;
|
|
otherwise an error.unsupported.format is thrown</td>
|
|
<td>Scheme specific; the processor might
|
|
intraspect the document to determine the type.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>The tentative media types for the W3C grammar format are
|
|
"application/srgs+xml" for the XML form and "application/srgs"
|
|
for ABNF grammars.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>weight</th>
|
|
<td>Specifies the weight of the grammar.
|
|
See <a href="#dml3.1.1.3" shape="rect">Section 3.1.1.3</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchhint</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
grammarfetchhint property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchtimeout</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchtimeout
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxage</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the grammarmaxage
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxstale</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
grammarmaxstale property.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Either an "src" attribute or a inline grammar (but not both)
|
|
must be specified; otherwise, an error.badfetch event is
|
|
thrown.</p>
|
|
|
|
<p>The <grammar> element is also extended in VoiceXML 2.0
|
|
to allow PCDATA for inline grammar formats besides the XML Form
|
|
of the W3C Speech Recognition Grammar Specification <a
|
|
href="#ref_SRGS" shape="rect">[SRGS]</a>.</p>
|
|
|
|
<p>When referencing an external grammar, the value of the src
|
|
attribute is a URI specifying the location of the grammar with an
|
|
optional fragment for the rulename. Section 2.2 of the Speech
|
|
Recognition Grammar Specification <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a> defines several forms of rule reference.
|
|
The following are the forms that are permitted on a grammar
|
|
element in VoiceXML:</p>
|
|
|
|
<ul>
|
|
<li><em>Reference to a named rule in an external grammar:</em>
|
|
src attribute is an absolute or relative URI reference to a
|
|
grammar which includes a fragment with a rulename. This form of
|
|
rule reference to an external grammar follows the behavior
|
|
defined in Section 2.2.2 of <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a>. If the URI cannot be fetched or if the
|
|
rulename is not defined in the grammar or is not a <i>public</i>
|
|
(activatable) rule of that grammar then an error.badfetch is
|
|
thrown.</li>
|
|
|
|
<li><em>Reference to the root rule of an external grammar:</em>
|
|
src attribute is an absolute or relative URI reference to a
|
|
grammar but does not include a fragment identifying a rulename.
|
|
This form implicitly references the root rule of the grammar as
|
|
defined in Section 2.2.2 of <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a>. If the URI cannot be fetched or if the
|
|
grammar cannot be referenced by its root (see Section 4.7 of <a
|
|
href="#ref_SRGS" shape="rect">[SRGS]</a>) then an error.badfetch
|
|
is thrown.</li>
|
|
</ul>
|
|
|
|
<p>The following are the forms of rule reference defined by
|
|
<a href="#ref_SRGS" shape="rect">[SRGS]</a> that are
|
|
<em>not supported</em> in VoiceXML 2.0.</p>
|
|
|
|
<ul>
|
|
<li><em>Local rule reference:</em> a fragment-only URI is not
|
|
permitted. (See definition in Section 2.2.1 of <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a>). A fragment-only URI value for the src
|
|
attribute causes an error.semantic event.</li>
|
|
|
|
<li><em>Reference to special rules:</em> although an inline
|
|
grammar may reference the special rules of SRGS (NULL, VOID,
|
|
GARBAGE) there is no support for special rule references on the
|
|
grammar element itself. (See definitions in Section 2.2.3 of <a
|
|
href="#ref_SRGS" shape="rect">[SRGS]</a>). There is no syntactic
|
|
support for this form so no error can be generated.</li>
|
|
</ul>
|
|
|
|
<h3 id="L4986"><a id="dml3.1.2" name="dml3.1.2"
|
|
shape="rect">3.1.2 DTMF</a> Grammars</h3>
|
|
|
|
<p>The <grammar> element can be used to provide a DTMF
|
|
grammar that</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>specifies a set of key presses that a user may use to perform
|
|
an action or supply information, and</p>
|
|
</li>
|
|
|
|
<li>for matching DTMF input, returns a corresponding semantic
|
|
interpretation. This may be a simple value (such as a string), a
|
|
flat set of attribute-value pairs (such as day, month, and year),
|
|
or a nested object (for a complex request).</li>
|
|
</ul>
|
|
|
|
<p>VoiceXML platforms are required to support the DTMF grammar
|
|
XML format defined in Appendix D of the <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a> to advance application portability.</p>
|
|
|
|
<p>A DTMF grammar is distinguished from a speech grammar by the
|
|
mode attribute on the <grammar> element. An "xml:lang"
|
|
attribute has no effect on DTMF grammar handling. In other
|
|
respects speech and DTMF grammars are handled identically
|
|
including the ability to define the grammar inline, or by an
|
|
external grammar reference. The media type handling, scoping and
|
|
fetching are also identical.</p>
|
|
|
|
<p>The following is an example of a simple inline XML DTMF
|
|
grammar that accepts as input either "1 2 3" or "#".</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<grammar mode="dtmf" version="1.0" root="root">
|
|
<rule id="root" scope="public">
|
|
<one-of>
|
|
<item> 1 2 3 </item>
|
|
<item> # </item>
|
|
</one-of>
|
|
</rule>
|
|
</grammar>
|
|
</pre>
|
|
|
|
<h3 id="L5010"><a id="dml3.1.3" name="dml3.1.3"
|
|
shape="rect">3.1.3 Scope of Grammars</a></h3>
|
|
|
|
<p><em>Input item grammars</em> are always scoped to the
|
|
containing input item; that is, they are active only when the
|
|
containing input item was chosen during the select phase of
|
|
the FIA. Grammars contained in input items cannot specify a
|
|
scope; if they do, an error.badfetch is thrown.</p>
|
|
|
|
<p><em>Link grammars</em> are given the scope of the element that
|
|
contains the link. Thus, if they are defined in the application
|
|
root document, links are also active in any other loaded
|
|
application document. Grammars contained in links cannot specify
|
|
a scope; if they do, an error.badfetch is thrown.</p>
|
|
|
|
<p><em>Form grammars</em> are by default given dialog scope, so
|
|
that they are active only when the user is in the form. If they
|
|
are given scope document, they are active whenever the user is in
|
|
the document. If they are given scope document and the document
|
|
is the application root document, then they are also active
|
|
whenever the user is in another loaded document in the same
|
|
application. A grammar in a form may be given document scope
|
|
either by specifying the scope attribute on the form element or
|
|
by specifying the scope attribute on the <grammar> element.
|
|
If both are specified, the grammar assumes the scope specified by
|
|
the <grammar> element.</p>
|
|
|
|
<p><em>Menu grammars</em> are also by default given dialog scope,
|
|
and are active only when the user is in the menu. But they can be
|
|
given document scope and be active throughout the document, and
|
|
if their document is the application root document, also be
|
|
active in any other loaded document belonging to the application.
|
|
Grammars contained in menu choices cannot specify a scope; if
|
|
they do, an error.badfetch is thrown.</p>
|
|
|
|
<p>Sometimes a form may need to have some grammars active
|
|
throughout the document, and other grammars that should be active
|
|
only when in the form. One reason for doing this is to minimize
|
|
grammar overlap problems. To do this, each individual
|
|
<grammar> element can be given its own scope if that scope
|
|
should be different than the scope of the <form> element
|
|
itself:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form scope="document">
|
|
<grammar type="application/srgs">
|
|
#ABNF 1.0;
|
|
language en-gb;
|
|
mode voice;
|
|
root $command;
|
|
public $command = one | two | three;
|
|
</grammar>
|
|
<grammar type="application/srgs" scope="dialog">
|
|
#ABNF 1.0;
|
|
language en-gb;
|
|
mode voice;
|
|
root $command2;
|
|
public $command2 = four | five | six;
|
|
</grammar>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<h3 id="L5033"><a id="dml3.1.4" name="dml3.1.4"
|
|
shape="rect">3.1.4 Activation of Grammars</a></h3>
|
|
|
|
<p>When the interpreter waits for input as a result of visiting
|
|
an input item, the following grammars are active:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>grammars for that input item, including grammars
|
|
contained in links in that input item;</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>grammars for its form, including grammars contained in links
|
|
in that form;</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>grammars contained in links in its document, and grammars for
|
|
menus and other forms in its document which are given document
|
|
scope;</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>grammars contained in links in its application root document,
|
|
and grammars for menus and forms in its application root document
|
|
which are given document scope.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>grammars defined by platform default event handlers, such as
|
|
help, exit and cancel.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>In the case that an input matches more than one active
|
|
grammar, the list above defines the precedence order. If the
|
|
input matches more than one active grammar with the same
|
|
precedence, the precedence is determined using document order:
|
|
the first grammar in document order has highest priority. If no
|
|
grammars are active when an input is expected, the platform must
|
|
throw an error.semantic event. The error will be thrown in the
|
|
context of the executing element. Menus behave with regard to
|
|
grammar activation like their equivalent forms (see <a
|
|
href="#dml2.2.1" shape="rect">Section 2.2.1</a>).</p>
|
|
|
|
<p>If the form item is modal (i.e., its modal attribute is set to
|
|
true), all grammars except its own are turned off while waiting
|
|
for input. If the input matches a grammar in a form or menu other
|
|
than the current form or menu, control passes to the other form
|
|
or menu. If the match causes control to leave the current form,
|
|
all current form data is lost.</p>
|
|
|
|
<p>Grammar activation is not affected by the inputmodes property.
|
|
For instance, if the inputmodes property restricts input to just
|
|
voice, DTMF grammars will still be activated, but cannot be
|
|
matched.</p>
|
|
|
|
<h3 id="L5067"><a id="dml3.1.5" name="dml3.1.5"
|
|
shape="rect">3.1.5 Semantic Interpretation of Input</a></h3>
|
|
|
|
<p>The Speech Recognition Grammar Specification defines a tag
|
|
element which contains content for semantic interpretation of
|
|
speech and DTMF grammars (see Section 2.6 of <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a>).</p>
|
|
|
|
<p>The Semantic Interpretation for Speech Recognition
|
|
specification <a href="#ref_SISR" shape="rect">[SISR]</a>
|
|
describes a syntax and semantics for tags and specifies how a
|
|
semantic interpretation for user input can be computed using the
|
|
content of tags associated with the matched tokens and rules. The
|
|
semantic interpretation may be mapped into VoiceXML as described
|
|
in <a href="#dml3.1.6" shape="rect">Section 3.1.6</a>.</p>
|
|
|
|
<h3 id="L5115"><a id="dml3.1.6" name="dml3.1.6"
|
|
shape="rect">3.1.6 Mapping Semantic Interpretation Results to
|
|
VoiceXML forms</a></h3>
|
|
|
|
<p>The semantic interpretation returned from a Speech Recognition
|
|
Grammar Specification <a href="#ref_SRGS" shape="rect">[SRGS]</a>
|
|
grammar must be mapped into one or more VoiceXML ECMAScript
|
|
variables. The process by which this occurs differs slightly for
|
|
form- and field-level results; these differences will be explored
|
|
in the next sections. The format of the semantic interpretation,
|
|
using either the proposed Natural Language Semantics Markup
|
|
Language <a href="#ref_NLSML" shape="rect">[NLSML]</a> or the
|
|
ECMAScript-like output format of <a href="#ref_SISR"
|
|
shape="rect">[SISR]</a>, has no impact on this discussion. For
|
|
the purposes of this discussion, the actual result returned from
|
|
the recognizer is assumed to have been mapped into an
|
|
ECMAScript-like format which is identical to the representation
|
|
in application.lastresult$.interpretation as discussed in <a
|
|
href="#dml5.1.5" shape="rect">Section 5.1.5</a>.</p>
|
|
|
|
<p>It is possible that a grammar will match but not return a
|
|
semantic interpretation. In this case, the platform will use the
|
|
raw text string for the utterance as the semantic result.
|
|
Otherwise, this case is handled exactly as if the semantic
|
|
interpretation consisted of a simple value.</p>
|
|
|
|
<p>Every input item has an associated <i>slot name</i> which may
|
|
be used to extract part of the full semantic interpretation. The
|
|
slot name is the value of the 'slot' attribute, if present (only
|
|
possible for <field> elements), or else the value of the
|
|
'name' attribute (for <field>s without a slot attribute,
|
|
and for other input items as well). If neither slot nor name is
|
|
present, then the slot name is undefined.</p>
|
|
|
|
<p>The slot name is used during the Process Phase of the <a
|
|
href="#dmlAFIA" shape="rect">FIA</a> to determine whether or not
|
|
an input item matches. A match occurs when either the slot name
|
|
is the same as a top-level property or a slot name is used to
|
|
select a sub-property. A property having an undefined value (i.e.
|
|
ECMAScript undefined) will not match. Likewise, slot names which
|
|
are undefined will never match. Examples are given in <a
|
|
href="#dml3.1.6.3" shape="rect">Section 3.1.6.3</a>. Note that it
|
|
is possible for a specific slot value to fill more than one input
|
|
item if the slot names of the input items are the same.</p>
|
|
|
|
<p>The next sections concern mapping form-level and field-level
|
|
results. There is also a brief discussion of other issues such as
|
|
the NL Semantics  to ECMAScript mapping, transitioning
|
|
information from ASR results to VoiceXML, and dealing with
|
|
mismatches between the interpretation result and the VoiceXML
|
|
form.</p>
|
|
|
|
<h4 id="L5128"><a id="dml3.1.6.1" name="dml3.1.6.1"
|
|
shape="rect">3.1.6.1 Mapping form-level results</a></h4>
|
|
|
|
<p>Grammars specified at the form-level produce a <em>form-level
|
|
result</em> which may fill multiple input items simultaneously.
|
|
This may occur anytime, whether in an <initial> element or
|
|
in an input item, that the user's input matches an active
|
|
form-level grammar.</p>
|
|
|
|
<p>Consider the interpretation result from the sentence "I would
|
|
like a coca cola and three large pizzas with pepperoni and
|
|
mushrooms." The semantic interpretation may be copied into
|
|
application.lastresult$.interpretation as</p>
|
|
|
|
<pre xml:space="preserve">
|
|
{
|
|
drink: "coke",
|
|
pizza: {
|
|
number: "3",
|
|
size: "large",
|
|
topping: [
|
|
"pepperoni",
|
|
"mushrooms"
|
|
]
|
|
}
|
|
}
|
|
</pre>
|
|
|
|
<p>The following table illustrates how this result from a
|
|
form-level grammar would be assigned to various input items
|
|
within the form. Note that all input items that can be filled
|
|
in from the interpretation are filled in simultaneously. The
|
|
existing values of matching input item variables will be
|
|
overwritten, and these items will be marked for <filled>
|
|
processing during the FIA's Process Phase as described in
|
|
<a href="#dml2.4" shape="rect">Section 2.4</a> and <a
|
|
href="#dmlAFIA" shape="rect">Appendix C</a>.</p>
|
|
|
|
<table cellspacing="0" cellpadding="3" border="1"
|
|
summary="Table 31: form-level grammar assignments">
|
|
<caption align="bottom">Table 31: Form-level Grammar
|
|
Assignments</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>VoiceXML field</th>
|
|
<th>Assigned ECMAScript value</th>
|
|
<th>Explanation</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top" nowrap="nowrap">1.
|
|
<field name="drink"/> <em>--or--<br />
|
|
</em> <object name="drink"/> <em>--or--</em><br
|
|
clear="none" />
|
|
<record name="drink"/></td>
|
|
<td valign="top">"coke"</td>
|
|
<td valign="top">By default an
|
|
input item is assigned the top-level result property whose
|
|
name matches the input item name.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top" nowrap="nowrap">2.
|
|
<field name="..." slot="drink"/></td>
|
|
<td valign="top">"coke"</td>
|
|
<td valign="top">If specified for a
|
|
field, the slot name overrides the field name
|
|
for selecting the result property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top" nowrap="nowrap">3.
|
|
<field name="pizza"/> <em>--or--<br />
|
|
</em> <object name="pizza"/> <em>--or--</em><br
|
|
clear="none" />
|
|
<record name="pizza"/> <em>--or--</em> <br
|
|
clear="none" />
|
|
<field name="..." slot="pizza"/></td>
|
|
<td valign="top">{number: "3", size:
|
|
"large", topping: ["pepperoni", "mushroom"]}</td>
|
|
<td valign="top">The input item name
|
|
or slot may select a property that is a non-scalar ECMAScript
|
|
variable in the same way that a scalar value is selected in the
|
|
previous example. However the application must then handle
|
|
inspecting the components of the object. This does not take
|
|
advantage of the VoiceXML form-filling algorithm, in that missing
|
|
slots in the result would not be automatically prompted for. This
|
|
may be sufficient in situations where the server is prepared to
|
|
deal with a structured object. Otherwise, an application may
|
|
prefer to use the method described in the next example.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top" nowrap="nowrap">4.
|
|
<field name="..." slot="pizza.number"/><br />
|
|
<field name="..." slot="pizza.size"/></td>
|
|
<td valign="top">"3"<br />
|
|
"large"</td>
|
|
<td valign="top">The slot may be used to
|
|
select a sub-property of the result. This approach distributes
|
|
the result among a number of fields.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td valign="top" nowrap="nowrap">5.
|
|
<field name="..." slot="pizza.topping"/></td>
|
|
<td valign="top">["pepperoni",
|
|
"mushroom"]</td>
|
|
<td valign="top">The selected property
|
|
may be a compound object.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>The <field ... slot="pizza.foo"> examples above can be
|
|
explained by rules that are compatible with and are
|
|
straightforward extensions of the VoiceXML 1.0 "name" and "slot"
|
|
attributes:</p>
|
|
|
|
<ol>
|
|
<li>The "slot" attribute of a <field> is a (very
|
|
restricted) ECMAScript expression that selects some portion of
|
|
the result to be assigned to the field. In addition to selecting
|
|
the top-level result property, the attribute can select
|
|
properties at arbitrary levels of nesting, using a dot-separated
|
|
list of element/property names, as in "pizza.number" and
|
|
"order.pizza.topping".</li>
|
|
|
|
<li>If the "slot" attribute of a field is used to select a
|
|
sub-property of the result and that sub-property does not exist
|
|
in the result, then the field <i>does not match</i> the result
|
|
(see <a href="#dml3.1.6" shape="rect">Section
|
|
3.1.6</a>).</li>
|
|
</ol>
|
|
|
|
<h4 id="L5238"><a id="dml3.1.6.2" name="dml3.1.6.2"
|
|
shape="rect">3.1.6.2 Mapping a field-level result</a></h4>
|
|
|
|
<p>Grammars specified within an input item produce a
|
|
<em>field-level result</em> which may fill only the particular
|
|
input item in which they are contained. These grammars are active
|
|
only when the FIA is visiting that specific input item. This is
|
|
useful, for instance, in directed dialogs where a user is
|
|
prompted individually for each input item.</p>
|
|
|
|
<p>A field-level result fills the associated input
|
|
item in the following manner:</p>
|
|
|
|
<ul>
|
|
<li>If the interpretation is a simple result, this is assigned to
|
|
the input item variable.</li>
|
|
|
|
<li>If the interpretation is a structure and the slot name
|
|
matches a property, this property's value is assigned to the
|
|
input item variable.</li>
|
|
|
|
<li>Otherwise, the full semantic result is assigned.</li>
|
|
</ul>
|
|
|
|
<p>This process allows an input item to extract a particular
|
|
property from the semantic interpretation. This may be combined
|
|
with <filled> for achieve even greater control.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<field name="getdate">
|
|
<prompt>On what date would you like to fly?</prompt>
|
|
|
|
<grammar src="http://server.example.com/date.grxml"/>
|
|
<!-- this grammar always returns an object containing
|
|
string values for the properties day, month, and year -->
|
|
|
|
<filled>
|
|
<assign name="getdate.datestring"
|
|
expr="getdate.year + getdate.month + getdate.day"/>
|
|
</filled>
|
|
</field>
|
|
</pre>
|
|
|
|
<h4 id="L5273"><a id="dml3.1.6.3" name="dml3.1.6.3"
|
|
shape="rect">3.1.6.3 Additional examples</a></h4>
|
|
|
|
<p>A matching slot name allows an input item to extract part of a
|
|
semantic interpretation. Consider this modified result from the
|
|
earlier pizza example.</p>
|
|
|
|
<pre xml:space="preserve">
|
|
application.lastresult$.interpretation =
|
|
{ drink: { size: 'large', liquid: 'coke' },
|
|
pizza: { number: '3', size: 'large',
|
|
topping: ['pepperoni', 'mushroom' ] },
|
|
sidedish: undefined
|
|
}
|
|
</pre>
|
|
|
|
<p>The table below revisits the definition of when the slot name
|
|
matches a property in the result.</p>
|
|
|
|
<table border="1" cellspacing="0" cellpadding="5" width="80%"
|
|
summary="Table 32: Slot Name Matching">
|
|
<caption align="bottom">Table 32: Slot Name Matching</caption>
|
|
|
|
<tr>
|
|
<td><b>slot name</b> </td>
|
|
<td><b>match or not?</b> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><i>undefined</i> </td>
|
|
<td>does not match</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>drink</td>
|
|
<td>matches; top level property</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>pizza</td>
|
|
<td>matches; top level property</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>sidedish</td>
|
|
<td>does not match; no defined value</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>size</td>
|
|
<td>does not match; not a top-level
|
|
property</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>pizza.size</td>
|
|
<td>matches; sub-property</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>pizza.liquid</td>
|
|
<td>does not match</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>It is also possible to compare the behaviors of form-level and
|
|
field-level results. For this purpose, consider the following
|
|
document:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="exampleForm">
|
|
<grammar src="formlevel.grxml"/>
|
|
<initial> Say something. </initial>
|
|
|
|
<field name="x">
|
|
<grammar src="fieldx.grxml"/>
|
|
</field>
|
|
|
|
<field name="z" slot="y">
|
|
<grammar src="fieldz.grxml"/>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>This defines two input item variables, 'x' and 'z'. The
|
|
corresponding slot names are 'x' and 'y' respectively. The next
|
|
table describes the assignment of these variables depending on
|
|
which grammar is recognized and what semantic result is returned.
|
|
The shorthand <i>valueX</i> is used to indicate 'the structured
|
|
object or simple result value associated with the property
|
|
x'.</p>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0" width="100%"
|
|
summary="Table 33: Variable Assignments">
|
|
<caption align="bottom">Table 33: Variable Assignments Depending
|
|
on Grammar and Semantic Result</caption>
|
|
|
|
<tr>
|
|
<td>
|
|
<div align="center"><b>application. lastresult$.
|
|
interpretation</b></div>
|
|
</td>
|
|
<td>
|
|
<div align="center"><b>form-level result<br />
|
|
(formlevel.grxml)</b></div>
|
|
</td>
|
|
<td>
|
|
<div align="center"><b>field-level result in field x<br
|
|
clear="none" />
|
|
(fieldx.grxml)</b></div>
|
|
</td>
|
|
<td>
|
|
<div align="center"><b>field-level result in field z<br
|
|
clear="none" />
|
|
(fieldz.grxml)</b></div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>= 'hello'</td>
|
|
<td>
|
|
<p class="updated">no assignment; cycle FIA</p>
|
|
</td>
|
|
<td>x = 'hello'</td>
|
|
<td>z = 'hello'</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>= { x: valueX }</td>
|
|
<td>x = valueX</td>
|
|
<td>x = valueX</td>
|
|
<td>z = { x: valueX }</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>= { y: valueY }</td>
|
|
<td>z = valueY</td>
|
|
<td>x = { y: valueY }</td>
|
|
<td>z = valueY</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>= { z: valueZ }</td>
|
|
<td>
|
|
<p class="updated">no assignment; cycle FIA</p>
|
|
</td>
|
|
<td>x = { z: valueZ }</td>
|
|
<td>z = { z: valueZ }</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>= { x: valueX,<br />
|
|
y: valueY,<br />
|
|
z: valueZ }</td>
|
|
<td>x = valueX<br />
|
|
z = valueY</td>
|
|
<td>x = valueX</td>
|
|
<td>z = valueY</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>= { a: valueA<br />
|
|
b: valueB }</td>
|
|
<td>
|
|
<p class="updated">no assignment; cycle FIA</p>
|
|
</td>
|
|
<td>x = { a: valueA,<br />
|
|
b: valueB }</td>
|
|
<td>z = { a: valueA,<br />
|
|
b: valueB }</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>At the form level, simple results like the string 'hello'
|
|
cannot match any input items; structured objects assign all input
|
|
item variables with matching slot names. At the field level,
|
|
simple results are always assigned to the input item variable;
|
|
structured objects will extract the matching property, if it
|
|
exists, or will otherwise be assigned the entire semantic
|
|
result.</p>
|
|
|
|
<h4 id="L5274"><a id="dml3.1.6.4" name="dml3.1.6.4"
|
|
shape="rect">3.1.6.4 Additional issues</a></h4>
|
|
|
|
<p>1. Mapping from NL semantics to ECMAScript: If the NL
|
|
Semantics Markup Language (<a href="#ref_NLSML"
|
|
shape="rect">[NLSML]</a>) is used, a mapping needs to be defined
|
|
from the NLSML representation to ECMAScript objects. Since both
|
|
types of representation have similar nested structures, this
|
|
mapping is fairly straightforward. This mapping is discussed in
|
|
detail in the NL Semantics specification.</p>
|
|
|
|
<p>2. Transitioning semantic results from ASR to VoiceXML: The
|
|
result of processing the semantic tags of a W3C ASR grammar is
|
|
the value of the attribute of the root rule when all semantic
|
|
attachment evaluations have been completed. In addition, the root
|
|
rule (like all non-terminals) has an associated "text" variable
|
|
which contains the series of tokens in the utterance that is
|
|
governed by that non-terminal. In the process of making ASR
|
|
results available to VoiceXML documents, the VoiceXML platform is
|
|
not only responsible for filling in the VoiceXML fields based on
|
|
the value of the attribute of the root rule, as described above,
|
|
but also for filling in the shadow variables of the field. The
|
|
name$.utterance shadow variable of the field should be the same
|
|
as the "text" variable value for the ASR root rule. The platform
|
|
is also responsible for instantiating the value of the shadow
|
|
variable "name$.confidence" based on information supplied by the
|
|
ASR platform, as well as the value of "name$.inputmode" based on
|
|
whether DTMF or speech was processed. Finally, the platform is
|
|
responsible for making this same information available in the
|
|
"application.lastresult$" variable, defined in Section 5.1.5
|
|
(specifically, "application.lastresult$.utterance",
|
|
"application.lastresult$.inputmode", and
|
|
"application.lastresult$.interpretation"), with the exception of
|
|
application.lastresult$.confidence, which the platform sets to
|
|
the confidence of the entire utterance interpretation.</p>
|
|
|
|
<p>3. Mismatches between semantic results and VoiceXML fields:
|
|
Mapping semantic results to VoiceXML depends on a tight
|
|
coordination between the ASR grammar and the VoiceXML markup.
|
|
Since in the current framework there's nothing that enforces
|
|
consistency between a grammar and the associated VoiceXML dialog,
|
|
mismatches can occur due to developer oversight. Since the
|
|
dialog's behaviour during these mismatches is difficult to
|
|
distinguish from certain normal situations, verifying consistency
|
|
of information is extremely important. Some examples of
|
|
mismatches:</p>
|
|
|
|
<ul>
|
|
<li>The semantic results contain extra information that doesn't
|
|
correspond to the VoiceXML fields.This could occur either due to
|
|
developer error or if a richer grammar is being used than is
|
|
required by the VoiceXML application. This extra information will
|
|
be ignored.</li>
|
|
|
|
<li>The VoiceXML application expects information in the result
|
|
that isn't present. This could also be due to developer error, or
|
|
it may be that the user simply didn't supply a value for a
|
|
particular slot. In this case the normal FIA applies and the
|
|
missing value would be elicited from the user. If the problem was
|
|
in fact caused by a developer error, and the grammar is actually
|
|
incapable of recognizing the correct value, the FIA will keep
|
|
eliciting the missing value until it invokes whatever provisions
|
|
the platform and application have in place for repeated nomatch
|
|
failures.</li>
|
|
|
|
<li>Finally, information might be present in both the VoiceXML
|
|
and the ASR result, but in inconsistent formats. For example, an
|
|
ASR grammar might provide a structured object for the drink which
|
|
includes the size and whether the drink is diet or non-diet, but
|
|
the VoiceXML form might only expect a string consisting of the
|
|
name of the drink. The system's behaviour in these situations
|
|
would depend on what is being done with the results. For example,
|
|
a structured object might be sent to a server side script that's
|
|
expecting a string, and the consequences of this would depend on
|
|
the server script.</li>
|
|
</ul>
|
|
|
|
<p>In order to address these potential problems, the committee is
|
|
looking at various approaches to ensuring consistency between the
|
|
grammar and the VoiceXML.</p>
|
|
|
|
<!--- CHAPTER 3: END =-->
|
|
<!--- CHAPTER 4: BEGIN =-->
|
|
<h1 id="L5302"><a id="dml4" name="dml4" shape="rect">4. System
|
|
Output</a></h1>
|
|
|
|
<h2 id="L5305"><a id="dml4.1" name="dml4.1" shape="rect">4.1
|
|
Prompts</a></h2>
|
|
|
|
<p>The <prompt> element controls the output of synthesized
|
|
speech and prerecorded audio. Conceptually, prompts are
|
|
instantaneously queued for play, so interpretation proceeds until
|
|
the user needs to provide an input. At this point, the prompts
|
|
are played, and the system waits for user input. Once the input
|
|
is received from the speech recognition subsystem (or the DTMF
|
|
recognizer), interpretation proceeds.</p>
|
|
|
|
<p>The <prompt> element has the following attributes:</p>
|
|
|
|
<table id="table34" cellspacing="0" cellpadding="5" width="80%"
|
|
border="1" summary="Table 34: prompt attributes">
|
|
<caption align="bottom">Table 34: <prompt>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>bargein</th>
|
|
<td>Control whether a user can interrupt
|
|
a prompt. This defaults to the value of the bargein property. See
|
|
<a href="#dml6.3.4" shape="rect">Section 6.3.4</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>bargeintype</th>
|
|
<td>Sets the type of bargein to be
|
|
'speech', or 'hotword'. This defaults to the value of the
|
|
bargeintype property. See <a href="#dml6.3.4"
|
|
shape="rect">Section 6.3.4</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>cond</th>
|
|
<td>An expression that must evaluate to
|
|
true after conversion to boolean in order for the prompt to be
|
|
played. Default is true.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>count</th>
|
|
<td>A number that allows you to emit
|
|
different prompts if the user is doing something repeatedly.
|
|
If omitted, it defaults to "1".</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>timeout</th>
|
|
<td>The timeout that will be used for
|
|
the following user input. The value is a Time Designation (see
|
|
<a href="#dml6.5" shape="rect">Section 6.5</a>). The default
|
|
noinput timeout is platform specific.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>xml:lang</th>
|
|
<td>The <a href="#term-language"
|
|
shape="rect">language identifier</a> for the prompt. If
|
|
omitted, it defaults to the value specified in the document's
|
|
"xml:lang" attribute.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>xml:base</th>
|
|
<td>Declares the base URI from which
|
|
relative URIs in the prompt are resolved. This base declaration
|
|
has precedence over the <vxml> base URI declaration. If a
|
|
local declaration is omitted, the value is inherited down the
|
|
document hierarchy.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L5393"><a id="dml4.1.1" name="dml4.1.1"
|
|
shape="rect">4.1.1 Speech Markup</a></h3>
|
|
|
|
<p>The content of the <prompt> element is modelled on the
|
|
W3C Speech Synthesis Markup Language 1.0 <a href="#ref_SSML"
|
|
shape="rect">[SSML]</a>.</p>
|
|
|
|
<p>The following speech markup elements are defined in <a
|
|
href="#ref_SSML" shape="rect">[SSML]</a> and are available in
|
|
VoiceXML 2.0. Refer to the W3C Speech Synthesis Markup Language
|
|
1.0 [<a href="#ref_SSML" shape="rect">SSML]</a> for definitions
|
|
and examples.</p>
|
|
|
|
<table cellspacing="0" cellpadding="4" width="80%" border="1"
|
|
summary="Table 35: ssml elements">
|
|
<caption align="bottom">Table 35: SSML Elements Available in
|
|
VoiceXML</caption>
|
|
|
|
<thead>
|
|
<tr>
|
|
<th>Element</th>
|
|
<th>Purpose</th>
|
|
<th>Section<br />
|
|
<small>(in SSML spec)</small> </th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><audio></td>
|
|
<td>Specifies audio files to be played
|
|
and text to be spoken.</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.3.1"
|
|
shape="rect">3.3.1</a> </td>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<td><break></td>
|
|
<td>Specifies a pause in the speech
|
|
output.</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.2.3"
|
|
shape="rect">3.2.3</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><desc></td>
|
|
<td>Provides a description of a
|
|
non-speech audio source in <audio>.</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.3.3"
|
|
shape="rect">3.3.3</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><emphasis></td>
|
|
<td>Specifies that the enclosed text
|
|
should be spoken with emphasis.</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.2.2"
|
|
shape="rect">3.2.2</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><lexicon></td>
|
|
<td>Specifies a pronunciation lexicon for
|
|
the prompt.</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.1.4"
|
|
shape="rect">3.1.4</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><mark></td>
|
|
<td><i>Ignored by VoiceXML platforms.</i>
|
|
</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.3.2"
|
|
shape="rect">3.3.2</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><meta></td>
|
|
<td>Specifies meta and "http-equiv"
|
|
properties for the prompt.</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.1.5"
|
|
shape="rect">3.1.5</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><metadata></td>
|
|
<td>Specifies XML metadata content for
|
|
the prompt.</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.1.6"
|
|
shape="rect">3.1.6</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td>
|
|
<p><p></p>
|
|
</td>
|
|
<td>Identifies the enclosed text as a
|
|
paragraph, containing zero or more sentences</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.1.7"
|
|
shape="rect">3.1.7</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><phoneme></td>
|
|
<td>Specifies a phonetic pronunciation
|
|
for the contained text.</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.1.9"
|
|
shape="rect">3.1.9</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><prosody></td>
|
|
<td>Specifies prosodic information for
|
|
the enclosed text.</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.2.4"
|
|
shape="rect">3.2.4</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><say-as></td>
|
|
<td>Specifies the type of text construct
|
|
contained within the element.</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.1.8"
|
|
shape="rect">3.1.8</a> </td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><s></td>
|
|
<td>Identifies the enclosed text as a
|
|
sentence.</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.1.7"
|
|
shape="rect">3.1.7</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><sub></td>
|
|
<td>Specifies replacement spoken text for
|
|
the contained text.</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.1.10"
|
|
shape="rect">3.1.10</a> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><voice></td>
|
|
<td>Specifies voice characteristics for
|
|
the spoken text.</td>
|
|
<td><a
|
|
href="http://www.w3.org/TR/speech-synthesis/#S3.2.1"
|
|
shape="rect">3.2.1</a> </td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>When used in VoiceXML, additional properties are defined for
|
|
the <audio> (<a href="#dml4.1.3" shape="rect">Section
|
|
4.1.3</a>) and <say-as> (<a href="#dmlABuiltins"
|
|
shape="rect">Appendix P</a>) elements. VoiceXML also allows
|
|
<enumerate> and <value> elements to appear within the
|
|
<prompt> element.</p>
|
|
|
|
<p>The VoiceXML platform must be a Conforming Speech Synthesis
|
|
Markup Language Processor as defined in the <a href="#ref_SSML"
|
|
shape="rect">[SSML]</a>. While this requires a platform to
|
|
process documents with one or more "xml:lang" attributes defined,
|
|
it does not require that the platform must be multi-lingual. When
|
|
an unsupported language is encountered, the platform throws an
|
|
<b>error.unsupported.language</b> event which specifies the
|
|
language in its message variable.</p>
|
|
|
|
<h3 id="L5367"><a id="dml4.1.2" name="dml4.1.2"
|
|
shape="rect">4.1.2 Basic Prompts</a></h3>
|
|
|
|
<p>You've seen prompts in the previous examples:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<prompt>Please say your city.</prompt>
|
|
</pre>
|
|
|
|
<p>You can leave out the <prompt> ... </prompt>
|
|
if:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>There is no need to specify a prompt attribute (like bargein),
|
|
and</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The prompt consists entirely of PCDATA (contains no speech
|
|
markups) or consists of just an <audio> or <value>
|
|
element.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>For instance, these are also prompts:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
Please say your city.
|
|
|
|
<audio src="say_your_city.wav"/>
|
|
</pre>
|
|
|
|
<p>But in this example, the enclosing prompt elements are
|
|
required due to the embedded speech markups:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<prompt>Please <emphasis>say</emphasis> your city.</prompt>
|
|
</pre>
|
|
|
|
<p>When prompt content is specified without an explicit
|
|
<prompt> element, then the prompt attributes are defined as
|
|
specified in <a shape="rect" href="#table34">Table 34</a>.</p>
|
|
|
|
<h3 id="L5820"><a id="dml4.1.3" name="dml4.1.3"
|
|
shape="rect">4.1.3 Audio Prompting</a></h3>
|
|
|
|
<p>Prompts can consist of any combination of prerecorded files,
|
|
audio streams, or synthesized speech:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<prompt>
|
|
Welcome to the Bird Seed Emporium.
|
|
<audio src="rtsp://www.birdsounds.example.com/thrush.wav"/>
|
|
We have 250 kilogram drums of thistle seed for
|
|
<say-as interpret-as="currency">$299.95</say-as>
|
|
|
|
plus shipping and handling this month.
|
|
<audio src="http://www.birdsounds.example.com/mourningdove.wav"/>
|
|
</prompt>
|
|
</pre>
|
|
|
|
<p>Audio can be played in any prompt. The audio content can be
|
|
specified via a URI, and in VoiceXML it can also be in an
|
|
<i>audio</i> variable previously recorded:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<prompt>
|
|
Your recorded greeting is
|
|
<audio expr="greeting"/>
|
|
To rerecord, press 1.
|
|
To keep it, press pound.
|
|
To return to the main menu press star M.
|
|
To exit press star, star X.
|
|
</prompt>
|
|
</pre>
|
|
|
|
<p>The <audio> element can have alternate content in case
|
|
the audio sample is not available:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<prompt>
|
|
<audio src="welcome.wav">
|
|
<emphasis>Welcome</emphasis> to the Voice Portal.
|
|
</audio>
|
|
</prompt>
|
|
</pre>
|
|
|
|
<p>If the audio file cannot be played (e.g. 'src' referencing or
|
|
'expr' evaluating to an invalid URI, a file with an unsupported
|
|
format, etc), the content of the audio element is played instead.
|
|
The content may include text, speech markup, or another audio
|
|
element. If the audio file cannot be played and the content
|
|
of the audio element is empty, no audio is played and no error
|
|
event is thrown.</p>
|
|
|
|
<p>If <audio> contains an 'expr' attribute evaluating to
|
|
ECMAScript undefined, then the element, including its alternate
|
|
content, is ignored. This allows a developer to specify
|
|
<audio> elements with dynamically assigned content which,
|
|
if the element is not required, can be ignored by assigning its
|
|
'expr' a null value. For example, the following code shows how
|
|
this could be used to play back a hand of cards using
|
|
concatenated audio clips:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form>
|
|
<!-- script contains the function sayCard(type,position)
|
|
which takes as input the type of card description (audio or text) and
|
|
its position in an array, and returns the selected card description in
|
|
the specified array position; if there is no description in the
|
|
requested array position, then returns ECMAScript undefined
|
|
-->
|
|
|
|
<script src="cardgame.js"/>
|
|
|
|
<field name="takecard">
|
|
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
|
|
<prompt>
|
|
<audio src="you_have.wav">You have the following cards: </audio>
|
|
<!-- maximum of hand of 5 cards is described -->
|
|
<audio expr="sayCard(audio,1)"><value expr="sayCard(text,1)"/></audio>
|
|
<audio expr="sayCard(audio,2)"><value expr="sayCard(text,2)"/></audio>
|
|
<audio expr="sayCard(audio,3)"><value expr="sayCard(text,3)"/></audio>
|
|
<audio expr="sayCard(audio,4)"><value expr="sayCard(text,4)"/></audio>
|
|
<audio expr="sayCard(audio,5)"><value expr="sayCard(text,5)"/></audio>
|
|
<audio src="another.wav">Would you like another card?</audio>
|
|
</prompt>
|
|
<filled>
|
|
<if cond="takecard">
|
|
<script>takeAnotherCard()</script>
|
|
<clear/>
|
|
<else/>
|
|
<goto next="./make_bid.vxml"/>
|
|
</if>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>Attributes of <audio> defined in <a href="#ref_SSML"
|
|
shape="rect">[SSML]</a> are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 36: audio attributes inherited from ssml">
|
|
<caption align="bottom">Table 36: <audio> Attributes
|
|
Inherited from SSML</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>src</th>
|
|
<td>The URI of the audio prompt. See <a
|
|
href="#dmlAAudioFormats" shape="rect">Appendix E</a> for required
|
|
audio file formats; additional formats may be used if supported
|
|
by the platform.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Attributes of <audio> defined only in VoiceXML are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 37: audio attributes in VoiceXML only">
|
|
<caption align="bottom">Table 37: <audio> Attributes added
|
|
in VoiceXML</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>fetchtimeout</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchtimeout
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchhint</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the audiofetchhint
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxage</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the audiomaxage
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxstale</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the audiomaxstale
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>An ECMAScript expression which
|
|
determines the source of the audio to be played. The expression
|
|
may be either a reference to audio previously recorded with the
|
|
<record/> item or evaluate to the URI of an audio resource
|
|
to fetch.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Exactly one of "src" or "expr" must be specified; otherwise,
|
|
an error.badfetch event is thrown.</p>
|
|
|
|
<p>Note that it is a platform optimization to stream audio: i.e.
|
|
the platform may begin processing audio content as it arrives and
|
|
not to wait for full retrieval. The "prefetch" fetchhint can be
|
|
used to request full audio retrieval prior to playback.</p>
|
|
|
|
<h3 id="L5919"><a id="dml4.1.4" name="dml4.1.4"
|
|
shape="rect">4.1.4 <value> Element</a></h3>
|
|
|
|
<p>The <value> element is used to insert the value of an
|
|
expression into a prompt. It has one attribute:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 38: value attributes">
|
|
<caption align="bottom">Table 38: <value>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>The expression to render.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>For example if n is 12, the prompt</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<prompt>
|
|
<value expr="n*n"/> is the square of <value expr="n"/>.
|
|
</prompt>
|
|
</pre>
|
|
|
|
<p>will result in the text string "144 is the square of 12" being
|
|
passed to the speech synthesis engine.</p>
|
|
|
|
<p>The manner in which the value attribute is played is
|
|
controlled by the surrounding speech synthesis markup. For
|
|
instance, a value can be played as a date in the following
|
|
example:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<var name="date" expr="'2000/1/20'"/>
|
|
<prompt>
|
|
<say-as interpret-as="date">
|
|
<value expr="date"/>
|
|
</say-as>
|
|
</prompt>
|
|
</pre>
|
|
|
|
<p>The text inserted by the <value> element is not subject
|
|
to any special interpretation; in particular, it is not parsed as
|
|
an <a href="#ref_SSML" shape="rect">[SSML]</a> document or
|
|
document fragment. XML special characters (&, >, and <)
|
|
are not treated specially and do not need to be escaped. The
|
|
equivalent effect may be obtained by literally inserting the text
|
|
computed by the <value> element in a CDATA section. For
|
|
example, when the following variable assignment:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<script>
|
|
<![CDATA[
|
|
e1 = 'AT&T';
|
|
]]>
|
|
</script>
|
|
</pre>
|
|
|
|
<p>is referenced in a prompt element as</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<prompt> The price of <value expr="e1"/> is $1. </prompt>
|
|
</pre>
|
|
|
|
<p>the following output is produced.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
The price of AT&T is $1.
|
|
</pre>
|
|
|
|
<h3 id="L6037"><a id="dml4.1.5" name="dml4.1.5"
|
|
shape="rect">4.1.5 Bargein</a></h3>
|
|
|
|
<p>If an implementation platform supports bargein, the
|
|
application author can specify whether a user can interrupt, or
|
|
"bargein" on, a prompt using speech or DTMF input. This speeds up
|
|
conversations, but is not always desired. If the application
|
|
author requires that the user must hear all of a warning, legal
|
|
notice, or advertisement, bargein should be disabled. This is
|
|
done with the bargein attribute:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<prompt bargein="false"><audio src="legalese.wav"/></prompt>
|
|
</pre>
|
|
|
|
<p>Users can interrupt a prompt whose bargein attribute is true,
|
|
but must wait for completion of a prompt whose bargein attribute
|
|
is false. In the case where several prompts are queued, the
|
|
bargein attribute of each prompt is honored during the period of
|
|
time in which that prompt is playing. If bargein occurs during
|
|
any prompt in a sequence, all subsequent prompts are not played
|
|
(even those whose bargein attribute is set to false). If the
|
|
bargein attribute is not specified, then the value of the
|
|
bargein property is used if set.</p>
|
|
|
|
<p>When the bargein attribute is false, input is not
|
|
buffered while the prompt is playing, and any DTMF input
|
|
buffered in a transition state is deleted from the buffer (<a
|
|
href="#dml4.1.8" shape="rect">Section 4.1.8</a> describes input
|
|
collection during transition states).</p>
|
|
|
|
<p>Note that not all speech recognition engines or implementation
|
|
platforms support bargein. For a platform to support bargein, it
|
|
must support at least one of the bargein types described in <a
|
|
href="#dml4.1.5.1" shape="rect">Section 4.1.5.1</a>.</p>
|
|
|
|
<h3 id="L6056"><a id="dml4.1.5.1" name="dml4.1.5.1"
|
|
shape="rect">4.1.5.1 Bargein</a> type</h3>
|
|
|
|
<p>When bargein is enabled, the bargeintype attribute can be
|
|
used to suggest the type of bargein the platform will perform
|
|
in response to voice or DTMF input. Possible values for this
|
|
attribute are:</p>
|
|
|
|
<table border="1" cellpadding="5" cellspacing="0" width="80%"
|
|
summary="Table 39: bargeintype values">
|
|
<caption align="bottom">Table 39: bargeintype Values</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th width="140">speech</th>
|
|
<td width="618">The prompt will be
|
|
stopped as soon as speech or DTMF input is detected.
|
|
The prompt is stopped irrespective of whether or not the
|
|
input matches a grammar and irrespective of which grammars
|
|
are active.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="140">hotword</th>
|
|
<td width="618">The prompt will not be
|
|
stopped until a complete match of an active grammar is detected.
|
|
Input that does not match a grammar is ignored (note that this
|
|
even applies during the timeout period); as a consequence, a
|
|
nomatch event will never be generated in the case of hotword
|
|
bargein.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>If the bargeintype attribute is not specified, then the value
|
|
of the bargeintype property is used. Implementations that claim
|
|
to support bargein are required to support at least one of these
|
|
two types. Mixing these types within a single queue of prompts
|
|
can result in unpredictable behavior and is discouraged.</p>
|
|
|
|
<p>In the case of "speech" bargeintype, the exact meaning of
|
|
"speech input" is necessarily implementation-dependent, due to
|
|
the complexity of speech recognition technology. It is expected
|
|
that the prompt will be stopped as soon as the platform is able
|
|
to reliably determine that the input is speech. Stopping the
|
|
prompt as early as possible is desireable because it avoids the
|
|
"stutter" effect in which a user stops in mid-utterance and
|
|
re-starts if he does not believe that the system has heard
|
|
him.</p>
|
|
|
|
<h3 id="L6107"><a id="dml4.1.6" name="dml4.1.6"
|
|
shape="rect">4.1.6 Prompt Selection</a></h3>
|
|
|
|
<p><i>Tapered prompts</i> are those that may change with each
|
|
attempt. Information-requesting prompts may become more terse
|
|
under the assumption that the user is becoming more familiar with
|
|
the task. Help messages become more detailed perhaps, under the
|
|
assumption that the user needs more help. Or, prompts can change
|
|
just to make the interaction more interesting.</p>
|
|
|
|
<p>Each input item, <initial>, and menu has an internal
|
|
prompt counter that is reset to one each time the form or menu is
|
|
entered. Whenever the system selects a given input item in
|
|
the select phase of FIA and FIA does perform normal selection and
|
|
queuing of prompts (i.e., as described in <a href="#dml5.3.6"
|
|
shape="rect">Section 5.3.6</a>, the previous iteration of FIA did
|
|
not end with a catch handler that had no reprompt), the input
|
|
item's associated prompt counter is incremented. This is the
|
|
mechanism supporting tapered prompts.</p>
|
|
|
|
<p>For instance, here is a form with a form level prompt and
|
|
field level prompts:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="tapered">
|
|
<block>
|
|
<prompt bargein="false">
|
|
Welcome to the ice cream survey.
|
|
</prompt>
|
|
</block>
|
|
<field name="flavor">
|
|
<grammar mode="voice" version="1.0" root="root">
|
|
<rule id="root" scope="public">
|
|
<one-of>
|
|
<item>vanilla </item>
|
|
<item>chocolate</item>
|
|
<item>strawberry</item>
|
|
</one-of>
|
|
</rule>
|
|
</grammar>
|
|
<prompt count="1">What is your favorite flavor?</prompt>
|
|
<prompt count="3">Say chocolate, vanilla, or strawberry.</prompt>
|
|
<help>Sorry, no help is available.</help>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>A conversation using this form follows:</p>
|
|
|
|
<blockquote>
|
|
<p>C: Welcome to the ice cream survey.</p>
|
|
|
|
<p>C: What is your favorite flavor? <span class="stage">(the
|
|
"flavor" field's prompt counter is 1)</span></p>
|
|
|
|
<p>H: Pecan praline.</p>
|
|
|
|
<p>C: I do not understand.</p>
|
|
|
|
<p>C: What is your favorite flavor? <span class="stage">(the
|
|
prompt counter is now 2)</span></p>
|
|
|
|
<p>H: Pecan praline.</p>
|
|
|
|
<p>C: I do not understand.</p>
|
|
|
|
<p>C: Say chocolate, vanilla, or strawberry. <span
|
|
class="stage">(prompt counter is 3)</span></p>
|
|
|
|
<p>H: What if I hate those?</p>
|
|
|
|
<p>C: I do not understand.</p>
|
|
|
|
<p>C: Say chocolate, vanilla, or strawberry. <span
|
|
class="stage">(prompt counter is 4)</span></p>
|
|
|
|
<p>H: ...</p>
|
|
</blockquote>
|
|
|
|
<p>This is just an example to illustrate the use of prompt
|
|
counters. A polished form would need to offer a more extensive
|
|
range of choices and to deal with out of range values in more
|
|
flexible way.</p>
|
|
|
|
<p>When it is time to select a prompt, the prompt counter is
|
|
examined. The child prompt with the highest count attribute less
|
|
than or equal to the prompt counter is used. If a prompt has no
|
|
count attribute, a count of "1" is assumed.</p>
|
|
|
|
<p>A <i>conditional prompt</i> is one that is spoken only if its
|
|
condition is satisfied. In this example, a prompt is varied on
|
|
each visit to the enclosing form.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="another_joke">
|
|
<var name="r" expr="Math.random()"/>
|
|
<field name="another">
|
|
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
|
|
<prompt cond="r &lt; .50">
|
|
Would you like to hear another elephant joke?
|
|
</prompt>
|
|
<prompt cond="r &gt;= .50">
|
|
For another joke say yes. To exit say no.
|
|
</prompt>
|
|
<filled>
|
|
<if cond="another">
|
|
<goto next="#pick_joke"/>
|
|
</if>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>When a prompt must be chosen, a set of prompts to be queued is
|
|
chosen according to the following algorithm:</p>
|
|
|
|
<ol>
|
|
<li>Form an ordered list of prompts consisting of all prompts in
|
|
the enclosing element in document order.</li>
|
|
|
|
<li>Remove from this list all prompts whose cond evaluates to
|
|
false after conversion to boolean.</li>
|
|
|
|
<li>Find the "correct count": the highest count among the prompt
|
|
elements still on the list less than or equal to the current
|
|
count value.</li>
|
|
|
|
<li>Remove from the list all the elements that don't have the
|
|
"correct count".</li>
|
|
</ol>
|
|
|
|
<p>All elements that remain on the list will be queued for
|
|
play.</p>
|
|
|
|
<h3 id="L6183"><a id="dml4.1.7" name="dml4.1.7"
|
|
shape="rect">4.1.7 Timeout</a></h3>
|
|
|
|
<p>The timeout attribute specifies the interval of silence
|
|
allowed while waiting for user input after the end of the last
|
|
prompt. If this interval is exceeded, the platform will throw a
|
|
noinput event. This attribute defaults to the value specified by
|
|
the timeout property (see <a href="#dml6.3.4"
|
|
shape="rect">Section 6.3.4</a>) at the time the prompt is
|
|
queued. In other words, each prompt has its own timeout
|
|
value.</p>
|
|
|
|
<p>The reason for allowing timeouts to be specified as prompt
|
|
attributes is to support tapered timeouts. For example, the user
|
|
may be given five seconds for the first input attempt, and ten
|
|
seconds on the next.</p>
|
|
|
|
<p>The prompt timeout attribute determines the noinput timeout
|
|
for the following input:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<prompt count="1">
|
|
Pick a color for your new Model T.
|
|
</prompt>
|
|
|
|
<prompt count="2" timeout="120s">
|
|
Please choose color of your new nineteen twenty four
|
|
Ford Model T. Possible colors are black, black, or
|
|
black. Please take your time.
|
|
</prompt>
|
|
</pre>
|
|
|
|
<p>If several prompts are queued before a field input, the
|
|
timeout of the last prompt is used.</p>
|
|
|
|
<h3 id="L6199"><a id="dml4.1.8" name="dml4.1.8"
|
|
shape="rect">4.1.8 Prompt Queueing and Input Collection</a></h3>
|
|
|
|
<p>A VoiceXML interpreter is at all times in one of two
|
|
states:</p>
|
|
|
|
<ul>
|
|
<li><i>waiting</i> for input in an input item (such as
|
|
<field>, <record>, or <transfer>),
|
|
<i>or</i></li>
|
|
|
|
<li><i>transitioning</i> between input items in response to an
|
|
input (including spoken utterances, dtmf key presses, and
|
|
input-related events such as a noinput or nomatch event) received
|
|
while in the waiting state. While in the transitioning state no
|
|
speech input is collected, accepted or interpreted. Consequently
|
|
root and document level speech grammars (such as defined in
|
|
<link>s) may not be active at all times. However, DTMF
|
|
input (including timing information) should be collected and
|
|
buffered in the transition state. Similarly, asynchronously
|
|
generated events not related directly to execution of the
|
|
transition should also be buffered until the waiting state (e.g.
|
|
connection.disconnect.hangup).</li>
|
|
</ul>
|
|
|
|
<p>The waiting and transitioning states are related to the phases
|
|
of the Form Interpretation Algorithm as follows:</p>
|
|
|
|
<ul>
|
|
<li>the waiting state is eventually entered in the collect phase
|
|
of an input item (at the point at which the interpreter waits for
|
|
input), and</li>
|
|
|
|
<li>the transitioning state encompasses the process and select
|
|
phases, the collect phase for control items (such as
|
|
<block>s), and the collect phase for input items up until
|
|
the point at which the interpreter waits for input.</li>
|
|
</ul>
|
|
|
|
<p>This distinction of states is made in order to greatly
|
|
simplify the programming model. In particular, an important
|
|
consequence of this model is that the VoiceXML application
|
|
designer can rely on all executable content (such as the content
|
|
of <filled> and <block> elements) being run to
|
|
completion, because it is executed while in the transitioning
|
|
state, which may not be interrupted by input.</p>
|
|
|
|
<p>While in the transitioning state various prompts are queued,
|
|
either by the <prompt> element in executable content or by
|
|
the <prompt> element in form items. In addition, audio may
|
|
be queued by the fetchaudio attribute. The queued prompts and
|
|
audio are played either</p>
|
|
|
|
<ul>
|
|
<li>when the interpreter reaches the waiting state, at which
|
|
point the prompts are played and the interpreter listens for
|
|
input that matches one of the active grammars, <i>or</i></li>
|
|
|
|
<li>when the interpreter begins fetching a resource (such as a
|
|
document) for which fetchaudio was specified. In this case the
|
|
prompts queued before the fetchaudio are played to completion,
|
|
and then, if the resource actually needs to be fetched (i.e. it
|
|
is not unexpired in the cache), the fetchaudio is played until
|
|
the fetch completes. The interpreter remains in the transitioning
|
|
state and no input is accepted during the fetch.</li>
|
|
</ul>
|
|
|
|
<p>Note that when a prompt's bargein attribute is false, input is
|
|
not collected and DTMF input buffered in a transition state is
|
|
deleted (see <a href="#dml4.1.5" shape="rect">Section
|
|
4.1.5</a>).</p>
|
|
|
|
<p>When an ASR grammar is matched, if DTMF input was consumed by
|
|
a simultaneously active DTMF grammar (but did not result in a
|
|
complete match of the DTMF grammar), the DTMF input may, at
|
|
processor discretion, be discarded.</p>
|
|
|
|
<p>Before the interpreter exits all queued prompts are played to
|
|
completion. The interpreter remains in the transitioning state
|
|
and no input is accepted while the interpreter is exiting.</p>
|
|
|
|
<p>It is a permissible optimization to begin playing prompts
|
|
queued during the transitioning state before reaching the waiting
|
|
state, provided that correct semantics are maintained regarding
|
|
processing of the input audio received while the prompts are
|
|
playing, for example with respect to bargein and grammar
|
|
processing.</p>
|
|
|
|
<p>The following examples illustrate the operation of these rules
|
|
in some common cases.</p>
|
|
|
|
<h4 id="L56544561">Case 1</h4>
|
|
|
|
<p>Typical non-fetching case: field, followed by executable
|
|
content (such as <block> and <filled>), followed by
|
|
another field.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
in document d0
|
|
|
|
<field name="f0"/>
|
|
|
|
<block>
|
|
executable content e1
|
|
queues prompts {p1}
|
|
</block>
|
|
|
|
<field name="f2">
|
|
queues prompts {p2}
|
|
enables grammars {g2}
|
|
</field>
|
|
</pre>
|
|
|
|
<p>As a result of input received while waiting in field f0 the
|
|
following actions take place:</p>
|
|
|
|
<ul>
|
|
<li>in transitioning state
|
|
|
|
<ul>
|
|
<li>execute e1 (without goto)</li>
|
|
|
|
<li>queue prompts {p1}</li>
|
|
|
|
<li>queue prompts {p2}</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li>in waiting state, simultaneously
|
|
|
|
<ul>
|
|
<li>play prompts {p1,p2}</li>
|
|
|
|
<li>enable grammars {g2} and wait for input</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<h4 id="L56544562">Case 2</h4>
|
|
|
|
<p>Typical fetching case: field, followed by executable content
|
|
(such as <block> and <filled>) ending with a
|
|
<goto> that specifies fetchaudio, ending up in a field in a
|
|
different document that is fetched from a server.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
in document d0
|
|
|
|
<field name="f0"/>
|
|
|
|
<block>
|
|
executable content e1
|
|
queues prompts {p1}
|
|
ends with goto f2 in d1 with fetchaudio fa
|
|
</block>
|
|
|
|
in document d1
|
|
|
|
<field name="f2">
|
|
queues prompts {p2}
|
|
enables grammars {g2}
|
|
</field>
|
|
</pre>
|
|
|
|
<p>As a result of input received while waiting in field f0 the
|
|
following actions take place:</p>
|
|
|
|
<ul>
|
|
<li>in transitioning state
|
|
|
|
<ul>
|
|
<li>execute e1</li>
|
|
|
|
<li>queue prompts {p1}</li>
|
|
|
|
<li>simultaneously
|
|
|
|
<ul>
|
|
<li>fetch d1</li>
|
|
|
|
<li>play prompts {p1} to completion and then play fa until fetch
|
|
completes</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li>queue prompts {p2}</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li>in waiting state, simultaneously
|
|
|
|
<ul>
|
|
<li>play prompts {p2}</li>
|
|
|
|
<li>enable grammars {g2} and wait for input</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<h4 id="L56544563">Case 3</h4>
|
|
|
|
<p>As in Case 2, but no fetchaudio is specified.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
in document d0
|
|
|
|
<field name="f0"/>
|
|
|
|
<block>
|
|
executable content e1
|
|
queues prompts {p1}
|
|
ends with goto f2 in d1 (no fetchaudio specified)
|
|
</block>
|
|
|
|
in document d1
|
|
|
|
<field name="f2">
|
|
queues prompts {p2}
|
|
enables grammars {g2}
|
|
</field>
|
|
</pre>
|
|
|
|
<p>As a result of input received while waiting in field f0 the
|
|
following actions take place:</p>
|
|
|
|
<ul>
|
|
<li>in transitioning state
|
|
|
|
<ul>
|
|
<li>execute e1</li>
|
|
|
|
<li>queue prompts {p1}</li>
|
|
|
|
<li>fetch d1</li>
|
|
|
|
<li>queue prompts {p2}</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li>in waiting state, simultaneously
|
|
|
|
<ul>
|
|
<li>play prompts {p1, p2}</li>
|
|
|
|
<li>enable grammars {g2} and wait for input</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<!--- CHAPTER 4: END =-->
|
|
<!--- CHAPTER 5: BEGIN =-->
|
|
<h1 id="L6390"><a id="dml5" name="dml5" shape="rect">5. Control
|
|
flow and scripting</a></h1>
|
|
|
|
<h2 id="L6393"><a id="dml5.1" name="dml5.1" shape="rect">5.1
|
|
Variables and Expressions</a></h2>
|
|
|
|
<p>VoiceXML variables are in all respects equivalent to
|
|
ECMAScript variables: they are part of the same variable space.
|
|
VoiceXML variables can be used in a <script> just as
|
|
variables defined in a <script> can be used in VoiceXML.
|
|
Declaring a variable using <var> is equivalent to using a
|
|
'var' statement in a <script> element. <script> can
|
|
also appear everywhere that <var> can appear. VoiceXML
|
|
variables are also declared by form items.</p>
|
|
|
|
<p>The variable naming convention is as in ECMAScript, but names
|
|
beginning with the underscore character ("_") and names ending
|
|
with a dollar sign ("$") are reserved for internal use. VoiceXML
|
|
variables, including form item variables, must not contain
|
|
ECMAScript reserved words. They must also follow ECMAScript rules
|
|
for referential correctness. For example, variable names must be
|
|
unique and their declaration must not include a dot - "var x.y"
|
|
is an illegal declaration in ECMAScript. Variable names which
|
|
violate naming conventions or ECMAScript rules cause an
|
|
'error.semantic' event to be thrown.</p>
|
|
|
|
<h3 id="L6400"><a id="dml5.1.1" name="dml5.1.1"
|
|
shape="rect">5.1.1 Declaring Variables</a></h3>
|
|
|
|
<p>Variables are declared by <var> elements:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<var name="home_phone"/>
|
|
<var name="pi" expr="3.14159"/>
|
|
<var name="city" expr="'Sacramento'"/>
|
|
</pre>
|
|
|
|
<p>They are also declared by form items:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<field name="num_tickets">
|
|
<grammar type="application/srgs+xml" src="/grammars/number.grxml"/>
|
|
<prompt>How many tickets do you wish to purchase?</prompt>
|
|
</field>
|
|
</pre>
|
|
|
|
<p>Variables declared without an explicit initial value are
|
|
initialized to the ECMAScript undefined value. Variables must
|
|
be declared before being used either in VoiceXML or ECMAScript.
|
|
Use of an undeclared variable results in an ECMAScript error
|
|
which is thrown as an error.semantic. Variables declared using
|
|
"var" in ECMAScript can be used in VoiceXML, just as declared
|
|
VoiceXML variables can be used in ECMAScript.</p>
|
|
|
|
<p>In a form, the variables declared by <var> and those
|
|
declared by form items are initialized when the form is entered.
|
|
The initializations are guaranteed to take place in document
|
|
order, so that this, for example, is legal:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form id="test">
|
|
<var name="one" expr="1"/>
|
|
<field name="two" expr="one+1">
|
|
<grammar type="application/srgs+xml" src="/grammars/number.grxml"/>
|
|
</field>
|
|
<var name="three" expr="two+1"/>
|
|
<field name="go_on" type="boolean">
|
|
<prompt>Say yes or no to continue</prompt>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>When the user visits this <form>, the form's
|
|
initialization first declares the variable one and sets its value
|
|
to 1. Then it declares the variable two and gives it the value 2.
|
|
Then the initialization logic declares the variable three and
|
|
gives it the value 3. The form interpretation algorithm then
|
|
enters its main interpretation loop and begins at the go_on
|
|
field.</p>
|
|
|
|
<h3 id="L6421"><a id="dml5.1.2" name="dml5.1.2"
|
|
shape="rect" />5.1.2 Variable Scopes</h3>
|
|
|
|
<p>VoiceXML uses an ECMAScript scope chain to allow variables to
|
|
be declared at different levels of hierarchy in an application.
|
|
For instance, a variable declared at document scope can be
|
|
referenced anywhere within that document, whereas a local
|
|
variable declared in a catch element is only available within
|
|
that catch element. In order to preserve these scoping semantics,
|
|
all ECMAScript variables must be declared. Use of an undeclared
|
|
variable results in an ECMAScript error which is thrown as an
|
|
error.semantic.</p>
|
|
|
|
<p>Variables can be declared in following scopes:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 40: variable scopes">
|
|
<caption align="bottom">Table 40: Variable Scopes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>session</th>
|
|
<td>These are read-only variables that
|
|
pertain to an entire user session. They are declared and set by
|
|
the interpreter context. New session variables cannot be declared
|
|
by VoiceXML documents. See <a href="#dml5.1.4"
|
|
shape="rect">Section 5.1.4</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>application</th>
|
|
<td>These are declared with <var>
|
|
and <script> elements that are children of the
|
|
application root document's <vxml> element. They are
|
|
initialized when the application root document is loaded. They
|
|
exist while the application root document is loaded, and are
|
|
visible to the root document and any other loaded application
|
|
leaf document. Note that while executing inside the
|
|
application root document document.x is equivalent to
|
|
application.x.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>document</th>
|
|
<td>These variables are declared with
|
|
<var> and <script> elements that are children of
|
|
the document's <vxml> element. They are initialized when
|
|
the document is loaded. They exist while the document is loaded.
|
|
They are visible only within that document, unless the document
|
|
is an application root, in which case the variables are visible
|
|
by leaf documents through the application scope only.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>dialog</th>
|
|
<td>Each dialog (<form> or
|
|
<menu>) has a dialog scope that exists while the user is
|
|
visiting that dialog, and which is visible to the elements of
|
|
that dialog. Dialog scope contains the following variables:
|
|
variables declared by <var> and <script> child
|
|
elements of <form>, form item variables, and form item
|
|
shadow variables. The child <var> and <script>
|
|
elements of <form> are initialized when the form is first
|
|
visited, as opposed to <var> elements inside executable
|
|
content which are initialized when the executable content is
|
|
executed.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th><i>(anonymous)</i> </th>
|
|
<td>Each <block>, <filled>,
|
|
and <catch> element defines a new anonymous scope to
|
|
contain variables declared in that element.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>The following diagram shows the scope hierarchy:</p>
|
|
|
|
<p class="fig"><img height="297"
|
|
alt="flow from anonymous via dialog, document, application and session"
|
|
src="Images/image008.gif" width="165" /><br />
|
|
Figure 11: The scope hierarchy.</p>
|
|
|
|
<p>The curved arrows in this diagram show that each scope
|
|
contains a pre-defined variable whose name is the same as the
|
|
scope that refers to the scope itself. This allows you for
|
|
example in the anonymous, dialog, and document scopes to refer to
|
|
a variable <i>X</i> in the document scope using
|
|
document.<i>X</i>. As another example, a <filled>'s
|
|
variable scope is an anonymous scope local to the <filled>,
|
|
whose parent variable scope is that of the <form>.</p>
|
|
|
|
<p>It is not recommended to use "session", "application",
|
|
"document", and "dialog" as the names of variables and form
|
|
items. While they are not reserved words, using them hides the
|
|
pre-defined variables with the same name because of ECMAScript
|
|
scoping rules used by VoiceXML.</p>
|
|
|
|
<h3 id="L6494"><a id="dml5.1.3" name="dml5.1.3"
|
|
shape="rect">5.1.3 Referencing Variables</a></h3>
|
|
|
|
<p>Variables are referenced in cond and expr attributes:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<if cond="city == 'LA'">
|
|
<assign name="city" expr="'Los Angeles'"/>
|
|
<elseif cond="city == 'Philly'"/>
|
|
<assign name="city" expr="'Philadelphia'"/>
|
|
<elseif cond="city =='Constantinople'"/>
|
|
<assign name="city" expr="'Istanbul'"/>
|
|
</if>
|
|
|
|
<assign name="var1" expr="var1 + 1"/>
|
|
|
|
<if cond="i &gt; 1">
|
|
<assign name="i" expr="i-1"/>
|
|
</if>
|
|
</pre>
|
|
|
|
<p>The expression language used in cond and expr is precisely
|
|
ECMAScript. Note that the cond operators "<", "<=", and
|
|
"&&" must be escaped in XML (to "&lt;" and so
|
|
on).</p>
|
|
|
|
<p>Variable references match the closest enclosing scope
|
|
according to the scope chain given above. You can prefix a
|
|
reference with a scope name for clarity or to resolve ambiguity.
|
|
For instance to save the value of a variable associated with one
|
|
of the fields in a form for use later on in a
|
|
document:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<assign name="document.ssn" expr="dialog.ssn"/>
|
|
</pre>
|
|
|
|
<p>If the application root document has a variable x, it is
|
|
referred to as application.x in non-root documents, and either
|
|
application.x or document.x in the application root document.
|
|
If the document does not have a specified application root
|
|
and has a variable x, it is referred to as either application.x
|
|
or document.x in the document.</p>
|
|
|
|
<h3 id="L6509"><a id="dml5.1.4" name="dml5.1.4"
|
|
shape="rect">5.1.4 Standard Session Variables</a></h3>
|
|
|
|
<dl>
|
|
<dt><b>session.connection.local.uri</b></dt>
|
|
|
|
<dd>This variable is a URI which addresses the local interpreter
|
|
context device.</dd>
|
|
|
|
<dt><b>session.connection.remote.uri</b></dt>
|
|
|
|
<dd>This variable is a URI which addresses the remote caller
|
|
device.</dd>
|
|
|
|
<dt><b>session.connection.protocol.name</b></dt>
|
|
|
|
<dd>This variable is the name of the connection protocol. The
|
|
name also represents the subobject name for protocol specific
|
|
information. For instance, if session.connection.protocol.name is
|
|
'q931', session.connection.protocol.q931.uui might specify the
|
|
user-to-user information property of the connection.</dd>
|
|
|
|
<dt><b>session.connection.protocol.version</b></dt>
|
|
|
|
<dd>This variable is the version of the connection protocol.</dd>
|
|
|
|
<dt><b>session.connection.redirect</b></dt>
|
|
|
|
<dd>This variable is 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.
|
|
The reason property can be either "unknown", "user busy", "no
|
|
reply", "deflection during alerting", "deflection immediate
|
|
response", "mobile subscriber not reachable".</dd>
|
|
|
|
<dt><b>session.connection.aai</b></dt>
|
|
|
|
<dd>This variable is application-to-application information
|
|
passed during connection setup.</dd>
|
|
|
|
<dt><b>session.connection.originator</b></dt>
|
|
|
|
<dd>This variable directly references either the local or remote
|
|
property (For instance, the following ECMAScript would return
|
|
true if the remote party initiated the connection: var
|
|
caller_initiate = connection.originator ==
|
|
connection.remote).</dd>
|
|
</dl>
|
|
|
|
<h3 id="L6603"><a id="dml5.1.5" name="dml5.1.5"
|
|
shape="rect">5.1.5 Standard Application Variables</a></h3>
|
|
|
|
<dl>
|
|
<dt><b>application.lastresult$</b></dt>
|
|
|
|
<dd>This variable holds information about the last recognition to
|
|
occur within this application. It is an array of elements where
|
|
each element, application.lastresult$[i], represents a possible
|
|
result through the following variables:<br />
|
|
<br />
|
|
|
|
|
|
<dl>
|
|
<dt><b>application.lastresult$[i].confidence</b></dt>
|
|
|
|
<dd>The whole utterance confidence level for this interpretation
|
|
from 0.0-1.0. A value of 0.0 indicates minimum confidence, and a
|
|
value of 1.0 indicates maximum confidence. More specific
|
|
interpretation of a confidence value is platform-dependent.</dd>
|
|
|
|
<dt><b>application.lastresult$[i].utterance</b></dt>
|
|
|
|
<dd>The raw string of words that were recognized for this
|
|
interpretation. The exact tokenization and spelling is
|
|
platform-specific (e.g. "five hundred thirty" or "5 hundred 30"
|
|
or even "530"). In the case of a DTMF grammar, this variable will
|
|
contain the matched digit string.</dd>
|
|
|
|
<dt><b>application.lastresult$[i].inputmode</b></dt>
|
|
|
|
<dd>For this interpretation,the mode in which user input was
|
|
provided: dtmf or voice.</dd>
|
|
|
|
<dt><b>application.lastresult$[i].interpretation</b></dt>
|
|
|
|
<dd>An ECMAScript variable containing the interpretation as
|
|
described in <a href="#dml3.1.5" shape="rect">Section
|
|
3.1.5</a>.</dd>
|
|
</dl>
|
|
|
|
<p>Interpretations are sorted by confidence score, from highest
|
|
to lowest. Interpretations with the same confidence score are
|
|
further sorted according to the precedence relationship (see <a
|
|
href="#dml3.1.4" shape="rect">Section 3.1.4</a>) among the
|
|
grammars producing the interpretations. Different elements in
|
|
application.lastresult$ will always differ in their utterance,
|
|
interpretation, or both.</p>
|
|
|
|
<p>The number of application.lastresult$ elements is guaranteed
|
|
to be greater than or equal to one and less than or equal to the
|
|
system property "maxnbest". If no results have been generated by
|
|
the system, then "application.lastresult$" shall be ECMAScript
|
|
undefined.</p>
|
|
|
|
<p>Additionally, application.lastresult$ itself contains the
|
|
properties confidence, utterance, inputmode, and interpretation
|
|
corresponding to those of the 0th element in the ECMAScript
|
|
array.</p>
|
|
|
|
<p>All of the shadow variables described above are set
|
|
immediately after any recognition. In this context, a
|
|
<nomatch> event counts as a recognition, and causes the
|
|
value of "application.lastresult$" to be set, though the
|
|
values stored in application.lastresult$ are platform dependent.
|
|
In addition, the existing values of field variables are not
|
|
affected by a <nomatch>. In contrast, a
|
|
<noinput> event does not change the value of
|
|
"application.lastresult$". After the value of
|
|
"application.lastresult$" is set, the value persists
|
|
(unless it is modified by the application) until the
|
|
browser enters the next waiting state, when it is set to
|
|
<i>undefined.</i> Similarly, when an application root document
|
|
is loaded, this variable is set to the value <i>undefined</i>.
|
|
The variable application.lastresult$ and all of its
|
|
components are writeable and can be modified by the
|
|
application.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p>The following example shows how application.lastresult$ can be
|
|
used in a field level <catch> to access a <link>
|
|
grammar recognition result and transition to different dialog
|
|
states depending on confidence:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<vxml version="2.0" 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">
|
|
<link event="menulinkevent">
|
|
<grammar src="/grammars/linkgrammar.grxml" type="application/srgs+xml"/>
|
|
</link>
|
|
|
|
<form>
|
|
<field>
|
|
<prompt> Say something </prompt>
|
|
<catch event="menulinkevent">
|
|
<if cond="application.lastresult$.confidence &lt; 0.7">
|
|
<goto nextitem="confirmlinkdialog"/>
|
|
<else/>
|
|
<goto next="./main_menu.html"/>
|
|
</if>
|
|
</catch>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>The final example demonstrates how a script can be used to
|
|
iterate over the array of results in application.lastresult$,
|
|
where each element is represented by
|
|
"application.lastresult$[i]":</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form>
|
|
<field name="color">
|
|
<prompt> Say a color </prompt>
|
|
<grammar type="application/srgs+xml" src="color.grxml" />
|
|
<filled>
|
|
<var name="confident_count" expr="0"/>
|
|
<script>
|
|
<![CDATA[
|
|
// number of results
|
|
var len = application.lastresult$.length;
|
|
|
|
// iterate through array
|
|
for (var i = 0; i < len; i++) {
|
|
// check if DTMF
|
|
if (application.lastresult$[i].confidence > .7) {
|
|
confident_count++;
|
|
}
|
|
}
|
|
]]>
|
|
</script>
|
|
<if cond="confident_count > 1">
|
|
<goto next="#verify"/>
|
|
</if>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<h2 id="L6660"><a id="dml5.2" name="dml5.2" shape="rect">5.2
|
|
Event Handling</a></h2>
|
|
|
|
<p>The platform throws events when the user does not respond,
|
|
doesn't respond in a way that the application understands,
|
|
requests help, etc. The interpreter throws events if it finds
|
|
a semantic error in a VoiceXML document, or when it encounters
|
|
a <throw> element. Events are identified by character
|
|
strings.</p>
|
|
|
|
<p>Each element in which an event can occur has a set of <i>catch
|
|
elements</i>, which include:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p><catch></p>
|
|
</li>
|
|
|
|
<li>
|
|
<p><error></p>
|
|
</li>
|
|
|
|
<li>
|
|
<p><help></p>
|
|
</li>
|
|
|
|
<li>
|
|
<p><noinput></p>
|
|
</li>
|
|
|
|
<li>
|
|
<p><nomatch></p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>An element inherits the catch elements ("as if by copy") from
|
|
each of its ancestor elements, as needed. If a field, for
|
|
example, does not contain a catch element for nomatch, but its
|
|
form does, the form's nomatch catch element is used. In
|
|
this way, common event handling behavior can be specified at any
|
|
level, and it applies to all descendents.</p>
|
|
|
|
<p>The "as if by copy" semantics for inheriting catch elements
|
|
implies that when a catch element is executed, variables are
|
|
resolved and thrown events are handled relative to the scope
|
|
where the original event originated, not relative to the scope
|
|
that contains the catch element. For example, consider a catch
|
|
element that is defined at document scope handling an event that
|
|
originated in a <field> within the document. In such a
|
|
catch element variable references are resolved relative to the
|
|
<field>'s scope, and if an event is thrown by the catch
|
|
element it is handled relative to the <field>. Similarly,
|
|
relative URI references in a catch element are resolved against
|
|
the active document and not relative to the document in which
|
|
they were declared. Finally, properties are resolved relative to
|
|
the element where the event originated. For example, a prompt
|
|
element defined as part of a document level catch would use the
|
|
innermost property value of the active form item to resolve its
|
|
timeout attribute if no value is explicitly specified.</p>
|
|
|
|
<h3 id="L6692"><a id="dml5.2.1" name="dml5.2.1"
|
|
shape="rect">5.2.1 throw element</a></h3>
|
|
|
|
<p>The <throw> element throws an event. These can be the
|
|
pre-defined ones:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<throw event="nomatch"/>
|
|
<throw event="connection.disconnect.hangup"/>
|
|
</pre>
|
|
|
|
<p>or application-defined events:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<throw event="com.att.portal.machine"/>
|
|
</pre>
|
|
|
|
<p>Attributes of <throw> are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 41: throw attributes">
|
|
<caption align="bottom">Table 41: <throw>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>event</th>
|
|
<td>The event being thrown.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>eventexpr</th>
|
|
<td>An ECMAScript expression evaluating
|
|
to the name of the event being thrown.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>message</th>
|
|
<td>A message string providing additional
|
|
context about the event being thrown. For the pre-defined events
|
|
thrown by the platform, the value of the message is
|
|
platform-dependent.<br />
|
|
The message is available as the value of a variable within the
|
|
scope of the catch element, see below.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>messageexpr</th>
|
|
<td>An ECMAScript expression evaluating
|
|
to the message string.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Exactly one of "event" or "eventexpr" must be specified;
|
|
otherwise, an error.badfetch event is thrown. Exactly one of
|
|
"message" or "messageexpr" may be specified; otherwise, an
|
|
error.badfetch event is thrown.</p>
|
|
|
|
<p>Unless explicited stated otherwise, VoiceXML does not specify
|
|
when events are thrown.</p>
|
|
|
|
<h3 id="L6748"><a id="dml5.2.2" name="dml5.2.2"
|
|
shape="rect">5.2.2 catch element</a></h3>
|
|
|
|
<p>The catch element associates a catch with a document, dialog,
|
|
or form item (except for blocks). It contains executable
|
|
content.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<vxml version="2.0" 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">
|
|
<form id="launch_missiles">
|
|
<field name="user_id" type="digits">
|
|
<prompt>What is your username</prompt>
|
|
</field>
|
|
<field name="password">
|
|
<prompt>What is the code word?</prompt>
|
|
<grammar version="1.0" root="root">
|
|
<rule id="root" scope="public">rutabaga</rule>
|
|
</grammar>
|
|
<help>It is the name of an obscure vegetable.</help>
|
|
<catch event="nomatch noinput" count="3">
|
|
<prompt>Security violation!</prompt>
|
|
<submit next="http://www.example.com/apprehend_felon.vxml"
|
|
namelist="user_id"/>
|
|
</catch>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>The catch element's anonymous variable scope includes the
|
|
special variable _event which contains the name of the event that
|
|
was thrown. For example, the following catch element can handle
|
|
two types of events:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<catch event="event.foo event.bar">
|
|
<if cond="_event=='event.foo'">
|
|
<!-- Play this for event.foo events -->
|
|
<audio src="foo.wav"/>
|
|
<else/>
|
|
<!-- Play this for event.bar events -->
|
|
<audio src="bar.wav"/>
|
|
</if>
|
|
<!-- Continue with common handling for either event -->
|
|
</catch>
|
|
</pre>
|
|
|
|
<p>The _event variable is inspected to select the audio to play
|
|
based on the event that was thrown. The foo.wav file will be
|
|
played for event.foo events. The bar.wav file will be played for
|
|
event.bar events. The remainder of the catch element contains
|
|
executable content that is common to the handling of both event
|
|
types.</p>
|
|
|
|
<p>The catch element's anonymous variable scope also includes the
|
|
special variable _message which contains the value of the message
|
|
string from the corresponding <throw> element, or a
|
|
platform-dependent value for the pre-defined events raised by the
|
|
platform. If the thrown event does not specify a message, the
|
|
value of _message is ECMAScript undefined.</p>
|
|
|
|
<p>If a <catch> element contains a <throw> element
|
|
with the same event, then there may be an infinite loop:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<catch event="help">
|
|
<throw event="help"/>
|
|
</catch>
|
|
</pre>
|
|
|
|
<p>A platform could detect this situation and throw a semantic
|
|
error instead.</p>
|
|
|
|
<p>Attributes of <catch> are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 42: catch attributes">
|
|
<caption align="bottom">Table 42: <catch>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>event</th>
|
|
<td>The event or events to catch. A
|
|
space-separated list of events may be specified, indicating that
|
|
this <catch> element catches all the events named in the
|
|
list. In such a case a separate event counter (see "count"
|
|
attribute) is maintained for each event. If the attribute is
|
|
unspecified, all events are to be caught.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>count</th>
|
|
<td>The occurrence of the event (default
|
|
is 1). The count allows you to handle different occurrences of
|
|
the same event differently.
|
|
|
|
<p>Each <form>, <menu>, and form item maintains a
|
|
counter for each event that occurs while it is being visited.
|
|
Item-level event counters are used for events thrown while
|
|
visiting individual form items and while executing <filled>
|
|
elements contained within those items. Form-level and menu-level
|
|
counters are used for events thrown during dialog initialization
|
|
and while executing form-level <filled> elements.</p>
|
|
|
|
<p>Form-level and menu-level event counters are reset each time
|
|
the <menu> or <form> is re-entered. Form-level and
|
|
menu-level event counters are not reset by the <clear>
|
|
element.</p>
|
|
|
|
<p>Item-level event counters are reset each time the <form>
|
|
containing the item is re-entered. Item-level event counters are
|
|
also reset when the item is reset with the <clear> element.
|
|
An item's event counters are not reset when the item is
|
|
re-entered without leaving the <form>.</p>
|
|
|
|
<p>Counters are incremented against the full event name and every
|
|
prefix matching event name; for example, occurrence of the event
|
|
"event.foo.1" increments the counters for "event.foo.1" plus
|
|
"event.foo" and "event".</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>cond</th>
|
|
<td>An expression which must evaluate to
|
|
true after conversion to boolean in order for the event to be
|
|
caught. Defaults to true.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L6808"><a id="dml5.2.3" name="dml5.2.3"
|
|
shape="rect">5.2.3 Shorthand Notation</a></h3>
|
|
|
|
<p>The <error>, <help>, <noinput>, and
|
|
<nomatch> elements are shorthands for very common types of
|
|
<catch> elements.</p>
|
|
|
|
<p>The <error> element is short for <catch
|
|
event="error"> and catches all events of type error:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<error>
|
|
An error has occurred -- please call again later.
|
|
<exit/>
|
|
</error>
|
|
</pre>
|
|
|
|
<p>The <help> element is an abbreviation for <catch
|
|
event="help">:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<help>No help is available.</help>
|
|
</pre>
|
|
|
|
<p>The <noinput> element abbreviates <catch
|
|
event="noinput">:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<noinput>I didn't hear anything, please try again.</noinput>
|
|
</pre>
|
|
|
|
<p>And the <nomatch> element is short for <catch
|
|
event="nomatch">:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<nomatch>I heard something, but it wasn't a known city.</nomatch>
|
|
</pre>
|
|
|
|
<p>These elements take the attributes:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 43: shorthand catch attributes">
|
|
<caption align="bottom">Table 43: Shorthand Catch
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>count</th>
|
|
<td>The event count (as in
|
|
<catch>).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>cond</th>
|
|
<td>An optional condition to test to see
|
|
if the event is caught by this element (as in <catch>
|
|
described in <a href="#dml5.2.2" shape="rect">Section 5.2.2</a>).
|
|
Defaults to true.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L6855"><a id="dml5.2.4" name="dml5.2.4"
|
|
shape="rect">5.2.4 catch element selection</a></h3>
|
|
|
|
<p>An element inherits the catch elements ("as if by copy") from
|
|
each of its ancestor elements, as needed. For example, if a
|
|
<field> element inherits a <catch> element from the
|
|
document</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<vxml version="2.0" 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">
|
|
<catch event="event.foo">
|
|
<audio src="beep.wav"/>
|
|
</catch>
|
|
|
|
<form>
|
|
<field name="color">
|
|
<prompt>Please say a primary color</prompt>
|
|
<grammar type="application/srgs">red | yellow | blue</grammar>
|
|
<nomatch>
|
|
<throw event="event.foo"/>
|
|
</nomatch>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>then the <catch> element is implicitly copied into
|
|
<field> as if defined below:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<vxml version="2.0" 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">
|
|
<form>
|
|
<field>
|
|
<prompt>Please say a primary color</prompt>
|
|
<grammar type="application/srgs">red | yellow | blue</grammar>
|
|
<nomatch>
|
|
<throw event="event.foo"/>
|
|
</nomatch>
|
|
<catch event="event.foo">
|
|
<audio src="beep.wav"/>
|
|
</catch>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>When an event is thrown, the scope in which the event is
|
|
handled and its enclosing scopes are examined to find the <i>best
|
|
qualified</i> catch element, according to the following
|
|
algorithm:</p>
|
|
|
|
<ol>
|
|
<li>Form an ordered list of catches consisting of all catches in
|
|
the current scope and all enclosing scopes (form item, form,
|
|
document, application root document, interpreter context),
|
|
ordered first by scope (starting with the current scope), and
|
|
then within each scope by document order.</li>
|
|
|
|
<li>Remove from this list all catches whose event name does not
|
|
match the event being thrown or whose cond evaluates to false
|
|
after conversion to boolean.</li>
|
|
|
|
<li>Find the "correct count": the highest count among the catch
|
|
elements still on the list less than or equal to the current
|
|
count value.</li>
|
|
|
|
<li>Select the first element in the list with the "correct
|
|
count".</li>
|
|
</ol>
|
|
|
|
<p>The name of a thrown event matches the catch element event
|
|
name if it is an exact match, a prefix match or if the catch
|
|
event attribute is not specified (note that the event attribute
|
|
cannot be specified as an empty string - event="" is syntactically
|
|
invalid). A prefix match occurs when the catch element event
|
|
attribute is a token prefix of the name of the event being thrown,
|
|
where the dot is the token separator, all trailing dots are
|
|
removed, and a remaining empty string matches everything. For
|
|
example,</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<catch event="connection.disconnect">
|
|
<prompt>Caught a connection dot disconnect event</prompt>
|
|
</catch>
|
|
</pre>
|
|
|
|
<p>will prefix match the event
|
|
connection.disconnect.transfer.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<catch event="com.example.myevent">
|
|
<prompt>Caught a com dot example dot my event</prompt>
|
|
</catch>
|
|
</pre>
|
|
|
|
<p>prefix matches com.example.myevent.event1.,
|
|
com.example.myevent. and com.example.myevent..event1 but not
|
|
com.example.myevents.event1. Finally,</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<catch event=".">
|
|
<prompt>Caught an event</prompt>
|
|
</catch>
|
|
</pre>
|
|
|
|
<p>prefix matches all events (as does <catch> without an
|
|
event attribute).</p>
|
|
|
|
<p>Note that the catch element selection algorithm gives priority
|
|
to catch elements that occur earlier in a document over those
|
|
that occur later, but does not give priority to catch elements
|
|
that are more specific over those that are less specific.
|
|
Therefore is generally advisable to specify catch elements in
|
|
order from more specific to less specific. For example, it would
|
|
be advisable to specify catch elements for "error.foo" and
|
|
"error" in that order, as follows:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<catch event="error.foo">
|
|
<prompt>Caught an error dot foo event</prompt>
|
|
</catch>
|
|
<catch event="error">
|
|
<prompt>Caught an error event</prompt>
|
|
</catch>
|
|
</pre>
|
|
|
|
<p>If the catch elements were specified in the opposite order,
|
|
the catch element for "error.foo" would never be executed.</p>
|
|
|
|
<h3 id="L6904"><a id="dml5.2.5" name="dml5.2.5"
|
|
shape="rect">5.2.5 Default catch elements</a></h3>
|
|
|
|
<p>The interpreter is expected to provide implicit default catch
|
|
handlers for the noinput, help, nomatch, cancel, exit, and error
|
|
events if the author did not specify them.</p>
|
|
|
|
<p>The system default behavior of catch handlers for various
|
|
events and errors is summarized by the definitions below that
|
|
specify (1) whether any audio response is to be provided, and (2)
|
|
how execution is affected. Note: where an audio response is
|
|
provided, the actual content is platform dependent.</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 44: default catch handlers">
|
|
<caption align="bottom">Table 44: Default Catch
|
|
Handlers</caption>
|
|
|
|
<tbody>
|
|
<tr align="left">
|
|
<th><b>Event Type</b> </th>
|
|
<th>Audio Provided</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><b>cancel</b> </td>
|
|
<td>no</td>
|
|
<td>don't reprompt</td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><b>error</b> </td>
|
|
<td>yes</td>
|
|
<td>exit interpreter</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><b>exit</b> </td>
|
|
<td>no</td>
|
|
<td>exit interpreter</td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><b>help</b> </td>
|
|
<td>yes</td>
|
|
<td>reprompt</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><b>noinput</b> </td>
|
|
<td>no</td>
|
|
<td>reprompt</td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td><b>nomatch</b> </td>
|
|
<td>yes</td>
|
|
<td>reprompt</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><b>maxspeechtimeout</b> </td>
|
|
<td>yes</td>
|
|
<td>reprompt</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><b>connection.disconnect</b> </td>
|
|
<td>no</td>
|
|
<td>exit interpreter</td>
|
|
</tr>
|
|
|
|
<tr class="stripe">
|
|
<td>all others</td>
|
|
<td>yes</td>
|
|
<td>exit interpreter</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Specific platforms will differ in the default prompts
|
|
presented.</p>
|
|
|
|
<h3 id="L7036"><a id="dml5.2.6" name="dml5.2.6"
|
|
shape="rect">5.2.6 Event Types</a></h3>
|
|
|
|
<p>There are pre-defined events, and application and
|
|
platform-specific events. Events are also subdivided into plain
|
|
events (things that happen normally), and error events (abnormal
|
|
occurrences). The error naming convention allows for multiple
|
|
levels of granularity.</p>
|
|
|
|
<p>A conforming browser may throw an event that extends a
|
|
pre-defined event string so long as the event contains the
|
|
specified pre-defined event string as a dot-separated exact
|
|
initial substring of its event name. Applications that write
|
|
catch handlers for the pre-defined events will be interoperable.
|
|
Applications that write catch handlers for extended event names
|
|
are not guaranteed interoperability. For example, if in loading a
|
|
grammar file a syntax error is detected the platform must throw
|
|
"error.badfetch". Throwing "error.badfetch.grammar.syntax" is an
|
|
acceptable implementation.</p>
|
|
|
|
<p>Components of event names in italics are to be substituted
|
|
with the relevant information; for example, in
|
|
error.unsupported.<i>element</i>, <i>element</i> is substituted
|
|
with the name of VoiceXML element which is not supported such as
|
|
error.unsupported.transfer. All other event name components are
|
|
fixed.</p>
|
|
|
|
<p>Further information about an event may be specified in the
|
|
"_message" variable (see <a href="#dml5.2.2" shape="rect">Section
|
|
5.2.2</a>).</p>
|
|
|
|
<p>The pre-defined events are:</p>
|
|
|
|
<dl>
|
|
<dt><b>cancel</b></dt>
|
|
|
|
<dd>The user has requested to cancel playing of the current
|
|
prompt.</dd>
|
|
|
|
<dt><b>connection.disconnect.hangup</b></dt>
|
|
|
|
<dd>The user has hung up.</dd>
|
|
|
|
<dt><b>connection.disconnect.transfer</b></dt>
|
|
|
|
<dd>The user has been transferred unconditionally to another line
|
|
and will not return.</dd>
|
|
|
|
<dt><b>exit</b></dt>
|
|
|
|
<dd>The user has asked to exit.</dd>
|
|
|
|
<dt><b>help</b></dt>
|
|
|
|
<dd>The user has asked for help.</dd>
|
|
|
|
<dt><b>noinput</b></dt>
|
|
|
|
<dd>The user has not responded within the timeout interval.</dd>
|
|
|
|
<dt><b>nomatch</b></dt>
|
|
|
|
<dd>The user input something, but it was not recognized.</dd>
|
|
|
|
<dt><b>maxspeechtimeout</b></dt>
|
|
|
|
<dd>The user input was too long exceeding the 'maxspeechtimeout'
|
|
property.</dd>
|
|
</dl>
|
|
|
|
<p>In addition to transfer errors (<a href="#dml2.3.7.3"
|
|
shape="rect">Section 2.3.7.3</a>), the pre-defined errors
|
|
are:</p>
|
|
|
|
<dl>
|
|
<dt><b>error.badfetch</b></dt>
|
|
|
|
<dd>The interpreter context throws this event when a fetch of a
|
|
document has failed <i>and</i> the interpreter context has
|
|
reached a place in the document interpretation where the fetch
|
|
result is required. Fetch failures result from unsupported scheme
|
|
references, malformed URIs, client aborts, communication errors,
|
|
timeouts, security violations, unsupported resource types,
|
|
resource type mismatches, document parse errors, and a variety of
|
|
errors represented by scheme-specific error codes.</dd>
|
|
|
|
<dd>If the interpreter context has speculatively prefetched a
|
|
document and that document turns out not to be needed,
|
|
error.badfetch is not thrown.  Likewise if the fetch of an
|
|
<audio> document fails and if there is a nested alternate
|
|
<audio> document whose fetch then succeeds, or if there is
|
|
nested alternate text, no error.badfetch occurs.</dd>
|
|
|
|
<dd>When an interpreter context is transitioning to a new
|
|
document, the interpreter context throws error.badfetch on an
|
|
error until the interpreter is capable of executing the new
|
|
document, but again only at the point in time where the new
|
|
document is actually needed, not before. Whether or not variable
|
|
initialization is considered part of executing the new document
|
|
is platform-dependent.</dd>
|
|
|
|
<dt><b>error.badfetch.http.<i>response_code</i></b><br
|
|
clear="none" />
|
|
<b>error.badfetch.<i>protocol.response_code</i></b></dt>
|
|
|
|
<dd>In the case of a fetch failure, the interpreter context must
|
|
use a detailed event type telling which specific HTTP or other
|
|
protocol-specific response code was encountered. The value of the
|
|
response code for HTTP is defined in <a href="#ref_RFC2616"
|
|
shape="rect">[RFC2616]</a>. This allows applications to
|
|
differentially treat a missing document from a prohibited
|
|
document, for instance. The value of the response code for other
|
|
protocols (such as HTTPS, RTSP, and so on) is dependent upon the
|
|
protocol.</dd>
|
|
|
|
<dt><b>error.semantic</b></dt>
|
|
|
|
<dd>A run-time error was found in the VoiceXML document, e.g.
|
|
substring bounds error, or an undefined variable was
|
|
referenced.</dd>
|
|
|
|
<dt><b>error.noauthorization</b></dt>
|
|
|
|
<dd>Thrown when the application tries to perform an
|
|
operation that is not authorized by the platform. Examples would
|
|
include dialing an invalid telephone number or one which the user
|
|
is not allowed to call, attempting to access a protected database
|
|
via a platform-specific <object>, inappropriate access to
|
|
builtin grammars, etc.</dd>
|
|
|
|
<dt><b>error.noresource</b></dt>
|
|
|
|
<dd>A run-time error occurred because a requested platform
|
|
resource was not available during execution.</dd>
|
|
|
|
<dt><b>error.unsupported.builtin</b></dt>
|
|
|
|
<dd>The platform does not support a requested builtin
|
|
type/grammar.</dd>
|
|
|
|
<dt><b>error.unsupported.format</b></dt>
|
|
|
|
<dd>The requested resource has a format that is not supported by
|
|
the platform, e.g. an unsupported grammar format, or media
|
|
type.</dd>
|
|
|
|
<dt><b>error.unsupported.language</b></dt>
|
|
|
|
<dd>The platform does not support the language for either speech
|
|
synthesis or speech recognition.</dd>
|
|
|
|
<dt><b>error.unsupported.objectname</b></dt>
|
|
|
|
<dd>The platform does not support a particular platform-specific
|
|
object. Note that 'objectname' is a fixed string and is not
|
|
substituted with the name of the unsupported object.</dd>
|
|
|
|
<dt><b>error.unsupported.<i>element</i></b></dt>
|
|
|
|
<dd>The platform does not support the given <i>element</i>,
|
|
where <i>element</i> is a VoiceXML element defined in this
|
|
specification. For instance, if a platform does not implement
|
|
<transfer>, it must throw error.unsupported.transfer.
|
|
This allows an author to use event handling to adapt to
|
|
different platform capabilities.</dd>
|
|
</dl>
|
|
|
|
<p>Errors encountered during document loading, including
|
|
transport errors (no document found, HTTP status code 404, and so
|
|
on) and syntactic errors (no <vxml> element, etc) result in
|
|
a badfetch error event raised in the calling document. Errors
|
|
that occur after loading and before entering the initialization
|
|
phase of the Form Interpretation Algorithm are handled in a
|
|
platform-specific manner. Errors that occur after entering the
|
|
FIA initialization phase, such as semantic errors, are raised in
|
|
the new document. The handling of errors encountered during the
|
|
loading of the first document in a session is
|
|
platform-specific.</p>
|
|
|
|
<p>Application-specific and platform-specific event types should
|
|
use the reversed Internet domain name convention to avoid naming
|
|
conflicts. For example:</p>
|
|
|
|
<dl>
|
|
<dt><b>error.com.example.voiceplatform.noauth</b></dt>
|
|
|
|
<dd>The user is not authorized to dial out on this platform.</dd>
|
|
|
|
<dt><b>org.example.voice.someapplication.toomanynoinputs</b></dt>
|
|
|
|
<dd>The user is far too quiet.</dd>
|
|
</dl>
|
|
|
|
<p>Catches can catch specific events (cancel) or all those
|
|
sharing a prefix (error.unsupported).</p>
|
|
|
|
<h2 id="L7193"><a id="dml5.3" name="dml5.3" shape="rect">5.3
|
|
Executable Content</a></h2>
|
|
|
|
<p><i>Executable content</i> refers to a block of procedural
|
|
logic. Such logic appears in:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>The <block> form item.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The <filled> actions in forms and input items.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Event handlers (<catch>, <help>, et cetera).</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>Executable elements are executed in document order in their
|
|
block of procedural logic. If an executable element generates an
|
|
error, that error is thrown immediately. Subsequent executable
|
|
elements in that block of procedural logic are not executed.</p>
|
|
|
|
<p>This section covers the elements that can occur in executable
|
|
content.</p>
|
|
|
|
<h3 id="L7212"><a id="dml5.3.1" name="dml5.3.1"
|
|
shape="rect">5.3.1 var element</a></h3>
|
|
|
|
<p>This element declares a variable. It can occur in executable
|
|
content or as a child of <form> or <vxml>.
|
|
Examples:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<var name="phone" expr="'6305551212'"/>
|
|
<var name="y" expr="document.z+1"/>
|
|
</pre>
|
|
|
|
<p>If it occurs in executable content, it declares a variable in
|
|
the anonymous scope associated with the enclosing <block>,
|
|
<filled>, or catch element. This declaration is made only
|
|
when the <var> element is executed. If the variable is
|
|
already declared in this scope, subsequent declarations act as
|
|
assignments, as in ECMAScript.</p>
|
|
|
|
<p>If a <var> is a child of a <form> element, it
|
|
declares a variable in the dialog scope of the <form>. This
|
|
declaration is made during the form's initialization phase
|
|
as described in <a href="#dml2.1.6.1" shape="rect">Section
|
|
2.1.6.1</a>. The <var> element is not a form item, and so
|
|
is not visited by the Form Interpretation Algorithm's main
|
|
loop.</p>
|
|
|
|
<p>If a <var> is a child of a <vxml> element, it
|
|
declares a variable in the document scope; and if it is the
|
|
child of a <vxml> element in a root document then it also
|
|
declares the variable in the application scope. This declaration
|
|
is made when the document is initialized; initializations happen
|
|
in document order.</p>
|
|
|
|
<p>Attributes of <var> include:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 45: var attributes">
|
|
<caption align="bottom">Table 45: <var>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>name</th>
|
|
<td>The name of the variable that will
|
|
hold the result. Unlike the name attribute of <assign>
|
|
element (<a shape="rect" href="#dml5.3.2">Section 5.3.2</a>),
|
|
this attribute must not specify a variable with a scope prefix
|
|
(if a variable is specified with a scope prefix, then an
|
|
error.semantic event is thrown). The scope in which the variable
|
|
is defined is determined from the position in the document at
|
|
which the element is declared.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>The initial value of the variable
|
|
(optional). If there is no expr attribute, the variable retains
|
|
its current value, if any. Variables start out with the
|
|
ECMAScript value undefined if they are not given initial
|
|
values.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L7255"><a id="dml5.3.2" name="dml5.3.2"
|
|
shape="rect">5.3.2 assign element</a></h3>
|
|
|
|
<p>The <assign> element assigns a value to a variable:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<assign name="flavor" expr="'chocolate'"/>
|
|
<assign name="document.mycost" expr="document.mycost+14"/>
|
|
</pre>
|
|
|
|
<p>It is illegal to make an assignment to a variable that has not
|
|
been explicitly declared using a <var> element or a var
|
|
statement within a <script>. Attempting to assign to an
|
|
undeclared variable causes an error.semantic event to be
|
|
thrown.</p>
|
|
|
|
<p>Note that when an ECMAScript object, e.g. "obj", has been
|
|
properly initialized then its properties, for instance
|
|
"obj.prop1", can be assigned without explicit declaration (in
|
|
fact, an attempt to declare ECMAScript object properties such as
|
|
"obj.prop1" would result in an error.semantic event being
|
|
thrown).</p>
|
|
|
|
<p>Attributes include:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 46 assign attributes">
|
|
<caption align="bottom">Table 46: <assign>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>name</th>
|
|
<td>The name of the variable being
|
|
assigned to. As specified in <a shape="rect"
|
|
href="#dml5.1.2">Section 5.1.2</a>, the corresponding variable
|
|
must have been previously declared otherwise an error.semantic
|
|
event is thrown. By default, the scope in which the variable is
|
|
resolved is the closest enclosing scope of the currently active
|
|
element. To remove ambiguity, the variable name may be prefixed
|
|
with a scope name as described in <a shape="rect"
|
|
href="#dml5.1.3">Section 5.1.3</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>The new value of the variable.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L7288"><a id="dml5.3.3" name="dml5.3.3"
|
|
shape="rect">5.3.3 clear element</a></h3>
|
|
|
|
<p>The <clear> element resets one or more variables,
|
|
including form items. For each specified variable name, the
|
|
variable is resolved relative to the current scope according to
|
|
<a href="#dml5.1.3" shape="rect">Section 5.1.3</a> (to remove
|
|
ambiguity, each variable name in the namelist may be prefixed
|
|
with a scope name). Once a declared variable has been identified,
|
|
its value is assigned the ECMAScript undefined value. In
|
|
addition, if the variable name corresponds to a form item, then
|
|
the form item's prompt counter and event counters are
|
|
reset.</p>
|
|
|
|
<p>For example:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<clear namelist="city state zip"/>
|
|
</pre>
|
|
|
|
<p>The attribute is:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 47: clear attributes">
|
|
<caption align="bottom">Table 47: <clear>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>namelist</th>
|
|
<td>The list of variables to be reset;
|
|
this can include variable names other than form items. If an
|
|
undeclared variable is referenced in the namelist, then an
|
|
error.semantic is thrown (<a href="#dml5.1.1"
|
|
shape="rect">Section 5.1.1</a>). When not specified, all
|
|
form items in the current form are cleared.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L7320"><a id="dml5.3.4" name="dml5.3.4"
|
|
shape="rect">5.3.4 if, elseif, else elements</a></h3>
|
|
|
|
<p>The <if> element is used for conditional logic. It has
|
|
optional <else> and <elseif> elements.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<if cond="total > 1000">
|
|
<prompt>This is way too much to spend.</prompt>
|
|
<throw event="com.xyzcorp.acct.toomuchspent"/>
|
|
</if>
|
|
|
|
<if cond="amount &lt; 29.95">
|
|
<assign name="x" expr="amount"/>
|
|
<else/>
|
|
<assign name="x" expr="29.95"/>
|
|
</if>
|
|
|
|
<if cond="flavor == 'vanilla'">
|
|
<assign name="flavor_code" expr="'v'"/>
|
|
<elseif cond="flavor == 'chocolate'"/>
|
|
<assign name="flavor_code" expr="'h'"/>
|
|
<elseif cond="flavor == 'strawberry'"/>
|
|
<assign name="flavor_code" expr="'b'"/>
|
|
<else/>
|
|
<assign name="flavor_code" expr="'?'"/>
|
|
</if>
|
|
</pre>
|
|
|
|
<h3 id="L7327"><a id="dml5.3.5" name="dml5.3.5"
|
|
shape="rect">5.3.5 prompts</a></h3>
|
|
|
|
<p>Prompts can appear in executable content, in their full
|
|
generality, except that the <prompt> count attribute is
|
|
meaningless. In particular, the cond attribute can be used in
|
|
executable content. Prompts may be wrapped with <prompt>
|
|
and </prompt>, or represented using PCDATA. Wherever
|
|
<prompt> is allowed, the PCDATA <i>xyz</i> is interpreted
|
|
exactly as if it had appeared as
|
|
<prompt><i>xyz<</i>/prompt>.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<nomatch count="1">
|
|
To open the pod bay door, say your code phrase clearly.
|
|
</nomatch>
|
|
|
|
<nomatch count="2">
|
|
<prompt>
|
|
This is your <emphasis>last</emphasis> chance.
|
|
</prompt>
|
|
</nomatch>
|
|
|
|
<nomatch count="3">
|
|
Entrance denied.
|
|
<exit/>
|
|
</nomatch>
|
|
</pre>
|
|
|
|
<h3 id="L7340"><a id="dml5.3.6" name="dml5.3.6"
|
|
shape="rect">5.3.6 reprompt element</a></h3>
|
|
|
|
<p>The FIA expects a catch element to queue appropriate prompts
|
|
in the course of handling an event. Therefore, the FIA does not
|
|
generally perform the normal selection and queuing of prompts on
|
|
the next iteration following the execution of a catch element.
|
|
However, the FIA does perform normal selection and queueing of
|
|
prompts after the execution of a catch element (<catch>,
|
|
<error>, <help>, <noinput>, <nomatch>) in
|
|
two cases:</p>
|
|
|
|
<ul>
|
|
<li>if the catch element ends by executing a <goto> or
|
|
<submit> to another dialog, or if it ends with a
|
|
<return> from a subdialog; in this case the new dialog
|
|
needs to be guaranteed that its initial prompt remains intact and
|
|
cannot be suppressed or replaced by a referring dialog; or</li>
|
|
|
|
<li>if a <reprompt> is executed in the catch to request
|
|
that the subsequent prompts be played.</li>
|
|
</ul>
|
|
|
|
<p>In these two cases, after the FIA selects the next form item
|
|
to visit, it performs normal prompt processing, including
|
|
selecting and queuing the form item's prompts and incrementing
|
|
the form item's prompt counter.</p>
|
|
|
|
<p>For example, this noinput catch expects the next form item
|
|
prompt to be selected and played:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<field name="want_ice_cream">
|
|
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
|
|
<prompt>Do you want ice cream for dessert?</prompt>
|
|
<prompt count="2">
|
|
If you want ice cream, say yes.
|
|
If you do not want ice cream, say no.
|
|
</prompt>
|
|
<noinput>
|
|
I could not hear you.
|
|
<!-- Cause the next prompt to be selected and played. -->
|
|
<reprompt/>
|
|
</noinput>
|
|
</field>
|
|
</pre>
|
|
|
|
<p>A quiet user would hear:</p>
|
|
|
|
<blockquote>
|
|
<p>C: Do you want ice cream for dessert?</p>
|
|
|
|
<p>H: <span class="stage">(silence)</span></p>
|
|
|
|
<p>C: I could not hear you.</p>
|
|
|
|
<p>C: If you want ice cream, say yes. If you don't want ice
|
|
cream, say no.</p>
|
|
|
|
<p>H: <span class="stage">(silence)</span></p>
|
|
|
|
<p>C: I could not hear you.</p>
|
|
|
|
<p>C: If you want ice cream, say yes. If you don't want ice
|
|
cream, say no.</p>
|
|
|
|
<p>H: No</p>
|
|
</blockquote>
|
|
|
|
<p>If there were no <reprompt>, the user would instead
|
|
hear:</p>
|
|
|
|
<blockquote>
|
|
<p>C: Do you want ice cream for dessert?</p>
|
|
|
|
<p>H: <span class="stage">(silence)</span></p>
|
|
|
|
<p>C: I could not hear you.</p>
|
|
|
|
<p>H: <span class="stage">(silence)</span></p>
|
|
|
|
<p>C: I could not hear you.</p>
|
|
|
|
<p>H: No</p>
|
|
</blockquote>
|
|
|
|
<p>Note that a consequence of skipping the prompt selection phase
|
|
as described above is that the prompt counter of the form item
|
|
selected by the FIA after the execution of a catch element (that
|
|
does not execute a <reprompt>, or leave the dialog via
|
|
<goto>, <submit> or <return>) will not be
|
|
incremented.</p>
|
|
|
|
<p>Also note that the prompt selection phase following the
|
|
execution of a catch element (that does not execute a
|
|
<reprompt> or leave the dialog via <goto>,
|
|
<submit> or <return>) is skipped even if the form
|
|
item selected by the FIA is different from the previous form
|
|
item.</p>
|
|
|
|
<p>The <reprompt> element has no effect outside of a
|
|
catch.</p>
|
|
|
|
<h3 id="L7410"><a id="dml5.3.7" name="dml5.3.7"
|
|
shape="rect">5.3.7 goto element</a></h3>
|
|
|
|
<p>The <goto> element is used to:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>transition to another form item in the current form,</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>transition to another dialog in the current document, or</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>transition to another document.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>To transition to another form item, use the nextitem
|
|
attribute, or the expritem attribute if the form item name is
|
|
computed using an ECMAScript expression:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<goto nextitem="ssn_confirm"/>
|
|
<goto expritem="(type==12)? 'ssn_confirm' : 'reject'"/>
|
|
</pre>
|
|
|
|
<p>To go to another dialog in the same document, use next (or
|
|
expr) with only a URI fragment:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<goto next="#another_dialog"/>
|
|
<goto expr="'#' + 'another_dialog'"/>
|
|
</pre>
|
|
|
|
<p>To transition to another document, use next (or expr) with a
|
|
URI:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<goto next="http://flight.example.com/reserve_seat"/>
|
|
<goto next="./special_lunch#wants_vegan"/>
|
|
</pre>
|
|
|
|
<p>The URI may be absolute or relative to the current document.
|
|
You may specify the starting dialog in the next document using a
|
|
fragment that corresponds to the value of the id attribute of a
|
|
dialog. If no fragment is specified, the first dialog in that
|
|
document is chosen.</p>
|
|
|
|
<p>Note that transitioning to another dialog in the current
|
|
document causes the old dialog's variables to be lost, even
|
|
in the case where a dialog is transitioning to itself.
|
|
Transitioning to another document using an absolute or relative
|
|
URI will likewise drop the old document level variables, even if
|
|
the new document is the same one that is making the transition.
|
|
However, document variables are retained when transitioning to an
|
|
empty URI reference with a fragment identifier. For example, the
|
|
following statements behave differently in a document with the
|
|
URI http://someco.example.com/index.vxml:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<goto next="#foo"/>
|
|
|
|
<goto next="http://someco.example.com/index.vxml#foo"/>
|
|
</pre>
|
|
|
|
<p>According to <a href="#ref_RFC2396"
|
|
shape="rect">[RFC2396]</a>, the fragment identifier (the part
|
|
after the '#') is not part of a URI and transitioning to empty
|
|
URI references plus fragment identifiers should never result in a
|
|
new document fetch. Therefore "#foo" in the first statement is an
|
|
empty URI reference with a fragment identifier and document
|
|
variables are retained. In the second statement "#foo" is part of
|
|
an absolute URI and the document variables are lost. If you want
|
|
data to persist across multiple documents, store data in the
|
|
application scope.</p>
|
|
|
|
<p>The dialog to transition to is specified by the URI reference
|
|
in the <goto>'s next or expr attribute (see <a
|
|
href="#ref_RFC2396" shape="rect">[RFC2396]</a>). If this URI
|
|
reference contains an absolute or relative URI, which may
|
|
include a query string, then that URI is fetched and the dialog
|
|
is found in the resulting document.</p>
|
|
|
|
<p>If the URI reference contains only a fragment (i.e., no
|
|
absolute or relative URI), then there is no fetch: the dialog is
|
|
found in the current document.</p>
|
|
|
|
<p>The URI reference's fragment, if any, names the dialog to
|
|
transition to. When there is no fragment, the dialog chosen is
|
|
the lexically first dialog in the document.</p>
|
|
|
|
<p>If the form item, dialog or document to transition to is not
|
|
valid (i.e. the form item, dialog or document does not exist),
|
|
an error.badfetch must be thrown. Note that for errors which occur
|
|
during a dialog or document transition, the scope in which errors
|
|
are handled is platform specific. For errors which occur
|
|
during form item transition, the event is handled in the dialog
|
|
scope.</p>
|
|
|
|
<p>Attributes of <goto> are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 48: goto attributes">
|
|
<caption align="bottom">Table 48: <goto>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>next</th>
|
|
<td>The URI to which to transition.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>An ECMAScript expression that yields
|
|
the URI.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>nextitem</th>
|
|
<td>The name of the next form item to
|
|
visit in the current form.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expritem</th>
|
|
<td>An ECMAScript expression that yields
|
|
the name of the next form item to visit.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchaudio</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchaudio
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchhint</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
documentfetchhint property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchtimeout</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchtimeout
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxage</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the documentmaxage
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxstale</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
documentmaxstale property.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Exactly one of "next", "expr", "nextitem" or "expritem" must
|
|
be specified; otherwise, an error.badfetch event is thrown.</p>
|
|
|
|
<h3 id="L7544"><a id="dml5.3.8" name="dml5.3.8"
|
|
shape="rect">5.3.8 submit element</a></h3>
|
|
|
|
<p>The <submit> element is used to submit information to
|
|
the origin Web server and then transition to the document sent
|
|
back in the response. Unlike <goto>, it lets you submit a
|
|
list of variables to the document server via an HTTP GET or POST
|
|
request. For example, to submit a set of form items to the server
|
|
you might have:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<submit next="log_request" method="post"
|
|
namelist="name rank serial_number"
|
|
fetchtimeout="100s" fetchaudio="audio/brahms2.wav"/>
|
|
</pre>
|
|
|
|
<p>The dialog to transition to is specified by the URI reference
|
|
in the <submit>'s next or expr attribute (see <a
|
|
href="#ref_RFC2396" shape="rect">[RFC2396]</a>, Section 4.2). The
|
|
URI is always fetched even if it contains just a fragment. In the
|
|
case of a fragment, the URI requested is the base URI of the
|
|
current document. This means that the following two elements have
|
|
substantially different effects:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<goto next="#get_pin"/>
|
|
|
|
<submit next="#get_pin"/>
|
|
</pre>
|
|
|
|
<p>Note that although the URI is always fetched and the resulting
|
|
document is transitioned to, some <submit> requests can be
|
|
satisfied by intermediate caches. This might happen, for example,
|
|
if the origin Web server provides an explicit expiration time with
|
|
the response.</p>
|
|
|
|
<p>If the dialog or document to transition to is not valid (i.e.
|
|
the dialog or document does not exist), an error.badfetch must be
|
|
thrown. Note that for errors which occur during a dialog or
|
|
document transition, the scope in which errors are handled is
|
|
platform specific.</p>
|
|
|
|
<p>Attributes of <submit> include:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 49: submit attributes">
|
|
<caption align="bottom">Table 49: <submit>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>next</th>
|
|
<td>The URI reference.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>Like next, except that the URI
|
|
reference is dynamically determined by evaluating the given
|
|
ECMAScript expression.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>namelist</th>
|
|
<td>The list of variables to submit. By
|
|
default, all the named input item variables are submitted. If a
|
|
namelist is supplied, it may contain individual variable
|
|
references which are submitted with the same qualification used
|
|
in the namelist. Declared VoiceXML and ECMAScript variables can
|
|
be referenced. If an undeclared variable is referenced in the
|
|
namelist, then an error.semantic is thrown (<a
|
|
href="#dml5.1.1" shape="rect">Section 5.1.1</a>).</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>method</th>
|
|
<td>The request method: get (the default)
|
|
or post.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>enctype</th>
|
|
<td>The media encoding type of the
|
|
submitted document (when the value of method is "post"). The
|
|
default is application/x-www-form-urlencoded. Interpreters must
|
|
also support multipart/form-data and may support additional
|
|
encoding types.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchaudio</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchaudio
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchhint</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
documentfetchhint property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchtimeout</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchtimeout
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxage</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the documentmaxage
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxstale</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
documentmaxstale property.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Exactly one of "next" or "expr" must be specified; otherwise,
|
|
an error.badfetch event is thrown.</p>
|
|
|
|
<p>When an ECMAScript variable is submitted to the server its
|
|
value is first converted into a string before being submitted. If
|
|
the variable is an ECMAScript Object the mechanism by which it is
|
|
submitted is not currently defined. The mechanism of ECMAScript
|
|
Object submission is reserved for future definition. Instead of
|
|
submitting ECMAScript Objects directly, the application developer
|
|
may explicitly submit properties of Object as in "date.month
|
|
date.year".</p>
|
|
|
|
<p>If a <submit> contains a variable which references
|
|
recorded audio but does not contain an ENCTYPE of
|
|
multipart/form-data, the behavior is not specified. It is
|
|
probably inappropriate to attempt to URL-encode large quantities
|
|
of data.</p>
|
|
|
|
<h3 id="L7652"><a id="dml5.3.9" name="dml5.3.9"
|
|
shape="rect">5.3.9 exit element</a></h3>
|
|
|
|
<p>Returns control to the interpreter context which determines
|
|
what to do next.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<exit/>
|
|
</pre>
|
|
|
|
<p>This element differs from <return> in that it terminates
|
|
all loaded documents, while <return> returns from a
|
|
<subdialog> invocation. If the <subdialog> caused a
|
|
new document (or application) to be invoked, then <return>
|
|
will cause that document to be terminated, but execution will
|
|
resume after the <subdialog>.</p>
|
|
|
|
<p>Note that once <exit> returns control to the interpreter
|
|
context, the interpreter context is free to do as it wishes. It
|
|
may play a top level menu for the user, drop the call, or
|
|
transfer the user to an operator, for example.</p>
|
|
|
|
<p>Attributes include:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 50: exit attributes">
|
|
<caption align="bottom">Table 50: <exit>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>An ECMAScript expression that is
|
|
evaluated as the return value (e.g. "0", "'oops!'", or
|
|
"field1").</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>namelist</th>
|
|
<td>Variable names to be returned to
|
|
interpreter context. The default is to return no variables; this
|
|
means the interpreter context will receive an empty ECMAScript
|
|
object. If an undeclared variable is referenced in the namelist,
|
|
then an error.semantic is thrown (<a href="#dml5.1.1"
|
|
shape="rect">Section 5.1.1</a>).</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Exactly one of "expr" or "namelist" may be specified;
|
|
otherwise, an error.badfetch event is thrown.</p>
|
|
|
|
<p>The <exit> element does not throw an "exit" event.</p>
|
|
|
|
<h3 id="L7691"><a id="dml5.3.10" name="dml5.3.10"
|
|
shape="rect">5.3.10 return element</a></h3>
|
|
|
|
<p>Return ends execution of a subdialog and returns control and
|
|
data to a calling dialog.</p>
|
|
|
|
<p>The attributes are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 51: return attributes">
|
|
<caption align="bottom">Table 51: <return>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>event</th>
|
|
<td>Return, then throw this event.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>eventexpr</th>
|
|
<td>Return, then throw the event to which
|
|
this ECMAScript expression evaluates.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>message</th>
|
|
<td>A message string providing additional
|
|
context about the event being thrown. The message is available as
|
|
the value of a variable within the scope of the catch element,
|
|
see <a href="#dml5.2.2" shape="rect">Section 5.2.2</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>messageexpr</th>
|
|
<td>An ECMAScript expression evaluating
|
|
to the message string.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>namelist</th>
|
|
<td>Variable names to be returned to
|
|
calling dialog. The default is to return no variables; this means
|
|
the caller will receive an empty ECMAScript object. If an
|
|
undeclared variable is referenced in the namelist, then an
|
|
error.semantic is thrown (<a href="#dml5.1.1"
|
|
shape="rect">Section 5.1.1</a>).</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Exactly one of "event", "eventexpr" or "namelist" may be
|
|
specified; otherwise, an error.badfetch event is thrown. Exactly
|
|
one of "message" or "messageexpr" may be specified; otherwise, an
|
|
error.badfetch event is thrown.</p>
|
|
|
|
<p>In returning from a subdialog, an event can be thrown at the
|
|
invocation point, or data is returned as an ECMAScript object
|
|
with properties corresponding to the variable specified in its
|
|
namelist. A return element that is encountered when not executing
|
|
as a subdialog throws a semantic error.</p>
|
|
|
|
<p>The example below shows an event propagated from a subdialog
|
|
to its calling dialog when the subdialog fails to obtain a
|
|
recognizable result. It also shows data returned under normal
|
|
conditions.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<vxml version="2.0" 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">
|
|
<form>
|
|
<subdialog name="result" src="#getssn">
|
|
<nomatch>
|
|
<!-- a no match event that is returned by the
|
|
subdialog indicates that a valid Social Securityy
|
|
number could not be matched. -->
|
|
<goto next="http://myservice.example.com/ssn-problems.vxml"/>
|
|
</nomatch>
|
|
|
|
<filled>
|
|
<submit namelist="result.ssn"
|
|
next="http://myservice.example.com/cgi-bin/process"/>
|
|
</filled>
|
|
</subdialog>
|
|
</form>
|
|
<form id="getssn">
|
|
<field name="ssn">
|
|
<grammar src="http://grammarlib/ssn.grxml"
|
|
type="application/srgs+xml"/>
|
|
<prompt> Please say Social Securityy number.</prompt>
|
|
<nomatch count="3">
|
|
<return event="nomatch"/>
|
|
</nomatch>
|
|
<filled>
|
|
<return namelist="ssn"/>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>The subdialog event handler for <nomatch> is triggered
|
|
on the third failure to match; when triggered, it returns from
|
|
the subdialog, and includes the nomatch event to be thrown in the
|
|
context of the calling dialog. In this case, the calling dialog
|
|
will execute its <nomatch> handler, rather than the
|
|
<filled> element, where the resulting action is to execute
|
|
a <goto> element. Under normal conditions, the
|
|
<filled> element of the subdialog is executed after a
|
|
recognized Social Securityy number is obtained, and then this
|
|
value is returned to the calling dialog, and is accessible as
|
|
result.ssn.</p>
|
|
|
|
<h3 id="L7732"><a id="dml5.3.11" name="dml5.3.11"
|
|
shape="rect">5.3.11 disconnect element</a></h3>
|
|
|
|
<p>Causes the interpreter context to disconnect from the user. As
|
|
a result, the interpreter context will throw a
|
|
connection.disconnect.hangup event and enter the final processing
|
|
state (as described in <a shape="rect"
|
|
href="#dml1.5.4">Section 1.5.4</a>). Processing the
|
|
<disconnect> element will also flush the prompt queue (as
|
|
described in <a shape="rect" href="#dml4.1.8">Section
|
|
4.1.8</a>).</p>
|
|
|
|
<h3 id="L7741"><a id="dml5.3.12" name="dml5.3.12"
|
|
shape="rect">5.3.12 script element</a></h3>
|
|
|
|
<p>The <script> element allows the specification of a block
|
|
of client-side scripting language code, and is analogous to the
|
|
<a href="#ref_HTML" shape="rect">[HTML]</a> <SCRIPT>
|
|
element. For example, this document has a script that computes a
|
|
factorial.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<script> <![CDATA[
|
|
function factorial(n)
|
|
{
|
|
return (n <= 1)? 1 : n * factorial(n-1);
|
|
}
|
|
]]> </script>
|
|
|
|
<form id="form">
|
|
<field name="fact">
|
|
<grammar type="application/srgs+xml" src="/grammars/number.grxml"/>
|
|
<prompt>
|
|
Tell me a number and I'll tell you its factorial.
|
|
</prompt>
|
|
<filled>
|
|
<prompt>
|
|
<value expr="fact"/> factorial is
|
|
<value expr="factorial(fact)"/>
|
|
</prompt>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>A <script> element may occur in the <vxml> and
|
|
<form> elements, or in executable content (in
|
|
<filled>, <if>, <block>, <catch>, or the
|
|
short forms of <catch>). Scripts in the <vxml>
|
|
element are evaluated just after the document is loaded, along
|
|
with the <var> elements, in document order. Scripts in the
|
|
<form> element are evaluated in document order, along with
|
|
<var> elements and form item variables, each time execution
|
|
moves into the <form> element. A <script> element in
|
|
executable content is executed, like other executable elements,
|
|
as it is encountered.</p>
|
|
|
|
<p>The <script> element has the following attributes:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 52: script attributes">
|
|
<caption align="bottom">Table 52: <script>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>src</th>
|
|
<td>The URI specifying the location of
|
|
the script, if it is external.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>charset</th>
|
|
<td>The character encoding of the script
|
|
designated by src. UTF-8 and UTF-16 encodings of ISO/IEC 10646
|
|
must be supported (as in <a href="#ref_XML"
|
|
shape="rect">[XML]</a>) and other encodings, as defined in the <a
|
|
href="#ref_IANA" shape="rect">[IANA]</a>, may be supported. The
|
|
default value is UTF-8.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchhint</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the
|
|
scriptfetchhint property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchtimeout</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the fetchtimeout
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxage</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the scriptmaxage
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxstale</th>
|
|
<td>See <a href="#dml6.1"
|
|
shape="rect">Section 6.1</a>. This defaults to the scriptmaxstale
|
|
property.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Either an "src" attribute or an inline script (but not both)
|
|
must be specified; otherwise, an error.badfetch event is
|
|
thrown.</p>
|
|
|
|
<p>The VoiceXML <script> element (unlike the <a
|
|
href="#ref_HTML" shape="rect">[HTML]</a> <SCRIPT> element)
|
|
does not have a type attribute; ECMAScript is the required
|
|
scripting language for VoiceXML.</p>
|
|
|
|
<p>Each <script> element is executed in the scope of its
|
|
containing element; i.e., it does not have its own scope. This
|
|
means for example that variables declared with var in the
|
|
<script> element are declared in the scope of the
|
|
containing element of the <script> element. (In ECMAScript
|
|
terminology, the "variable object" becomes the current scope of
|
|
the containing element of the <script> element).</p>
|
|
|
|
<p>Here is a time-telling service with a block containing a
|
|
script that initializes time variables in the dialog scope of a
|
|
form:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form>
|
|
<var name="hours"/>
|
|
<var name="minutes"/>
|
|
<var name="seconds"/>
|
|
<block>
|
|
<script>
|
|
var d = new Date();
|
|
hours = d.getHours();
|
|
minutes = d.getMinutes();
|
|
seconds = d.getSeconds();
|
|
</script>
|
|
</block>
|
|
<field name="hear_another">
|
|
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
|
|
<prompt>
|
|
The time is <value expr="hours"/> hours,
|
|
<value expr="minutes"/> minutes, and
|
|
<value expr="seconds"/> seconds.
|
|
</prompt>
|
|
<prompt>Do you want to hear another time?</prompt>
|
|
<filled>
|
|
<if cond="hear_another">
|
|
<clear/>
|
|
</if>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>The content of a <script> element is evaluated in the
|
|
same scope as a <var> element (see <a href="#dml5.1.2"
|
|
shape="rect">5.1.2 Variable Scopes</a> and <a href="#dml5.3.1"
|
|
shape="rect">5.3.1 VAR</a>).</p>
|
|
|
|
<p>The ECMAScript scope chain (see section 10.1.4 in <a
|
|
href="#ref_ECMASCRIPT" shape="rect">[ECMASCRIPT]</a>) is set up
|
|
so that variables declared either with <var> or inside
|
|
<script> are put into the scope associated with the element
|
|
in which the <var> or <script> element occurs. For
|
|
example, the variable declared in a <script> element under
|
|
a <form> element has a dialog scope, and can be accessed as
|
|
a dialog scope variable as follows:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form>
|
|
<script>
|
|
var now = new Date(); <!-- this has a dialog scope-->
|
|
</script>
|
|
<var name="seconds" expr="now.getSeconds()"/> <!-- this has a dialog scope-->
|
|
<block>
|
|
<var name="now" expr="new Date()"/> <!-- this has an anonymous scope -->
|
|
<script>
|
|
var current = now.getSeconds(); <!-- "now" in the anonymous scope -->
|
|
var approx = dialog.now.getSeconds(); <!-- "now" in the dialog scope -->
|
|
</script>
|
|
</block>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>All variables must be declared before being referenced by
|
|
ECMAScript scripts, or by VoiceXML elements as described in <a
|
|
href="#dml5.1.1" shape="rect">Section 5.1.1</a>.</p>
|
|
|
|
<h3 id="L7845"><a id="dml5.3.13" name="dml5.3.13"
|
|
shape="rect">5.3.13 log element</a></h3>
|
|
|
|
<p>The <log> element allows an application to generate a
|
|
logging or debug message which a developer can use to help in
|
|
application development or post-execution analysis of application
|
|
performance.</p>
|
|
|
|
<p>The <log> element may contain any combination of text
|
|
(CDATA) and <value> elements. The generated message
|
|
consists of the concatenation of the text and the string form of
|
|
the value of the "expr" attribute of the <value>
|
|
elements.</p>
|
|
|
|
<p>The manner in which the message is displayed or logged is
|
|
platform-dependent. The usage of label is platform-dependent.
|
|
Platforms are not required to preserve white space.</p>
|
|
|
|
<p>ECMAScript expressions in <log> must be evaluated in
|
|
document order. The use of the <log> element should have no
|
|
other side-effects on interpretation.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<log>The card number was <value expr="card_num"/></log>
|
|
</pre>
|
|
|
|
<p>The <log> element has the following attributes:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 53: log attributes">
|
|
<caption align="bottom">Table 53: <log>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>label</th>
|
|
<td>An optional string which
|
|
may be used, for example, to indicate the purpose of the
|
|
log.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>expr</th>
|
|
<td>An optional ECMAScript expression
|
|
evaluating to a string.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<!--- CHAPTER 5: END =-->
|
|
<!--- CHAPTER 6: BEGIN =-->
|
|
<h1 id="L7892"><a id="dml6" name="dml6" shape="rect">6.
|
|
Environment and Resources</a></h1>
|
|
|
|
<h2 id="L7895"><a id="dml6.1" name="dml6.1" shape="rect">6.1
|
|
Resource Fetching</a></h2>
|
|
|
|
<h3 id="L7898"><a id="dml6.1.1" name="dml6.1.1"
|
|
shape="rect">6.1.1 Fetching</a></h3>
|
|
|
|
<p>A VoiceXML interpreter context needs to fetch VoiceXML
|
|
documents, and other resources, such as audio files, grammars,
|
|
scripts, and objects. Each fetch of the content associated with a
|
|
URI is governed by the following attributes:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 54: fetch attributes">
|
|
<caption align="bottom">Table 54: Fetch Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>fetchtimeout</th>
|
|
<td>The interval to wait for the content
|
|
to be returned before throwing an error.badfetch event. The
|
|
value is a Time Designation (see <a href="#dml6.5"
|
|
shape="rect">Section 6.5</a>). If not specified, a value
|
|
derived from the innermost fetchtimeout property is used.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>fetchhint</th>
|
|
<td>Defines when the interpreter context
|
|
should retrieve content from the server. prefetch indicates a
|
|
file may be downloaded when the page is loaded, whereas safe
|
|
indicates a file that should only be downloaded when actually
|
|
needed. If not specified, a value derived from the innermost
|
|
relevant fetchhint property is used.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxage</th>
|
|
<td>Indicates that the document is
|
|
willing to use content whose age is no greater than the specified
|
|
time in seconds (cf. 'max-age' in HTTP 1.1 <a
|
|
href="#ref_RFC2616" shape="rect">[RFC2616]</a>). The document is
|
|
not willing to use stale content, unless maxstale is also provided.
|
|
If not specified, a value derived from the innermost relevant
|
|
maxage property, if present, is used.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxstale</th>
|
|
<td>Indicates that the document is
|
|
willing to use content that has exceeded its expiration time
|
|
(cf. 'max-stale' in HTTP 1.1 <a href="#ref_RFC2616"
|
|
shape="rect">[RFC2616]</a>). If maxstale is assigned a value,
|
|
then the document is willing to accept content that has
|
|
exceeded its expiration time by no more than the specified number
|
|
of seconds. If not specified, a value derived from the innermost
|
|
relevant maxstale property, if present, is used.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>When content is fetched from a URI, the fetchtimeout attribute
|
|
determines how long to wait for the content (starting from the
|
|
time when the resource is needed), and the fetchhint attribute
|
|
determines when the content is fetched. The caching policy for a
|
|
VoiceXML interpreter context utilizes the maxage and maxstale
|
|
attributes and is explained in more detail below.</p>
|
|
|
|
<p>The fetchhint attribute, in combination with the various
|
|
fetchhint properties, is merely a hint to the interpreter context
|
|
about when it may schedule the fetch of a resource.  Telling
|
|
the interpreter context that it may prefetch a resource does not
|
|
require that the resource be prefetched; it only suggests that
|
|
the resource <i>may</i> be prefetched. However, the interpreter
|
|
context is always required to honor the safe fetchhint.</p>
|
|
|
|
<p>When transitioning from one dialog to another, through either
|
|
a <subdialog>, <goto>, <submit>, <link>,
|
|
or <choice> element, there are additional rules that affect
|
|
interpreter behavior. If the referenced URI names a document
|
|
(e.g. "doc#dialog"), or if query data is provided (through POST
|
|
or GET), then a new document is obtained (either from a local
|
|
cache, intermediate cache, or from a origin Web server). When it
|
|
is obtained, the document goes through its initialization phase
|
|
(i.e., obtaining and initializing a new application root
|
|
document if needed, initializing document variables, and
|
|
executing document scripts). The requested dialog (or first
|
|
dialog if none is specified) is then initialized and execution
|
|
of the dialog begins.</p>
|
|
|
|
<p>Generally, if a URI reference contains only a fragment (e.g.,
|
|
"#my_dialog"), then no document is fetched, and no initialization
|
|
of that document is performed. However, <submit> always
|
|
results in a fetch, and if a fragment is accompanied by a
|
|
namelist attribute there will also be a fetch.</p>
|
|
|
|
<p>Another exception is when a URI reference in a leaf document
|
|
references the application root document. In this case, the root
|
|
document is transitioned to without fetching and without
|
|
initialization even if the URI reference contains an absolute or
|
|
relative URI (see <a href="#dml1.5.2" shape="rect">Section
|
|
1.5.2</a> and <a href="#ref_RFC2396" shape="rect">[RFC2396]</a>).
|
|
However, if the URI reference to the root document contains a
|
|
query string or a namelist attribute, the root document is
|
|
fetched.</p>
|
|
|
|
<p>Elements that fetch VoiceXML documents also support the
|
|
following additional attribute:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 55: fetch additional attribute">
|
|
<caption align="bottom">Table 55: Additional Fetch
|
|
Attribute</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th width="109">fetchaudio</th>
|
|
<td width="649">The URI of the audio clip
|
|
to play while the fetch is being done. If not specified, the
|
|
fetchaudio property is used, and if that property is not set, no
|
|
audio is played during the fetch. The fetching of the audio clip
|
|
is governed by the audiofetchhint, audiomaxage, audiomaxstale,
|
|
and fetchtimeout properties in effect at the time of the fetch.
|
|
The playing of the audio clip is governed by the fetchaudiodelay,
|
|
and fetchaudiominimum properties in effect at the time of the
|
|
fetch.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>The fetchaudio attribute is useful for enhancing a user
|
|
experience when there may be noticeable delays while the next
|
|
document is retrieved. This can be used to play background music,
|
|
or a series of announcements. When the document is retrieved, the
|
|
audio file is interrupted if it is still playing. If an error
|
|
occurs retrieving fetchaudio from its URI, no badfetch event is
|
|
thrown and no audio is played during the fetch.</p>
|
|
|
|
<h3 id="L7971"><a id="dml6.1.2" name="dml6.1.2"
|
|
shape="rect">6.1.2 Caching</a></h3>
|
|
|
|
<p>The VoiceXML interpreter context, like <a href="#ref_HTML"
|
|
shape="rect">[HTML]</a> visual browsers, can use caching to
|
|
improve performance in fetching documents and other resources;
|
|
audio recordings (which can be quite large) are as common to
|
|
VoiceXML documents as images are to HTML pages. In a visual
|
|
browser it is common to include end user controls to update or
|
|
refresh content that is perceived to be stale. This is not the
|
|
case for the VoiceXML interpreter context, since it lacks
|
|
equivalent end user controls. Thus enforcement of cache refresh
|
|
is at the discretion of the document through appropriate use of
|
|
the maxage, and maxstale attributes.</p>
|
|
|
|
<p>The caching policy used by the VoiceXML interpreter context
|
|
must adhere to the cache correctness rules of HTTP 1.1 (<a
|
|
href="#ref_RFC2616" shape="rect">[RFC2616]</a>). In particular,
|
|
the Expires and Cache-Control headers must be honored. The
|
|
following algorithm summarizes these rules and represents the
|
|
interpreter context behavior when requesting a resource:</p>
|
|
|
|
<ul>
|
|
<li>If the resource is not present in the cache, fetch it from
|
|
the server using get.</li>
|
|
|
|
<li>If the resource is in the cache,
|
|
|
|
<ul>
|
|
<li>If a maxage value is provided,
|
|
|
|
<ul>
|
|
<li>If age of the cached resource <= maxage,
|
|
|
|
<ul>
|
|
<li>If the resource has expired,
|
|
|
|
<ul>
|
|
<li>Perform maxstale check.</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li>Otherwise, use the cached copy.</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li>Otherwise, fetch it from the server using get.</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li>Otherwise,
|
|
|
|
<ul>
|
|
<li>If the resource has expired,
|
|
|
|
<ul>
|
|
<li>Perform maxstale check.</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li>Otherwise, use the cached copy.</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>The "maxstale check" is:</p>
|
|
|
|
<ul>
|
|
<li>If maxstale is provided,
|
|
|
|
<ul>
|
|
<li>If cached copy has exceeded its expiration time by no more
|
|
than maxstale seconds, then use the cached copy.</li>
|
|
|
|
<li>Otherwise, fetch it from the server using get.</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li>Otherwise, fetch it from the server using get.</li>
|
|
</ul>
|
|
|
|
<p>Note: it is an optimization to perform a "get if modified" on
|
|
a document still present in the cache when the policy requires a
|
|
fetch from the server.</p>
|
|
|
|
<p>The maxage and maxstale properties are allowed to have no
|
|
default value whatsoever. If the value is not provided by the
|
|
document author, and the platform does not provide a default
|
|
value, then the value is undefined and the 'Otherwise' clause of
|
|
the algorithm applies. All other properties must provide a
|
|
default value (either as given by the specification or by the
|
|
platform).</p>
|
|
|
|
<p>While the maxage and maxstale attributes are drawn from and
|
|
directly supported by HTTP 1.1, some resources may be addressed
|
|
by URIs that name protocols other than HTTP. If the protocol does
|
|
not support the notion of resource age, the interpreter context
|
|
shall compute a resource's age from the time it was received. If
|
|
the protocol does not support the notion of resource staleness,
|
|
the interpreter context shall consider the resource to have
|
|
expired immediately upon receipt.</p>
|
|
|
|
<h4 id="L8044"><a id="dml6.1.2.1" name="dml6.1.2.1"
|
|
shape="rect">6.1.2.1 Controlling the Caching Policy</a></h4>
|
|
|
|
<p>VoiceXML allows the author to override the default caching
|
|
behavior for each use of each resource (except for any document
|
|
referenced by the <vxml> element's application attribute:
|
|
there is no markup mechanism to control the caching policy for
|
|
an application root document).</p>
|
|
|
|
<p>Each resource-related element may specify maxage and maxstale
|
|
attributes. Setting maxage to a non-zero value can be used to get
|
|
a fresh copy of a resource that may not have yet expired in the
|
|
cache. A fresh copy can be unconditionally requested by setting
|
|
maxage to zero.</p>
|
|
|
|
<p>Using maxstale enables the author to state that an expired
|
|
copy of a resource, that is not too stale (according to the rules
|
|
of HTTP 1.1), may be used. This can improve performance by
|
|
eliminating a fetch that would otherwise be required to get a
|
|
fresh copy. It is especially useful for authors who may not have
|
|
direct server-side control of the expiration dates of large
|
|
static files.</p>
|
|
|
|
<h3 id="L8052"><a id="dml6.1.3" name="dml6.1.3"
|
|
shape="rect">6.1.3 Prefetching</a></h3>
|
|
|
|
<p>Prefetching is an optional feature that an interpreter context
|
|
may implement to obtain a resource before it is needed. A
|
|
resource that may be prefetched is identified by an element whose
|
|
fetchhint attribute equals "prefetch". When an interpreter
|
|
context does prefetch a resource, it must ensure that the
|
|
resource fetched is precisely the one needed. In particular, if
|
|
the URI is computed with an expr attribute, the interpreter
|
|
context must not move the fetch up before any assignments to the
|
|
expression's variables. Likewise, the fetch for a <submit>
|
|
must not be moved prior to any assignments of the namelist
|
|
variables.</p>
|
|
|
|
<p>The expiration status of a resource must be checked on each
|
|
use of the resource, and, if its fetchhint attribute is
|
|
"prefetch", then it is prefetched. The check must follow the
|
|
caching policy specified in Section 6.1.2.</p>
|
|
|
|
<h3 id="L8059"><a id="dml6.1.4" name="dml6.1.4"
|
|
shape="rect">6.1.4 Protocols</a></h3>
|
|
|
|
<p>The "http" URI scheme must be supported by VoiceXML
|
|
platforms, the "https" protocol should be supported and other URI
|
|
protocols may be supported.</p>
|
|
|
|
<h2 id="L8064"><a id="dml6.2" name="dml6.2" shape="rect">6.2
|
|
Metadata Information</a></h2>
|
|
|
|
<p>Metadata information is information about the document rather
|
|
than the document's content. VoiceXML 2.0 provides two elements
|
|
in which metadata information can be expressed: <meta> and
|
|
<metadata>. The <metadata> element provides more
|
|
general and powerful treatment of metadata information than
|
|
<meta>.</p>
|
|
|
|
<p>VoiceXML does not specify required metadata information.
|
|
However, it does recommend that metadata is expressed using
|
|
the <metadata> element with information in Resource
|
|
Description Framework (RDF) <a href="#ref_RDF-SYNTAX"
|
|
shape="rect">[RDF-SYNTAX]</a> using the Dublin Core version 1.0
|
|
RDF schema <a href="#ref_DC" shape="rect">[DC]</a> (see <a
|
|
href="#dml6.2.2" shape="rect">Section 6.2.2</a>).</p>
|
|
|
|
<h3 id="L80641"><a id="dml6.2.1" name="dml6.2.1"
|
|
shape="rect">6.2.1 meta element</a></h3>
|
|
|
|
<p>The <meta> element specifies meta information as in <a
|
|
href="#ref_HTML" shape="rect">[HTML]</a>. There are two types of
|
|
<meta>.</p>
|
|
|
|
<p>The first type specifies a metadata property of the document
|
|
as a whole and is expressed by the pair of attributes, name
|
|
and content. For example to specify the maintainer of a
|
|
VoiceXML document:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<meta name="maintainer" content="jpdoe@anycompany.example.com"/>
|
|
<form>
|
|
<block>
|
|
<prompt>Hello</prompt>
|
|
</block>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>The second type of <meta> specifies HTTP response
|
|
headers and is expressed by the pair of attributes
|
|
http-equiv and content. In the following example, the
|
|
first <meta> element sets an expiration date that prevents
|
|
caching of the document; the second <meta> element sets the
|
|
Date header.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<meta http-equiv="Expires" content="0"/>
|
|
<meta http-equiv="Date" content="Thu, 12 Dec 2000 23:27:21 GMT"/>
|
|
<form>
|
|
<block>
|
|
<prompt>Hello</prompt>
|
|
</block>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>Attributes of <meta> are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 56: meta attributes">
|
|
<caption align="bottom">Table 56: <meta>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th width="121">name</th>
|
|
<td width="637">The name of the metadata
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="121">content</th>
|
|
<td width="637">The value of the metadata
|
|
property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="121">http-equiv</th>
|
|
<td width="637">The name of an HTTP
|
|
response header.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Exactly one of "name" or "http-equiv" must be specified;
|
|
otherwise, an error.badfetch event is thrown.</p>
|
|
|
|
<h3 id="L806412"><a id="dml6.2.2" name="dml6.2.2"
|
|
shape="rect">6.2.2 metadata element</a></h3>
|
|
|
|
<p>The <metadata> element is container in which information
|
|
about the document can be placed using a metadata schema.
|
|
Although any metadata schema can be used with <metadata>,
|
|
it is recommended that the RDF schema is used in conjunction with
|
|
metadata properties defined in the Dublin Core Metadata
|
|
Initiative.</p>
|
|
|
|
<p>RDF is a declarative language and provides a standard way for
|
|
using XML to represent metadata in the form of statements about
|
|
properties and relationships of items on the Web. Content
|
|
creators should refer to W3C metadata Recommendations <a
|
|
href="#ref_RDF-SYNTAX" shape="rect">[RDF-SYNTAX]</a> and <a
|
|
href="#ref_RDF-SCHEMA" shape="rect">[RDF-SCHEMA]</a> as well as
|
|
the Dublin Core Metadata Initiative <a href="#ref_DC"
|
|
shape="rect">[DC]</a>, which is a set of generally applicable
|
|
core metadata properties (e.g., Title, Creator, Subject,
|
|
Description, Copyrights, etc.).</p>
|
|
|
|
<p>The following Dublin Core metadata properties are recommended
|
|
in <metadata>:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 57: recommended metadata properties">
|
|
<caption align="bottom">Table 57: Recommended Dublin Core
|
|
Metadata Properties</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th width="120">Creator</th>
|
|
<td width="638">An entity primarily
|
|
responsible for making the content of the resource.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="120">Rights</th>
|
|
<td width="638">Information about rights
|
|
held in and over the resource.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="120">Subject</th>
|
|
<td width="638">The topic of the content
|
|
of the resource. Typically, a subject will be expressed as
|
|
keywords, key phrases or classification codes. Recommended best
|
|
practice is to select values from a controlled vocabulary or
|
|
formal classification scheme.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Here is an example of how <metadata> can be included in
|
|
a VoiceXML document using the Dublin Core version 1.0 RDF schema
|
|
<a href="#ref_DC" shape="rect">[DC]</a>:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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>
|
|
</pre>
|
|
|
|
<h2 id="L8168"><a id="dml6.3" name="dml6.3" shape="rect">6.3
|
|
property element</a></h2>
|
|
|
|
<p>The <property> element sets a property value. Properties
|
|
are used to set values that affect platform behavior, such as the
|
|
recognition process, timeouts, caching policy, etc.</p>
|
|
|
|
<p>Properties may be defined for the whole application, for the
|
|
whole document at the <vxml> level, for a particular dialog
|
|
at the <form> or <menu> level, or for a particular
|
|
form item. Properties apply to their parent element and all the
|
|
descendants of the parent. A property at a lower level overrides
|
|
a property at a higher level. When different values for a property
|
|
are specified at the same level, the last one in document order
|
|
applies. Properties specified in the application root document
|
|
provide default values for properties in every document in the
|
|
application; properties specified in an individual document
|
|
override property values specified in the application root
|
|
document.</p>
|
|
|
|
<p>If a platform detects that the value of a property is invalid,
|
|
then it should throw an error.semantic.</p>
|
|
|
|
<p>In some cases, <property> elements specify default
|
|
values for element attributes, such as timeout or bargein. For
|
|
example, to turn off bargein by default for all the prompts in a
|
|
particular form:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<vxml version="2.0" 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">
|
|
<form id="no_bargein_form">
|
|
<property name="bargein" value="false"/>
|
|
<block>
|
|
<prompt>
|
|
This introductory prompt cannot be barged into.
|
|
</prompt>
|
|
<prompt>
|
|
And neither can this prompt.
|
|
</prompt>
|
|
<prompt bargein="true">
|
|
But this one <emphasis>can</emphasis> be barged into.
|
|
</prompt>
|
|
</block>
|
|
<field type="boolean">
|
|
<prompt>
|
|
Please say yes or no.
|
|
</prompt>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>The <property> element has the following attributes:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 58: property attributes">
|
|
<caption align="bottom">Table 58: <property>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>name</th>
|
|
<td>The name of the property.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>value</th>
|
|
<td>The value of the property.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L8179"><a id="dml6.3.1" name="dml6.3.1"
|
|
shape="rect">6.3.1 Platform-Specific Properties</a></h3>
|
|
|
|
<p>An interpreter context is free to provide platform-specific
|
|
properties. For example, to set the "multiplication factor"
|
|
for this platform in the scope of this document:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<form>
|
|
<property name="com.example.multiplication_factor" value="42"/>
|
|
<block>
|
|
<prompt> Welcome </prompt>
|
|
</block>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>By definition, platform-specific properties introduce
|
|
incompatibilities which reduce application portability.
|
|
To minimize them, the following interpreter context
|
|
guidelines are strongly recommended:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>Platform-specific properties should use reverse domain names
|
|
to eliminate potential collisions as in: com.example.<i>foo</i>,
|
|
which is clearly different from net.example.<i>foo</i></p>
|
|
</li>
|
|
</ul>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>An interpreter context must <i>not</i> throw an
|
|
error.unsupported.property event when encountering a property it
|
|
cannot process; rather the interpreter context must
|
|
just ignore that property.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<h3 id="L8199"><a id="dml6.3.2" name="dml6.3.2"
|
|
shape="rect">6.3.2 Generic Speech Recognizer Properties</a></h3>
|
|
|
|
<p>The generic speech recognizer properties mostly are taken from
|
|
the Java Speech API <a href="#ref_JSAPI"
|
|
shape="rect">[JSAPI]</a>:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 59: Generic Speech Recognizer Properties">
|
|
<caption align="bottom">Table 59: Generic Speech Recognizer
|
|
Properties</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>confidencelevel</th>
|
|
<td>The speech recognition confidence
|
|
level, a float value in the range of 0.0 to 1.0. Results are
|
|
rejected (a nomatch event is thrown) when
|
|
application.lastresult$.confidence is below this threshold.
|
|
A value of 0.0 means minimum confidence is needed for a
|
|
recognition, and a value of 1.0 requires maximum confidence.
|
|
The value is a Real Number Designation (see <a
|
|
href="#dml6.5" shape="rect">Section 6.5</a>). The default
|
|
value is 0.5.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>sensitivity</th>
|
|
<td>Set the sensitivity level. A value of
|
|
1.0 means that it is highly sensitive to quiet input. A value of
|
|
0.0 means it is least sensitive to noise. The value is a
|
|
Real Number Designation (see <a href="#dml6.5"
|
|
shape="rect">Section 6.5</a>). The default value is
|
|
0.5.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>speedvsaccuracy</th>
|
|
<td>A hint specifying the desired balance
|
|
between speed vs. accuracy. A value of 0.0 means fastest
|
|
recognition. A value of 1.0 means best accuracy. The value
|
|
is a Real Number Designation (see <a href="#dml6.5"
|
|
shape="rect">Section 6.5</a>). The default is value
|
|
0.5.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>completetimeout</th>
|
|
<td>
|
|
<p>The length of silence required following user speech before
|
|
the speech recognizer finalizes a result (either accepting it or
|
|
throwing a nomatch event). The complete timeout is used when the
|
|
speech is a complete match of an active grammar. By contrast, the
|
|
incomplete timeout is used when the speech is an incomplete match
|
|
to an active grammar.</p>
|
|
|
|
<p>A long complete timeout value delays the result completion and
|
|
therefore makes the computer's response slow. A short complete
|
|
timeout may lead to an utterance being broken up inappropriately.
|
|
Reasonable complete timeout values are typically in the range of
|
|
0.3 seconds to 1.0 seconds. The value is a Time Designation
|
|
(see <a href="#dml6.5" shape="rect">Section 6.5</a>). The
|
|
default is platform-dependent. See <a href="#dmlATiming"
|
|
shape="rect">Appendix D</a>.</p>
|
|
|
|
<p>Although platforms must parse the completetimeout property,
|
|
platforms are not required to support the behavior of
|
|
completetimeout. Platforms choosing not to support the behavior
|
|
of completetimeout must so document and adjust the behavior of
|
|
the <i>incompletetimeout</i> property as described below.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>incompletetimeout</th>
|
|
<td>
|
|
<p>The required length of silence following user speech after
|
|
which a recognizer finalizes a result. The incomplete timeout
|
|
applies when the speech prior to the silence is an incomplete
|
|
match of all active grammars.  In this case, once the
|
|
timeout is triggered, the partial result is rejected (with a
|
|
nomatch event).</p>
|
|
|
|
<p>The incomplete timeout also applies when the speech prior to
|
|
the silence is a complete match of an active grammar, but where
|
|
it is possible to speak further and still match the grammar. By
|
|
contrast, the complete timeout is used when the speech is a
|
|
complete match to an active grammar and no further words can be
|
|
spoken.</p>
|
|
|
|
<p>A long incomplete timeout value delays the result completion
|
|
and therefore makes the computer's response slow. A short
|
|
incomplete timeout may lead to an utterance being broken up
|
|
inappropriately.</p>
|
|
|
|
<p>The incomplete timeout is usually longer than the complete
|
|
timeout to allow users to pause mid-utterance (for example, to
|
|
breathe). See <a href="#dmlATiming" shape="rect">Appendix
|
|
D.</a></p>
|
|
|
|
<p>Platforms choosing not to support the <i>completetimeout</i>
|
|
property (described above) must use the maximum of the
|
|
completetimeout and incompletetimeout values as the value for the
|
|
incompletetimeout.</p>
|
|
|
|
<p>The value is a Time Designation (see <a href="#dml6.5"
|
|
shape="rect">Section 6.5</a>).</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>maxspeechtimeout</th>
|
|
<td>
|
|
<p>The maximum duration of user speech. If this time elapsed
|
|
before the user stops speaking, the event "maxspeechtimeout" is
|
|
thrown. The value is a Time Designation (see <a
|
|
href="#dml6.5" shape="rect">Section 6.5</a>). The default
|
|
duration is platform-dependent.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L8276"><a id="dml6.3.3" name="dml6.3.3"
|
|
shape="rect">6.3.3 Generic DTMF Recognizer Properties</a></h3>
|
|
|
|
<p>Several generic properties pertain to DTMF grammar
|
|
recognition:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 60: Generic DTMF Recognizer Properties">
|
|
<caption align="bottom">Table 60: Generic DTMF Recognizer
|
|
Properties</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th width="140">interdigittimeout</th>
|
|
<td width="618">The inter-digit timeout
|
|
value to use when recognizing DTMF input. The value is a Time
|
|
Designation (see <a href="#dml6.5" shape="rect">Section
|
|
6.5</a>). The default is platform-dependent. See <a
|
|
href="#dmlATiming" shape="rect">Appendix D</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="140">termtimeout</th>
|
|
<td width="618">The terminating timeout
|
|
to use when recognizing DTMF input. The value is a Time
|
|
Designation (see <a href="#dml6.5" shape="rect">Section
|
|
6.5</a>). The default value is "0s". <a href="#dmlATiming"
|
|
shape="rect">Appendix D</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="140">termchar</th>
|
|
<td width="618">The terminating DTMF
|
|
character for DTMF input recognition. The default value is "#".
|
|
See <a href="#dmlATiming" shape="rect">Appendix D</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L8321"><a id="dml6.3.4" name="dml6.3.4"
|
|
shape="rect">6.3.4 Prompt and Collect Properties</a></h3>
|
|
|
|
<p>These properties apply to the fundamental platform prompt and
|
|
collect cycle:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 61: Prompt and Collect Properties">
|
|
<caption align="bottom">Table 61: Prompt and Collect
|
|
Properties</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th width="140">bargein</th>
|
|
<td width="618">The bargein attribute to
|
|
use for prompts. Setting this to true allows bargein by default.
|
|
Setting it to false disallows bargein. The default value is
|
|
"true".</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="140">bargeintype</th>
|
|
<td width="618">Sets the type of bargein
|
|
to be speech or hotword. Default is platform-specific. See <a
|
|
href="#dml4.1.5.1" shape="rect">Section 4.1.5.1</a>.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="140">timeout</th>
|
|
<td width="618">The time after which a
|
|
noinput event is thrown by the platform. The value is a
|
|
Time Designation (see <a href="#dml6.5" shape="rect">Section
|
|
6.5</a>). The default value is platform-dependent. See <a
|
|
href="#dmlATiming" shape="rect">Appendix D</a>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L8363"><a id="dml6.3.5" name="dml6.3.5"
|
|
shape="rect">6.3.5 Fetching Properties</a></h3>
|
|
|
|
<p>These properties pertain to the fetching of new documents and
|
|
resources (note that maxage and maxstale properties may have no
|
|
default value - see <a href="#dml6.1.2"
|
|
shape="rect">Section 6.1.2</a>):</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 62: Fetching Properties">
|
|
<caption align="bottom">Table 62: Fetching Properties</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th width="151">audiofetchhint</th>
|
|
<td width="607">This tells the platform
|
|
whether or not it can attempt to optimize dialog interpretation
|
|
by pre-fetching audio. The value is either safe to say that audio
|
|
is only fetched when it is needed, never before; or prefetch to
|
|
permit, but not require the platform to pre-fetch the audio. The
|
|
default value is prefetch.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">audiomaxage</th>
|
|
<td width="607">Tells the platform the
|
|
maximum acceptable age, in seconds, of cached audio resources.
|
|
The default is platform-specific.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">audiomaxstale</th>
|
|
<td width="607">Tells the platform the
|
|
maximum acceptable staleness, in seconds, of expired cached audio
|
|
resources. The default is platform-specific.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">documentfetchhint</th>
|
|
<td width="607">Tells the platform
|
|
whether or not documents may be pre-fetched. The value is either
|
|
safe (the default), or prefetch.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">documentmaxage</th>
|
|
<td width="607">Tells the platform the
|
|
maximum acceptable age, in seconds, of cached documents. The
|
|
default is platform-specific.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">documentmaxstale</th>
|
|
<td width="607">Tells the platform the
|
|
maximum acceptable staleness, in seconds, of expired cached
|
|
documents. The default is platform-specific.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">grammarfetchhint</th>
|
|
<td width="607">Tells the platform
|
|
whether or not grammars may be pre-fetched. The value is either
|
|
prefetch (the default), or safe.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">grammarmaxage</th>
|
|
<td width="607">Tells the platform the
|
|
maximum acceptable age, in seconds, of cached grammars. The
|
|
default is platform-specific.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">grammarmaxstale</th>
|
|
<td width="607">Tells the platform the
|
|
maximum acceptable staleness, in seconds, of expired cached
|
|
grammars. The default is platform-specific.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">objectfetchhint</th>
|
|
<td width="607">Tells the platform
|
|
whether the URI contents for <object> may be pre-fetched or
|
|
not. The values are prefetch (the default), or safe.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">objectmaxage</th>
|
|
<td width="607">Tells the platform the
|
|
maximum acceptable age, in seconds, of cached objects. The
|
|
default is platform-specific.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">objectmaxstale</th>
|
|
<td width="607">Tells the platform the
|
|
maximum acceptable staleness, in seconds, of expired cached
|
|
objects. The default is platform-specific.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">scriptfetchhint</th>
|
|
<td width="607">Tells whether scripts may
|
|
be pre-fetched or not. The values are prefetch (the default), or
|
|
safe.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">scriptmaxage</th>
|
|
<td width="607">Tells the platform the
|
|
maximum acceptable age, in seconds, of cached scripts. The
|
|
default is platform-specific.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">scriptmaxstale</th>
|
|
<td width="607">Tells the platform the
|
|
maximum acceptable staleness, in seconds, of expired cached
|
|
scripts. The default is platform-specific.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">fetchaudio</th>
|
|
<td width="607">The URI of the audio to
|
|
play while waiting for a document to be fetched. The default is
|
|
not to play any audio during fetch delays. There are no
|
|
fetchaudio properties for audio, grammars, objects, and scripts.
|
|
The fetching of the audio clip is governed by the audiofetchhint,
|
|
audiomaxage, audiomaxstale, and fetchtimeout properties in effect
|
|
at the time of the fetch. The playing of the audio clip is
|
|
governed by the fetchaudiodelay, and fetchaudiominimum properties
|
|
in effect at the time of the fetch.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">
|
|
<p>fetchaudiodelay</p>
|
|
</th>
|
|
<td width="607">
|
|
<p>The time interval to wait at the start of a fetch delay before
|
|
playing the fetchaudio source. The value is a Time
|
|
Designation (see <a href="#dml6.5" shape="rect">Section
|
|
6.5</a>). The default interval is platform-dependent, e.g.
|
|
"2s".  The idea is that when a fetch delay is short, it may
|
|
be better to have a few seconds of silence instead of a bit of
|
|
fetchaudio that is immediately cut off.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">
|
|
<p>fetchaudiominimum</p>
|
|
</th>
|
|
<td width="607">
|
|
<p>The minimum time interval to play a fetchaudio source, once
|
|
started, even if the fetch result arrives in the meantime.
|
|
The value is a Time Designation (see <a href="#dml6.5"
|
|
shape="rect">Section 6.5</a>). The default is
|
|
platform-dependent, e.g., "5s".  The idea is that once the
|
|
user does begin to hear fetchaudio, it should not be stopped too
|
|
quickly.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="151">fetchtimeout</th>
|
|
<td width="607">The timeout for fetches.
|
|
The value is a Time Designation (see <a href="#dml6.5"
|
|
shape="rect">Section 6.5</a>). The default value is
|
|
platform-dependent.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3 id="L8511"><a id="dml6.3.6" name="dml6.3.6"
|
|
shape="rect">6.3.6 Miscellaneous Properties</a></h3>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 63: Miscellaneous Properties">
|
|
<caption align="bottom">Table 63: Miscellaneous
|
|
Properties</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th width="109">inputmodes</th>
|
|
<td width="649">This property determines
|
|
which input modality to use. The input modes to enable: dtmf and
|
|
voice. On platforms that support both modes, inputmodes defaults
|
|
to "dtmf voice". To disable speech recognition, set inputmodes to
|
|
"dtmf". To disable DTMF, set it to "voice". One use for this
|
|
would be to turn off speech recognition in noisy environments.
|
|
Another would be to conserve speech recognition resources by
|
|
turning them off where the input is always expected to be DTMF.
|
|
This property does not control the activation of grammars. For
|
|
instance, voice-only grammars may be active when the inputmode is
|
|
restricted to DTMF. Those grammars would not be matched, however,
|
|
because the voice input modality is not active.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="109">
|
|
<p>universals</p>
|
|
</th>
|
|
<td width="649">
|
|
<p>Platforms may optionally provide platform-specific universal
|
|
command grammars, such as "help", "cancel", or "exit" grammars,
|
|
that are always active (except in the case of modal input
|
|
items - see <a href="#dml3.1.4" shape="rect">Section 3.1.4</a>)
|
|
and which generate specific events.</p>
|
|
|
|
<p>Production-grade applications often need to define their own
|
|
universal command grammars, e.g., to increase application
|
|
portability or to provide a distinctive interface. They specify
|
|
new universal command grammars with <link> elements. They
|
|
turn off the default grammars with this property. Default catch
|
|
handlers are not affected by this property.</p>
|
|
|
|
<p>The value "none" is the default, and means that all platform
|
|
default universal command grammars are disabled. The value "all"
|
|
turns them all on. Individual grammars are enabled by listing
|
|
their names separated by spaces; for example, "cancel exit
|
|
help".</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="109">
|
|
<p>maxnbest</p>
|
|
</th>
|
|
<td width="649">
|
|
<p>This property controls the maximum size of the
|
|
"application.lastresult$" array; the array is constrained to be
|
|
no larger than the value specified by 'maxnbest'. This property
|
|
has a minimum value of 1. The default value is 1.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Our last example shows several of these properties used at
|
|
multiple levels.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<vxml version="2.0" 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">
|
|
<!-- set default characteristics for page -->
|
|
<property name="audiofetchhint" value="safe"/>
|
|
<property name="confidencelevel" value="0.75"/>
|
|
|
|
<form>
|
|
<!-- override defaults for this form only -->
|
|
<property name="confidencelevel" value="0.5"/>
|
|
<property name="bargein" value="false"/>
|
|
<grammar src="address_book.grxml" type="application/srgs+xml"/>
|
|
<block>
|
|
<prompt> Welcome to the Voice Address Book </prompt>
|
|
</block>
|
|
<initial name="start">
|
|
<!-- override default timeout value -->
|
|
<property name="timeout" value="5s"/>
|
|
<prompt> Who would you like to call? </prompt>
|
|
</initial>
|
|
<field name="person">
|
|
<prompt>
|
|
Say the name of the person you would like to call.
|
|
</prompt>
|
|
</field>
|
|
<field name="location">
|
|
<prompt>
|
|
Say the location of the person you would like to call.
|
|
</prompt>
|
|
</field>
|
|
<field name="confirm">
|
|
<grammar type="application/srgs+xml" src="/grammars/boolean.grxml"/>
|
|
<!-- Use actual utterances to playback recognized words,
|
|
rather than returned slot values -->
|
|
<prompt>
|
|
You said to call <value expr="person$.utterance"/>
|
|
at <value expr="location$.utterance"/>.
|
|
Is this correct?
|
|
</prompt>
|
|
<filled>
|
|
<if cond="confirm">
|
|
<submit namelist="person location"
|
|
next="http://www.messagecentral.example.com/voice/make_call" />
|
|
</if>
|
|
<clear/>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<h2 id="L8551"><a id="dml6.4" name="dml6.4" shape="rect">6.4
|
|
param element</a></h2>
|
|
|
|
<p>The <param> element is used to specify values that are
|
|
passed to subdialogs or objects. It is modeled on the <a
|
|
href="#ref_HTML" shape="rect">[HTML]</a> <PARAM> element.
|
|
Its attributes are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 64: param attributes">
|
|
<caption align="bottom">Table 64: <param>
|
|
Attributes</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th width="99">name</th>
|
|
<td width="659">The name to be associated
|
|
with this parameter when the object or subdialog is invoked.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="99">expr</th>
|
|
<td width="659">An expression that
|
|
computes the value associated with name.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="99">value</th>
|
|
<td width="659">Associates a literal
|
|
string value with name.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="99">valuetype</th>
|
|
<td width="659">One of data or ref, by
|
|
default data; used to indicate to an object if the value
|
|
associated with name is data or a URI (ref). This is not used for
|
|
<subdialog> since values are always data.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th width="99">type</th>
|
|
<td width="659">The media type of the
|
|
result provided by a URI if the valuetype is ref; only relevant
|
|
for uses of <param> in <object>.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Exactly one of "expr" or "value" must be specified; otherwise,
|
|
an error.badfetch event is thrown.</p>
|
|
|
|
<p>The use of valuetype and type is optional in general, although
|
|
they may be required by specific objects. When <param> is
|
|
contained in a <subdialog> element, the values specified by
|
|
it are used to initialize dialog <var> elements in the
|
|
subdialog that is invoked. See <a href="#dml2.3.4"
|
|
shape="rect">Section 2.3.4</a> for details regarding
|
|
initialization of variables in subdialogs using
|
|
<param>. When <param> is contained in an
|
|
<object>, the use of the parameter data is specific to the
|
|
object that is being invoked, and is outside the scope of the
|
|
VoiceXML specification.</p>
|
|
|
|
<p>Below is an example of <param> used as part of an
|
|
<object>. In this case, the first two <param>
|
|
elements have expressions (implicitly of valuetype="data"), the
|
|
third <param> has an explicit value, and the fourth is a
|
|
URI that returns a media type of text/plain. The meaning of this
|
|
data is specific to the object.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<object name="debit"
|
|
classid="method://credit-card/gather_and_debit"
|
|
data="http://www.recordings.example.com/prompts/credit/jesse.jar">
|
|
<param name="amount" expr="document.amt"/>
|
|
<param name="vendor" expr="vendor_num"/>
|
|
<param name="application_id" value="ADC5678-QWOO"/>
|
|
<param name="authentication_server"
|
|
value="http://auth-svr.example.com"
|
|
valuetype="ref"
|
|
type="text/plain"/>
|
|
</object>
|
|
</pre>
|
|
|
|
<p>The next example illustrates <param> used with
|
|
<subdialog>. In this case, two expressions are used to
|
|
initialize variables in the scope of the subdialog form.</p>
|
|
|
|
<h5 id="Form1">Form with calling dialog</h5>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<vxml version="2.0" 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">
|
|
<form>
|
|
<subdialog name="result" src="http://another.example.com/#getssn">
|
|
<param name="firstname" expr="document.first"/>
|
|
<param name="lastname" expr="document.last"/>
|
|
<filled>
|
|
<submit namelist="result.ssn"
|
|
next="http://myservice.example.com/cgi-bin/process"/>
|
|
</filled>
|
|
</subdialog>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<h5 id="Subdialog1">Subdialog in http://another.example.com</h5>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
|
|
<vxml version="2.0" 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">
|
|
<form id="getssn">
|
|
<var name="firstname"/>
|
|
<var name="lastname"/>
|
|
<field name="ssn">
|
|
<grammar src="http://grammarlib/ssn.grxml"
|
|
type="application/srgs+xml"/>
|
|
<prompt>
|
|
Please say Social Securityy number.
|
|
</prompt>
|
|
<filled>
|
|
<if cond="validssn(firstname,lastname,ssn)">
|
|
<assign name="status" expr="true"/>
|
|
<return namelist="status ssn"/>
|
|
<else/>
|
|
<assign name="status" expr="false"/>
|
|
<return namelist="status"/>
|
|
</if>
|
|
</filled>
|
|
</field>
|
|
</form>
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>Using <param> in a <subdialog> is a convenient way
|
|
of passing data to a subdialog without requiring the use of
|
|
server side scripting.</p>
|
|
|
|
<h2 id="L8619"><a id="dml6.5" name="dml6.5" shape="rect">6.5
|
|
Value Designations</a></h2>
|
|
|
|
<p>Several VoiceXML parameter values follow the conventions used
|
|
in the W3C's Cascading Style Sheet Recommendation <a
|
|
href="#ref_CSS2" shape="rect">[CSS2]</a>.</p>
|
|
|
|
<div>
|
|
<h3 id="L86191"><a id="dml6.5.1" name="dml6.5.1"
|
|
shape="rect">6.5.1 Integers and Real Numbers</a></h3>
|
|
</div>
|
|
|
|
<p>Real numbers and integers are specified in decimal notation
|
|
only. An integer consists of one or more digits "0" to "9". A
|
|
real number may be an integer, or it may be zero or more digits
|
|
followed by a dot (.) followed by one or more digits. Both
|
|
integers and real numbers may be preceded by a "-" or "+" to
|
|
indicate the sign.</p>
|
|
|
|
<div>
|
|
<h3 id="L86192"><a id="dml6.5.2" name="dml6.5.2"
|
|
shape="rect">6.5.2 Times</a></h3>
|
|
</div>
|
|
|
|
<p>Time designations consist of a non-negative real number
|
|
followed by a time unit identifier. The time unit identifiers
|
|
are:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p><strong>ms</strong>: milliseconds</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p><strong>s</strong>: seconds</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>Examples include: "3s", "850ms", "0.7s", ".5s"
|
|
and "+1.5s".</p>
|
|
|
|
<!--- CHAPTER 6: END =-->
|
|
<!--- APPENDICES: BEGIN =-->
|
|
<h1 id="Appendices"><a id="dml7" name="dml7"
|
|
shape="rect">Appendices</a></h1>
|
|
|
|
<h2 id="Appendix"><a id="dmlATerms" name="dmlATerms"
|
|
shape="rect">Appendix A — Glossary of Terms</a></h2>
|
|
|
|
<dl>
|
|
<dt><br />
|
|
<b>active grammar</b></dt>
|
|
|
|
<dd>A speech or DTMF grammar that is currently active. This is
|
|
based on the currently executing element, and the scope elements
|
|
of the currently defined grammars.</dd>
|
|
|
|
<dt><br />
|
|
<b>application</b></dt>
|
|
|
|
<dd>A collection of <i>VoiceXML documents</i> that are tagged
|
|
with the same application name attribute.</dd>
|
|
|
|
<dt><br />
|
|
<b>ASR</b></dt>
|
|
|
|
<dd>Automatic speech recognition.</dd>
|
|
|
|
<dt><br />
|
|
<b>author</b></dt>
|
|
|
|
<dd>The creator of a <i>VoiceXML document.</i></dd>
|
|
|
|
<dt><br />
|
|
<b>catch element</b></dt>
|
|
|
|
<dd>A <catch> block or one of its abbreviated forms.
|
|
Certain default catch elements are defined by the <i>VoiceXML
|
|
interpreter</i>.</dd>
|
|
|
|
<dt><br />
|
|
<b>control item</b></dt>
|
|
|
|
<dd>A <i>form item</i> whose purpose is either to contain a block
|
|
of procedural logics (<block>) or to allow initial prompts
|
|
for a mixed initiative dialog (<initial>).</dd>
|
|
|
|
<dt><br />
|
|
<b>CSS W3C Cascading Style Sheet specification</b>.</dt>
|
|
|
|
<dd>See <a href="#ref_CSS2" shape="rect">[CSS2]</a></dd>
|
|
|
|
<dt><br />
|
|
<b>dialog</b></dt>
|
|
|
|
<dd>An interaction with the user specified in a <i>VoiceXML
|
|
document</i>. Types of dialogs include <i>forms</i> and
|
|
<i>menus</i>.</dd>
|
|
|
|
<dt><br />
|
|
<b>DTMF</b> (Dual Tone Multi-Frequency)</dt>
|
|
|
|
<dd>Touch-tone or push-button dialing. Pushing a button on a
|
|
telephone keypad generates a sound that is a combination of two
|
|
tones, one high frequency and the other low frequency.</dd>
|
|
|
|
<dt><br />
|
|
<b>ECMAScript</b></dt>
|
|
|
|
<dd>A standard version of JavaScript backed by the European
|
|
Computer Manufacturer's Association. See <a
|
|
href="#ref_ECMASCRIPT" shape="rect">[ECMASCRIPT]</a></dd>
|
|
|
|
<dt><br />
|
|
<b>event</b></dt>
|
|
|
|
<dd>A notification "thrown" by the <i>implementation
|
|
platform</i>, <i>VoiceXML interpreter context</i>, <i>VoiceXML
|
|
interpreter</i>, or VoiceXML code. Events include exceptional
|
|
conditions (semantic errors), normal errors (user did not say
|
|
something recognizable), normal events (user wants to exit), and
|
|
user defined events.</dd>
|
|
|
|
<dt><br />
|
|
<b>executable content</b></dt>
|
|
|
|
<dd>Procedural logic that occurs in <block>,
|
|
<filled>, and <i>event handlers</i>.</dd>
|
|
|
|
<dt><br />
|
|
<b>form</b></dt>
|
|
|
|
<dd>A <i>dialog</i> that interacts with the <i>user</i> in a
|
|
highly flexible fashion with the computer and the <i>user</i>
|
|
sharing the initiative.</dd>
|
|
|
|
<dt><br />
|
|
<b>FIA</b> (Form Interpretation Algorithm)</dt>
|
|
|
|
<dd>An algorithm implemented in a <i>VoiceXML interpreter</i>
|
|
which drives the interaction between the user and a VoiceXML form
|
|
or menu. See <a href="#dml2.1.6" shape="rect">Section 2.1.6</a>
|
|
and <a href="#dmlAFIA" shape="rect">Appendix C</a>.</dd>
|
|
|
|
<dt><br />
|
|
<b>form item</b></dt>
|
|
|
|
<dd>An element of <form> that can be visited during form
|
|
execution: <initial>, <block>, <field>,
|
|
<record>, <object>, <subdialog>, and
|
|
<transfer>.</dd>
|
|
|
|
<dt><br />
|
|
<b>form item variable</b></dt>
|
|
|
|
<dd>A variable, either implicitly or explicitly defined,
|
|
associated with each <i>form item</i> in a <i>form</i>. If the
|
|
form item variable is undefined, the form interpretation
|
|
algorithm will visit the form item and use it to interact with
|
|
the user.</dd>
|
|
|
|
<dt><br />
|
|
<b>implementation platform</b></dt>
|
|
|
|
<dd>A computer with the requisite software and/or hardware to
|
|
support the types of interaction defined by VoiceXML.</dd>
|
|
|
|
<dt><br />
|
|
<b>input item</b></dt>
|
|
|
|
<dd>A <i>form item</i> whose purpose is to input a input item
|
|
variable. Input items include <field>, <record>,
|
|
<object>, <subdialog>, and <transfer>.</dd>
|
|
|
|
<dt><br />
|
|
<a id="term-language" name="term-language"
|
|
shape="rect"><b>language identifier</b></a></dt>
|
|
|
|
<dd>A language identifier labels information content as being of
|
|
a particular human language variant. Following the XML
|
|
specification for language identification <a href="#ref_XML"
|
|
shape="rect">[XML]</a>, a legal language identifier is identified
|
|
by an RFC 3066 <a href="#ref_RFC3066" shape="rect">[RFC3066]</a>
|
|
code. A language code is required by RFC 3066. A country code or
|
|
other subtag identifier is optional by RFC 3066.</dd>
|
|
|
|
<dt><br />
|
|
<b>link</b></dt>
|
|
|
|
<dd>A set of grammars that when matched by something the
|
|
<i>user</i> says or keys in, either transitions to a new dialog
|
|
or document or throws an event in the current form item.</dd>
|
|
|
|
<dt><br />
|
|
<b>menu</b></dt>
|
|
|
|
<dd>A <i>dialog</i> presenting the <i>user</i> with a set of
|
|
choices and takes action on the selected one.</dd>
|
|
|
|
<dt><br />
|
|
<b>mixed initiative</b></dt>
|
|
|
|
<dd>A computer-human interaction in which either the computer or
|
|
the human can take initiative and decide what to do next.</dd>
|
|
|
|
<dt><br />
|
|
<b>JSGF</b></dt>
|
|
|
|
<dd>Java API Speech Grammar Format. A proposed standard for
|
|
representing speech grammars. See <a href="#ref_JSGF"
|
|
shape="rect">[JSGF]</a></dd>
|
|
|
|
<dt><br />
|
|
<b>object</b></dt>
|
|
|
|
<dd>A platform-specific capability with an interface available
|
|
via VoiceXML.</dd>
|
|
|
|
<dt><br />
|
|
<b>request</b></dt>
|
|
|
|
<dd>A collection of data including: a URI specifying a document
|
|
server for the data, a set of name-value pairs of data to be
|
|
processed (optional), and a method of submission for processing
|
|
(optional).</dd>
|
|
|
|
<dt><br />
|
|
<b>script</b></dt>
|
|
|
|
<dd>A fragment of logic written in a client-side scripting
|
|
language, especially <i>ECMAScript</i>, which is a scripting
|
|
language that must be supported by any <i>VoiceXML
|
|
interpreter</i>.</dd>
|
|
|
|
<dt><br />
|
|
<b>session</b></dt>
|
|
|
|
<dd>A connection between a <i>user</i> and an <i>implementation
|
|
platform</i>, e.g. a telephone call to a voice response system.
|
|
One session may involve the interpretation of more than one
|
|
<i>VoiceXML document</i>.</dd>
|
|
|
|
<dt><br />
|
|
<b>SRGS</b> (Speech Recognition Grammar Specification)</dt>
|
|
|
|
<dd>A standard format for context-free speech recognition
|
|
grammars being developed by the W3C Voice Browser group. Both
|
|
ABNF and XML formats are defined <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a>.</dd>
|
|
|
|
<dt><br />
|
|
<b>SSML</b> (Speech Synthesis Markup Language)</dt>
|
|
|
|
<dd>A standard format for speech synthesis being developed by the
|
|
W3C Voice Browser group <a href="#ref_SSML"
|
|
shape="rect">[SSML]</a>.</dd>
|
|
|
|
<dt><br />
|
|
<b>subdialog</b></dt>
|
|
|
|
<dd>A VoiceXML dialog (or document) invoked from the current
|
|
<i>dialog</i> in a manner analogous to function calls.</dd>
|
|
|
|
<dt><br />
|
|
<b>tapered prompts</b></dt>
|
|
|
|
<dd>A set of prompts used to vary a message given to the human.
|
|
Prompts may be tapered to be more terse with use (field
|
|
prompting), or more explicit (help prompts).</dd>
|
|
|
|
<dt><br />
|
|
<b>throw</b></dt>
|
|
|
|
<dd>An element that fires an <i>event</i>.</dd>
|
|
|
|
<dt><br />
|
|
<b>TTS</b></dt>
|
|
|
|
<dd>text-to-speech; speech synthesis.</dd>
|
|
|
|
<dt><br />
|
|
<b>user</b></dt>
|
|
|
|
<dd>A person whose interaction with an <i>implementation
|
|
platform</i> is controlled by a <i>VoiceXML interpreter</i>.</dd>
|
|
|
|
<dt><br />
|
|
<b>URI</b></dt>
|
|
|
|
<dd>Uniform Resource Indicator.</dd>
|
|
|
|
<dt><br />
|
|
<b>URL</b></dt>
|
|
|
|
<dd>Uniform Resource Locator.</dd>
|
|
|
|
<dt><br />
|
|
<b>VoiceXML document</b></dt>
|
|
|
|
<dd>An XML document conforming to the VoiceXML
|
|
specification.</dd>
|
|
|
|
<dt><br />
|
|
<b>VoiceXML interpreter</b></dt>
|
|
|
|
<dd>A computer program that interprets a <i>VoiceXML document</i>
|
|
to control an <i>implementation platform</i> for the purpose of
|
|
conducting an interaction with a <i>user.</i></dd>
|
|
|
|
<dt><br />
|
|
<b>VoiceXML interpreter context</b></dt>
|
|
|
|
<dd>A computer program that uses a <i>VoiceXML interpreter</i> to
|
|
interpret a <i>VoiceXML Document</i> and that may also interact
|
|
with the <i>implementation platform</i> independently of the
|
|
<i>VoiceXML interpreter</i>.</dd>
|
|
|
|
<dt><br />
|
|
<b>W3C</b></dt>
|
|
|
|
<dd>World Wide Web Consortium <a href="http://www.w3.org/"
|
|
shape="rect">http://www.w3.org/</a></dd>
|
|
</dl>
|
|
|
|
<h2 id="Appendix1"><a id="dmlADTD" name="dmlADTD"
|
|
shape="rect">Appendix B — VoiceXML Document Type
|
|
Definition</a></h2>
|
|
|
|
<p>The VoiceXML DTD is located at <a href="./vxml.dtd"
|
|
shape="rect">http://www.w3.org/TR/voicexml20/vxml.dtd</a>.</p>
|
|
|
|
<p>Due to DTD limitations, the VoiceXML DTD does not correctly
|
|
express that the <metadata> element can contain elements
|
|
from other XML namespaces.</p>
|
|
|
|
<p>Note: the VoiceXML DTD includes modified elements from the
|
|
DTDs of the Speech Recognition Grammar Specification 1.0 <a
|
|
href="#ref_SRGS" shape="rect">[SRGS]</a> and the Speech Synthesis
|
|
Markup Language 1.0 <a href="#ref_SSML"
|
|
shape="rect">[SSML]</a>.</p>
|
|
|
|
<h2 id="Appendix2"><a id="dmlAFIA" name="dmlAFIA"
|
|
shape="rect">Appendix C — Form Interpretation
|
|
Algorithm</a></h2>
|
|
|
|
<p>The form interpretation algorithm (FIA) drives the interaction
|
|
between the user and a VoiceXML form or menu. A menu can be
|
|
viewed as a form containing a single field whose grammar and
|
|
whose <filled> action are constructed from the
|
|
<choice> elements.</p>
|
|
|
|
<p>The FIA must handle:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>Form initialization.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Prompting, including the management of the prompt counters
|
|
needed for prompt tapering.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Grammar activation and deactivation at the form and form item
|
|
levels.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Entering the form with an utterance that matched one of the
|
|
form's document-scoped grammars while the user was visiting
|
|
a different form or menu.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Leaving the form because the user matched another form, menu,
|
|
or link's document-scoped grammar.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Processing multiple field fills from one utterance, including
|
|
the execution of the relevant <filled> actions.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Selecting the next form item to visit, and then processing
|
|
that form item.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Choosing the correct catch element to handle any events thrown
|
|
while processing a form item.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>First we define some terms and data structures used in the
|
|
form interpretation algorithm:</p>
|
|
|
|
<dl>
|
|
<dt><br />
|
|
<i>active grammar set</i></dt>
|
|
|
|
<dd>The set of grammars active during a VoiceXML interpreter
|
|
context's input collection operation.</dd>
|
|
|
|
<dt><br />
|
|
<i>utterance</i></dt>
|
|
|
|
<dd>A summary of what the user said or keyed in, including the
|
|
specific grammar matched, and a semantic result consisting of an
|
|
interpretation structure or, where there is no semantic
|
|
interpretation, the raw text of the input (see <a
|
|
href="#dml3.1.6" shape="rect">Section 3.1.6</a>). An example
|
|
utterance might be: "grammar 123 was matched, and the semantic
|
|
interpretation is {drink: "coke" pizza: {number: "3" size:
|
|
"large"}}".</dd>
|
|
|
|
<dt><br />
|
|
<i>execute</i></dt>
|
|
|
|
<dd>To execute executable content – either a block, a
|
|
filled action, or a set of filled actions. If an event is thrown
|
|
during execution, the execution of the executable content is
|
|
aborted. The appropriate event handler is then executed, and this
|
|
may cause control to resume in a form item, in the next iteration
|
|
of the form's main loop, or outside of the form. If a
|
|
<goto> is executed, the transfer takes place immediately,
|
|
and the remaining executable content is not executed.</dd>
|
|
</dl>
|
|
|
|
<p>Here is the conceptual form interpretation algorithm. The FIA
|
|
can start with no initial utterance, or with an initial utterance
|
|
passed in from another dialog:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
//
|
|
// <b>Initialization Phase</b>
|
|
//
|
|
|
|
foreach ( <var>, <script> and form item, in document order )
|
|
if ( the element is a <var> )
|
|
Declare the variable, initializing it to the value of
|
|
the "expr" attribute, if any, or else to undefined.
|
|
else if ( the element is a <script> )
|
|
Evaluate the contents of the script if inlined or else
|
|
from the location specified by the "src" attribute.
|
|
else if ( the element is a form item )
|
|
Create a variable from the "name" attribute, if any, or
|
|
else generate an internal name. Assign to this variable
|
|
the value of the "expr" attribute, if any, or else undefined.
|
|
foreach ( input item and <initial> element )
|
|
Declare a prompt counter and set it to 1.
|
|
|
|
if ( user entered this form by speaking to its
|
|
grammar while in a different form)
|
|
{
|
|
Enter the main loop below, but start in
|
|
the process phase, not the select phase:
|
|
we already have a collection to process.
|
|
}
|
|
|
|
//
|
|
// <b>Main Loop</b>: select next form item and execute it.
|
|
//
|
|
|
|
while ( true )
|
|
{
|
|
//
|
|
// <b>Select Phase</b>: choose a form item to visit.
|
|
//
|
|
|
|
if ( the last main loop iteration ended
|
|
with a <goto nextitem> )
|
|
Select that next form item.
|
|
|
|
else if (there is a form item with an
|
|
unsatisfied guard condition )
|
|
Select the first such form item in document order.
|
|
|
|
else
|
|
Do an <exit/> -- the form is full and specified no transition.
|
|
|
|
//
|
|
// <b>Collect Phase</b>: execute the selected form item.
|
|
//
|
|
// Queue up prompts for the form item.
|
|
|
|
unless ( the last loop iteration ended with
|
|
a catch that had no <reprompt>,
|
|
and the active dialog was not changed )
|
|
{
|
|
|
|
Select the appropriate prompts for an input item or <initial>.
|
|
Queue the selected prompts for play prior to
|
|
the next collect operation.
|
|
|
|
Increment an input item's or <initial>'s prompt counter.
|
|
}
|
|
|
|
// Activate grammars for the form item.
|
|
|
|
if ( the form item is modal )
|
|
Set the active grammar set to the form item grammars,
|
|
if any. (Note that some form items, e.g. <block>,
|
|
cannot have any grammars).
|
|
else
|
|
Set the active grammar set to the form item
|
|
grammars and any grammars scoped to the form,
|
|
the current document, and the application root
|
|
document.
|
|
|
|
// Execute the form item.
|
|
|
|
if ( a <field> was selected )
|
|
Collect an utterance or an event from the user.
|
|
else if ( a <record> was chosen )
|
|
Collect an utterance (with a name/value pair
|
|
for the recorded bytes) or event from the user.
|
|
else if ( an <object> was chosen )
|
|
Execute the object, setting the <object>'s
|
|
form item variable to the returned ECMAScript value.
|
|
else if ( a <subdialog> was chosen )
|
|
Execute the subdialog, setting the <subdialog>'s
|
|
form item variable to the returned ECMAScript value.
|
|
else if ( a <transfer> was chosen )
|
|
Do the transfer, and (if wait is true) set the
|
|
<transfer> form item variable to the returned
|
|
result status indicator.
|
|
else if ( an <initial> was chosen )
|
|
Collect an utterance or an event from the user.
|
|
else if ( a <block> was chosen )
|
|
{
|
|
Set the block's form item variable to a defined value.
|
|
|
|
Execute the block's executable context.
|
|
}
|
|
|
|
//
|
|
// <b>Process Phase</b>: process the resulting utterance or event.
|
|
//
|
|
|
|
Assign the utterance and other information about the last
|
|
recognition to application.lastresult$.
|
|
// Must have an utterance
|
|
|
|
if ( the utterance matched a grammar belonging to a <link> )
|
|
If the link specifies an "next" or "expr" attribute,
|
|
transition to that location. Else if the link specifies an
|
|
"event" or "eventexpr" attribute, generate that event.
|
|
|
|
else if ( the utterance matched a grammar belonging to a <choice> )
|
|
If the choice specifies an "next" or "expr" attribute,
|
|
transition to that location. Else if the choice specifies
|
|
an "event" or "eventexpr" attribute, generate that event.
|
|
|
|
else if ( the utterance matched a grammar from outside the current
|
|
<form> or <menu> )
|
|
{
|
|
Transition to that <form> or <menu>, carrying the utterance
|
|
to the new FIA.
|
|
}
|
|
|
|
// Process an utterance spoken to a grammar from this form.
|
|
// First copy utterance result property values into corresponding
|
|
// form item variables.
|
|
|
|
Clear all "just_filled" flags.
|
|
|
|
if ( the grammar is scoped to the field-level ) {
|
|
// This grammar must be enclosed in an input item. The input item
|
|
// has an associated ECMAScript variable (referred to here as the input
|
|
// item variable) and slot name.
|
|
|
|
if ( the result is not a structure )
|
|
Copy the result into the input item variable.
|
|
elseif ( a top-level property in the result matches the slot name
|
|
or the slot name is a dot-separated path matching a
|
|
subproperty in the result )
|
|
Copy the value of that property into the input item variable.
|
|
else
|
|
Copy the entire result into the input item variable
|
|
|
|
Set this input item's "just_filled" flag.
|
|
}
|
|
else {
|
|
foreach ( property in the user's utterance )
|
|
{
|
|
if ( the property matches an input item's slot name )
|
|
{
|
|
Copy the value of that property into the input item's form
|
|
item variable.
|
|
|
|
Set the input item's "just_filled" flag.
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// Set all <initial> form item variables if any input items are filled.
|
|
|
|
if ( any input item variable is set as a result of the user utterance )
|
|
Set all <initial> form item variables to true.
|
|
|
|
// Next execute any triggered <filled> actions.
|
|
|
|
foreach ( <filled> action in document order )
|
|
{
|
|
// Determine the input item variables the <filled> applies to.
|
|
|
|
N = the <filled>'s "namelist" attribute.
|
|
|
|
if ( N equals "" )
|
|
{
|
|
if ( the <filled> is a child of an input item )
|
|
N = the input item's form item variable name.
|
|
else if ( the <filled> is a child of a form )
|
|
N = the form item variable names of all the input
|
|
items in that form.
|
|
}
|
|
|
|
// Is the <filled> triggered?
|
|
|
|
if ( any input item variable in the set N was "just_filled"
|
|
AND ( the <filled> mode is "all"
|
|
AND all variables in N are filled
|
|
OR the <filled> mode is "any"
|
|
AND any variables in N are filled) )
|
|
Execute the <filled> action.
|
|
|
|
If an event is thrown during the execution of a <filled>,
|
|
event handler selection starts in the scope of the <filled>,
|
|
which could be an input item or the form itself.
|
|
}
|
|
// If no input item is filled, just continue.
|
|
}
|
|
</pre>
|
|
|
|
<div>
|
|
<p>During FIA execution, events may be generated at several
|
|
points. These events are processed differently depending on which
|
|
phase is active.</p>
|
|
|
|
<p>Before a form item is selected (i.e. during the Initialization
|
|
and Select phases), events are generated at the dialog level. The
|
|
corresponding catch handler is located and executed. If the catch
|
|
does not result in a transition from the current dialog, FIA
|
|
execution will terminate.</p>
|
|
|
|
<p>Similarly, events triggered after a form item is selected
|
|
(i.e. during the Collect and Process phases) are usually
|
|
generated at the form item level. There is one exception: events
|
|
triggered by a dialog level <filled> are generated at the
|
|
dialog level. The corresponding catch handler is located and
|
|
executed. If the catch does not result in a transition, the
|
|
current FIA loop is terminated and Select phase is reentered.</p>
|
|
</div>
|
|
|
|
<h2 id="Appendix3"><a id="dmlATiming" name="dmlATiming"
|
|
shape="rect">Appendix D — Timing Properties</a></h2>
|
|
|
|
<p>The various timing properties for speech and DTMF recognition
|
|
work together to define the user experience. The ways in which
|
|
these different timing parameters function are outlined in the
|
|
timing diagrams below. In these diagrams, the start for wait of
|
|
DTMF input, or user speech both occur at the time that the last
|
|
prompt has finished playing.</p>
|
|
|
|
<h3 id="L9212"><a id="a.1" name="a.1" shape="rect">D.1. DTMF
|
|
Grammars</a></h3>
|
|
|
|
<p>DTMF grammars use timeout, interdigittimeout, termtimeout and
|
|
termchar as described in <a href="#dml6.3.3" shape="rect">Section
|
|
6.3.3</a> to tailor the user experience. The effects of these are
|
|
shown in the following timing diagrams.</p>
|
|
|
|
<h4 id="L9217">timeout, No Input Provided</h4>
|
|
|
|
<p>The timeout parameter determines when the <noinput>
|
|
event is thrown because the user has failed to enter any DTMF
|
|
(Figure 12). Once the first DTMF has been entered, this
|
|
parameter has no further effect.</p>
|
|
|
|
<p class="fig"><img height="197"
|
|
alt="Timing diagram for timeout when no input provided"
|
|
src="Images/image009.gif" width="438" /><br />
|
|
Figure 12: Timing diagram for timeout when no input provided.</p>
|
|
|
|
<h4 id="L9226">interdigittimeout, Grammar is Not Ready to
|
|
Terminate</h4>
|
|
|
|
<p>In Figure 13, the interdigittimeout determines when the
|
|
nomatch event is thrown because a DTMF grammar is not yet
|
|
recognized, and the user has failed to enter additional DTMF.</p>
|
|
|
|
<p class="fig"><img height="228"
|
|
alt="Timing diagram for interdigittimeout, grammar is not ready to terminate"
|
|
src="Images/image010.gif" width="449" /><br />
|
|
Figure 13: Timing diagram for interdigittimeout, grammar is not
|
|
ready to terminate.</p>
|
|
|
|
<h4 id="L9235">interdigittimeout, Grammar is Ready to
|
|
Terminate</h4>
|
|
|
|
<p>The example below shows the situation when a DTMF grammar
|
|
could terminate, or extend by the addition of more DTMF input,
|
|
and the user has elected not to provide any further input.</p>
|
|
|
|
<p class="fig"><img height="227"
|
|
alt="Timing diagram for interdigittimeout, grammar is ready to terminate"
|
|
src="Images/image011.gif" width="450" /><br />
|
|
Figure 14: Timing diagram for interdigittimeout, grammar is ready
|
|
to terminate.</p>
|
|
|
|
<h4 id="termchar">termchar and interdigittimeout, Grammar Can
|
|
Terminate</h4>
|
|
|
|
<p>In the example below, a termchar is non-empty, and is entered
|
|
by the user before an interdigittimeout expires, to signify that
|
|
the users DTMF input is complete; the termchar is not included as
|
|
part of the recognized value.</p>
|
|
|
|
<p class="fig"><img height="223"
|
|
alt="Timing diagram for termchar and interdigittimeout, grammar can terminate"
|
|
src="Images/image012.gif" width="459" /><br />
|
|
Figure 15: Timing diagram for termchar and interdigittimeout,
|
|
grammar can terminate.</p>
|
|
|
|
<h4 id="termchar1">termchar Empty When Grammar Must
|
|
Terminate</h4>
|
|
|
|
<p>In the example below, the entry of the last DTMF has brought
|
|
the grammar to a termination point at which no additional DTMF is
|
|
expected. Since termchar is empty, there is no optional
|
|
terminating character permitted, thus the recognition ends and
|
|
the recognized value is returned.</p>
|
|
|
|
<p class="fig"><img height="131"
|
|
alt="Timing diagram for termchar empty when grammar must terminate"
|
|
src="Images/image013.gif" width="443" /><br />
|
|
Figure 16: Timing diagram for termchar empty when grammar must
|
|
terminate.</p>
|
|
|
|
<h4 id="termchar2">termchar Non-Empty and termtimeout When
|
|
Grammar Must Terminate</h4>
|
|
|
|
<p>In the example below, the entry of the last DTMF has brought
|
|
the grammar to a termination point at which no additional DTMF is
|
|
allowed by the grammar. If the termchar is non-empty, then the
|
|
user can enter an optional termchar DTMF. If the user fails to
|
|
enter this optional DTMF within termtimeout, the recognition ends
|
|
and the recognized value is returned. If the termtimeout is 0s
|
|
(the default), then the recognized value is returned immediately
|
|
after the last DTMF allowed by the grammar, without waiting for
|
|
the optional termchar. Note: the termtimeout applies only
|
|
when no additional input is allowed by the grammar; otherwise,
|
|
the interdigittimeout applies.</p>
|
|
|
|
<p class="fig"><img height="227"
|
|
alt="Timing diagram for termchar non-empty and termtimeout when grammar must terminate"
|
|
src="Images/image014.gif" width="444" /><br />
|
|
Figure 17: Timing diagram for termchar non-empty and termtimeout
|
|
when grammar must terminate.</p>
|
|
|
|
<h4 id="termchar3">termchar Non-Empty and termtimeout When
|
|
Grammar Must Terminate</h4>
|
|
|
|
<p>In this example, the entry of the last DTMF has brought the
|
|
grammar to a termination point at which no additional DTMF is
|
|
allowed by the grammar. Since the termchar is non-empty, the user
|
|
enters the optional termchar within termtimeout causing the
|
|
recognized value to be returned (excluding the termchar).</p>
|
|
|
|
<p class="fig"><img height="223"
|
|
alt="Timing diagram for termchar non-empty when grammar must terminate"
|
|
src="Images/image015.gif" width="450" /><br />
|
|
Figure 18: Timing diagram for termchar non-empty when grammar
|
|
must terminate.</p>
|
|
|
|
<h4 id="invaliddtmf1">Invalid DTMF Input</h4>
|
|
|
|
<p>While waiting for the first or additional DTMF, three
|
|
different timeouts may determine when the user's input is
|
|
considered complete. If no DTMF has been entered, the timeout
|
|
applies; if some DTMF has been entered but additional DTMF is
|
|
valid, then the interdigittimeout applies; and if no additional
|
|
DTMF is legal, then the termtimeout applies. At each point, the
|
|
user may enter DTMF which is not permitted by the active
|
|
grammar(s). This causes the collected DTMF string to be invalid.
|
|
Additional digits will be collected until either the termchar
|
|
is pressed or the interdigittimeout has elapsed. A nomatch event
|
|
is then generated.</p>
|
|
|
|
<h3 id="L9280"><a id="a.2" name="a.2" shape="rect">D.2. Speech
|
|
Grammars.</a></h3>
|
|
|
|
<p>Speech grammars use timeout, completetimeout, and
|
|
incompletetimeout as described in <a href="#dml6.3.4"
|
|
shape="rect">Section 6.3.4</a> and <a href="#dml6.3.2"
|
|
shape="rect">Section 6.3.2</a> to tailor the user experience. The
|
|
effects of these are shown in the following timing diagrams.</p>
|
|
|
|
<h4 id="timeout">timeout When No Speech Provided</h4>
|
|
|
|
<p>In the example below, the timeout parameter determines when
|
|
the noinput event is thrown because the user has failed to
|
|
speak.</p>
|
|
|
|
<p class="fig"><img height="198"
|
|
alt="Timing diagram for timeout when no speech provided"
|
|
src="Images/image016.gif" width="438" /><br />
|
|
Figure 19: Timing diagram for timeout when no speech
|
|
provided.</p>
|
|
|
|
<h4 id="completeti">completetimeout With Speech Grammar
|
|
Recognized</h4>
|
|
|
|
<p>In the example above, the user provided a utterance that was
|
|
recognized by the speech grammar. After a silence period of
|
|
completetimeout has elapsed, the recognized value is
|
|
returned.</p>
|
|
|
|
<p class="fig"><img height="219"
|
|
alt="Timing diagram for completetimeout with speech grammar recognized"
|
|
src="Images/image017.gif" width="458" /><br />
|
|
Figure 20: Timing diagram for completetimeout with speech grammar
|
|
recognized.</p>
|
|
|
|
<h4 id="incomplete">incompletetimeout with Speech Grammar
|
|
Unrecognized</h4>
|
|
|
|
<p>In the example above, the user provided a utterance that is
|
|
not as yet recognized by the speech grammar but is the prefix of
|
|
a legal utterance. After a silence period of incompletetimeout
|
|
has elapsed, a nomatch event is thrown.</p>
|
|
|
|
<p class="fig"><img height="242"
|
|
alt="Timing diagram for incompletetimeout with speech grammar unrecognized"
|
|
src="Images/image018.gif" width="450" /><br />
|
|
Figure 21: Timing diagram for incompletetimeout with speech
|
|
grammar unrecognized.</p>
|
|
|
|
<h2 id="Appendix4"><a id="dmlAAudioFormats"
|
|
name="dmlAAudioFormats" shape="rect">Appendix E — Audio
|
|
File Formats</a></h2>
|
|
|
|
<p>VoiceXML requires that a platform support the playing and
|
|
recording audio formats specified below.</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 65: mandatory audio formats">
|
|
<caption align="bottom">Table 65: Audio Formats Which Platforms
|
|
Must Support</caption>
|
|
|
|
<thead>
|
|
<tr>
|
|
<th>Audio Format</th>
|
|
<th>Media Type</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<td>Raw (headerless) 8kHz 8-bit mono
|
|
mu-law [PCM] single channel. (G.711)</td>
|
|
<td>audio/basic (from <a
|
|
href="#ref_RFC1521" shape="rect">[RFC1521]</a>)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Raw (headerless) 8kHz 8 bit mono
|
|
A-law [PCM] single channel. (G.711)</td>
|
|
<td>audio/x-alaw-basic</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>WAV (RIFF header) 8kHz 8-bit mono
|
|
mu-law [PCM] single channel.</td>
|
|
<td>audio/x-wav</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>WAV (RIFF header) 8kHz 8-bit mono
|
|
A-law [PCM] single channel.</td>
|
|
<td>audio/x-wav</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>The 'audio/basic' mime type is commonly used with the 'au'
|
|
header format as well as the headerless 8-bit 8Khz mu-law format.
|
|
If this mime type is specified for recording, the mu-law format
|
|
must be used. For playback with the 'audio/basic' mime type,
|
|
platforms must support the mu-law format and may support the 'au'
|
|
format.</p>
|
|
|
|
<h2 id="Appendix5"><a id="dmlAConformance" name="dmlAConformance"
|
|
shape="rect">Appendix F —Conformance</a></h2>
|
|
|
|
<p><strong>This section is Normative.</strong></p>
|
|
|
|
<h3 id="Conforming"><a id="dmlADocumentConformance"
|
|
name="dmlADocumentConformance" shape="rect">F1. Conforming
|
|
VoiceXML Document</a></h3>
|
|
|
|
<p>A <em>conforming VoiceXML document</em> is a well-formed <a
|
|
href="#ref_XML" shape="rect">[XML]</a> document that requires
|
|
only the facilities described as mandatory in this specification.
|
|
Such a document must meet all of the following criteria:</p>
|
|
|
|
<ol>
|
|
<li>
|
|
<p>The document must conform to the constraints expressed in the
|
|
VoiceXML Schema (<a href="#dmlASchema" shape="rect">Appendix
|
|
O</a>).</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The root element of the document must be <vxml>.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The <vxml> element must include a "version" attribute
|
|
with the value "2.0".</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The <vxml> element must designate the VoiceXML
|
|
namespace. This can be achieved by declaring an "xmlns"
|
|
attribute or an attribute with an "xmlns" prefix <a
|
|
href="#ref_XMLNAMES" shape="rect">[XMLNAMES]</a>. The namespace
|
|
for VoiceXML is defined to be http://www.w3.org/2001/vxml.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>It is recommended that the <vxml> element also
|
|
indicate the location of the VoiceXML schema (see <a
|
|
href="#dmlASchema" shape="rect">Appendix O</a>) via the
|
|
xsi:schemaLocation attribute from <a href="#ref_SCHEMA1"
|
|
shape="rect">[SCHEMA1]</a>:</p>
|
|
|
|
<pre xml:space="preserve">
|
|
xsi:schemaLocation="http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd"
|
|
</pre>
|
|
|
|
<p>Although such indication is not required, to encourage it this
|
|
document provides such indication on all of the examples.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>There may be a DOCTYPE declaration in the document prior to
|
|
the root element. If present, the public identifier included in
|
|
the DOCTYPE declaration must reference the VoiceXML DTD (<a
|
|
href="#dmlADTD" shape="rect">Appendix B</a>) using its Formal
|
|
Public Identifier.</p>
|
|
|
|
<pre xml:space="preserve">
|
|
<!DOCTYPE vxml
|
|
PUBLIC "-//W3C//DTD VOICEXML 2.0//EN"
|
|
"http://www.w3.org/TR/voicexml20/vxml.dtd">
|
|
</pre>
|
|
|
|
<p>The system identifier may be modified appropriately.</p>
|
|
|
|
<p>The DTD subset must not be used to override any parameter
|
|
entities in the DTD.</p>
|
|
</li>
|
|
</ol>
|
|
|
|
<p>Here is an example of a Conforming VoiceXML document:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<vxml version="2.0" 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">
|
|
|
|
<form>
|
|
<block>hello</block>
|
|
</form>
|
|
|
|
</vxml>
|
|
</pre>
|
|
|
|
<p>Note that in this example, the recommended "xmlns:xsi" and
|
|
"xsi:schemaLocation" attributes are included as is an XML
|
|
declaration. An XML declaration like the one above is not
|
|
required in all XML documents. VoiceXML document authors are
|
|
strongly encouraged to use XML declarations in all their
|
|
documents. Such a declaration is required when the character
|
|
encoding of the document is other than the default UTF-8 or
|
|
UTF-16 and no encoding was determined by a higher-level
|
|
protocol.</p>
|
|
|
|
<p>The VoiceXML language or these conformance criteria provide no
|
|
designated size limits on any aspect of VoiceXML documents. There
|
|
are no maximum values on the number of elements, the amount of
|
|
character data, or the number of characters in attribute
|
|
values.</p>
|
|
|
|
<h3 id="ConformingNS"><a id="dmlAConformanceOtherNamespaces"
|
|
name="dmlAConformanceOtherNamespaces" shape="rect">F.2 Using
|
|
VoiceXML with other namespaces</a></h3>
|
|
|
|
<p>The VoiceXML namespace may be used with other XML namespaces
|
|
as per <a href="#ref_XMLNAMES" shape="rect">[XMLNAMES]</a>,
|
|
although such documents are not strictly conforming VoiceXML
|
|
documents as defined above. Future work by W3C will address ways
|
|
to specify conformance for documents involving multiple
|
|
namespaces.</p>
|
|
|
|
<h3 id="Conforming1"><a id="dmlAConformanceProcessor"
|
|
name="dmlAConformanceProcessor" shape="rect">F.3 Conforming
|
|
VoiceXML Processors</a></h3>
|
|
|
|
<p>A VoiceXML processor is a user agent that can parse and
|
|
process Conforming VoiceXML documents.</p>
|
|
|
|
<p>In a <em>Conforming VoiceXML Processor</em>, the XML parser
|
|
must be able to parse and process all well-formed XML constructs
|
|
defined within <a href="#ref_XML" shape="rect">[XML]</a> and <a
|
|
href="#ref_XMLNAMES" shape="rect">[XMLNAMES]</a>. It is not
|
|
required that a Conforming VoiceXML processor use a validating
|
|
parser.</p>
|
|
|
|
<p>A <em>Conforming VoiceXML Processor</em> must be a
|
|
<i>Conforming Speech Synthesis Markup Language Processor</i> <a
|
|
href="#ref_SSML" shape="rect">[SSML]</a> and a <i>Conforming XML
|
|
Grammar Processor</i> <a href="#ref_SRGS" shape="rect">[SRGS]</a>
|
|
except for differences described in this document. If a syntax
|
|
error is detected processing a grammar document, then an
|
|
"error.badfetch" event must be thrown.</p>
|
|
|
|
<p>A <em>Conforming VoiceXML Processor</em> must support the
|
|
syntax and semantics of all VoiceXML elements as described in
|
|
this document. Consequently, a <em>Conforming VoiceXML
|
|
Processor</em> must not throw an
|
|
'error.unsupported.<element>' for any VoiceXML element
|
|
which must be supported when processing a <a
|
|
href="#dmlADocumentConformance" shape="rect">Conforming VoiceXML
|
|
Document</a>.</p>
|
|
|
|
<p>When a <em>Conforming VoiceXML Processor</em> encounters a <a
|
|
href="#dmlADocumentConformance" shape="rect">Conforming VoiceXML
|
|
Document</a> with non-VoiceXML elements or attributes which are
|
|
proprietary, defined only in earlier versions of VoiceXML, or
|
|
defined in a non-VoiceXML namespace, and which cannot be
|
|
processed, then it must throw an "error.badfetch" event.</p>
|
|
|
|
<p>When a <em>Conforming VoiceXML Processor</em> encounters a
|
|
document with a root element designating a namespace other than
|
|
VoiceXML, its behavior is undefined.</p>
|
|
|
|
<p>There is, however, no conformance requirement with respect to
|
|
performance characteristics of the VoiceXML Processor.</p>
|
|
|
|
<h2 id="Appendix6"><a id="dmlAInternationalization"
|
|
name="dmlAInternationalization" shape="rect">Appendix G
|
|
—Internationalization</a></h2>
|
|
|
|
<p>VoiceXML is an application of <a href="#ref_XML"
|
|
shape="rect">[XML]</a> and thus supports <a href="#ref_UNICODE"
|
|
shape="rect">[UNICODE]</a> which defines a standard universal
|
|
character set.</p>
|
|
|
|
<p>Additionally, VoiceXML provides a mechanism for precise
|
|
control of the input and output languages via the use of
|
|
"xml:lang" attribute. This facility provides:</p>
|
|
|
|
<ul>
|
|
<li>The ability to specify the input and output language
|
|
overriding the VoiceXML Processor default language</li>
|
|
|
|
<li>The ability to produce multi-language output</li>
|
|
|
|
<li>The ability to interpret input in a language different from
|
|
the output language(s)</li>
|
|
</ul>
|
|
|
|
<h2 id="Appendix7"><a id="dmlAAccessibility"
|
|
name="dmlAAccessibility" shape="rect">Appendix H
|
|
—Accessibility</a></h2>
|
|
|
|
<div>
|
|
<p>Voice is central to, but not the limit of, VoiceXML
|
|
applications. While speaking and listening will be the most
|
|
widely used techniques in most circumstances and for most users
|
|
to interact with VoiceXML applications, some users may be unable
|
|
to speak and/or listen because of temporary (or permanent)
|
|
circumstances. Persons with disabilities, particularly those with
|
|
speech and/or hearing impairments, may need to interact with
|
|
VoiceXML applications in other ways:</p>
|
|
|
|
<ol>
|
|
<li>Hearing impaired users may read text on a display or (if they
|
|
are also blind) read Braille text by touch. In order to support
|
|
special devices for use by persons with speech and/or hearing
|
|
impairments, developers are encouraged to provide a text
|
|
equivalent of each audio prompt within the audio tag: For example
|
|
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<audio src="greetings.wav">Greetings</audio>
|
|
</pre>
|
|
|
|
would normally replay the greetings.wav audio file. However, if
|
|
the VoiceXML interpreter Context has detected that the user is
|
|
viewing the interaction on a display or is touching Braille
|
|
output, then the text "Greetings" is rendered by the display or
|
|
Braille output device.</li>
|
|
|
|
<li>Speaking impaired users may enter coded sequences that are
|
|
converted into alphabetic text before feeding them into the
|
|
VoiceXML platform. The conversion might be accomplished by a
|
|
special hardware attachment to a telephone that converts
|
|
keystrokes from, as examples, a QWERTY keyboard to alphabetic
|
|
text. The conversion might also be accomplished by software that
|
|
translates sequences of DTMF tones from a 12-key telephone keypad
|
|
into alphabetic text.</li>
|
|
</ol>
|
|
|
|
<p>Providing alternative paths to information delivery and user
|
|
input is central to all W3C technologies intended for use by
|
|
people. While initially authored to make on screen content
|
|
accessible, the following accessibility guidelines published by
|
|
W3C's Web Accessibility Initiative (WAI) also apply to
|
|
VoiceXML.</p>
|
|
|
|
<ul>
|
|
<li>Web Content Accessibility Guidelines 1.0 <a
|
|
href="#ref_WAI-WEBCONTENT" shape="rect">[WAI-WEBCONTENT]</a>
|
|
explains in detail how to make a Web site accessible for people
|
|
with a variety of disabilities.</li>
|
|
|
|
<li>Authoring Tool Accessibility Guidelines 1.0 <a
|
|
href="#ref_ATAGIO" shape="rect">[ATAGIO]</a>. For software
|
|
developers, explains how to make a variety of authoring tools
|
|
support the production of accessible Web content, and also how to
|
|
make the software itself accessible.</li>
|
|
|
|
<li>User Agent Accessibility Guidelines 1.0 <a href="#ref_UAAGIO"
|
|
shape="rect">[UAAGIO]</a>. For software developers, explains how
|
|
to make accessible browsers, multimedia players, and assistive
|
|
technologies that interface with these.</li>
|
|
|
|
<li>XML Accessibility Guidelines <a href="#ref_XAG"
|
|
shape="rect">[XAG]</a>. For developers of XML-based applications
|
|
explains how to ensure that XML-based applications support
|
|
accessibility.</li>
|
|
</ul>
|
|
|
|
<p>Additional guidelines for enabling persons with disabilities
|
|
to access VoiceXML applications include the following:</p>
|
|
|
|
<ul>
|
|
<li>Reuse navigation structures that are highly usable and
|
|
leverage learning across multiple applications--for example, the
|
|
navigational techniques for the ANSI/NISO Z39.86-2002 Digital
|
|
Talking book Standard, http://www.loc.gov/nls/z3986/.</li>
|
|
|
|
<li>Each element in which an event can occur should specify catch
|
|
elements, including one with a fail-soft or recovery
|
|
functionality.</li>
|
|
|
|
<li>Enable users to control the length of time before timeout,
|
|
the speaking rate of synthesized speech, and other such variables
|
|
that provide a little extra time to respond or complete an input
|
|
action, particularly when the VoiceXML interpreter Context has
|
|
detected that the user is using an ancillary device instead of
|
|
listening or speaking. These are especially useful for users with
|
|
cognitive disabilities.</li>
|
|
|
|
<li>Advertise alternative modes through which equivalent service
|
|
is available, including transfer to a human operator, text
|
|
telephone service, etc., or the availability of the same
|
|
information via the World Wide Web.</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<h2 id="Appendix8"><a id="dmlAPrivacy" name="dmlAPrivacy"
|
|
shape="rect">Appendix I —Privacy</a></h2>
|
|
|
|
<p>A future version of VoiceXML may specify criteria by which a
|
|
VoiceXML Processor safeguards the privacy of personal data.</p>
|
|
|
|
<h2 id="Appendix9"><a id="dmlAChanges" name="dmlAChanges"
|
|
shape="rect">Appendix J —Changes from VoiceXML 1.0</a></h2>
|
|
|
|
<p>The following is a summary of the differences between VoiceXML
|
|
2.0 and VoiceXML 1.0 <a href="#ref_VOICEXML-1.0"
|
|
shape="rect">[VOICEXML-1.0]</a>.</p>
|
|
|
|
<p>Developers of VoiceXML 1.0 applications should pay particular
|
|
attentions to the changes incompatible with VoiceXML 1.0
|
|
specified in <a href="#dmlAChangesRemoved" shape="rect">Obsolete
|
|
Elements</a> and <a href="#dmlAChangesIncModified"
|
|
shape="rect">Incompatibly Modified Elements</a>.</p>
|
|
|
|
<h3 id="Elements"><a id="dmlAChangesNew" name="dmlAChangesNew"
|
|
shape="rect">New Elements</a></h3>
|
|
|
|
<ul>
|
|
<li><log> to specify a debug message (<a href="#dml5.3.13"
|
|
shape="rect">5.3.13</a>)</li>
|
|
|
|
<li><metadata> as a means of specifying metadata
|
|
information using a schema (<a href="#dml6.2"
|
|
shape="rect">6.2</a>, <a href="#dml6.2.2"
|
|
shape="rect">6.2.2</a>)</li>
|
|
</ul>
|
|
|
|
<h3 id="Obsolete"><a id="dmlAChangesRemoved"
|
|
name="dmlAChangesRemoved" shape="rect">Obsolete Elements</a></h3>
|
|
|
|
<ul>
|
|
<li><dtmf> superceded by <grammar> with "mode=dtmf"
|
|
(<a href="#dml3.1.2" shape="rect">3.1.2</a>)</li>
|
|
|
|
<li><emp>, <div>, <pros>, and <sayas>
|
|
JSML elements have been replaced by corresponding elements in
|
|
Speech Synthesis Markup Language <a href="#ref_SSML"
|
|
shape="rect">[SSML]</a> (<a href="#dml4.1.1"
|
|
shape="rect">4.1.1</a>)</li>
|
|
</ul>
|
|
|
|
<h3 id="Incompatib"><a id="dmlAChangesIncModified"
|
|
name="dmlAChangesIncModified" shape="rect">Incompatibly Modified
|
|
Elements</a></h3>
|
|
|
|
<ul>
|
|
<li>changed "lang" to "xml:lang" in <vxml> (<a
|
|
href="#dml1.5.1" shape="rect">1.5.1</a>).</li>
|
|
|
|
<li>Added required attribute xmlns in <vxml> (<a
|
|
href="#dml1.5.1" shape="rect">1.5.1</a>)</li>
|
|
|
|
<li>Replaced "base" attribute with "xml:base" in <vxml> (<a
|
|
href="#dml1.5.1" shape="rect">1.5.1</a>)</li>
|
|
|
|
<li>Changed and clarified that if an implementation does not
|
|
support a specific object, it throws
|
|
error.unsupported.objectname. The event error.unsupported.format
|
|
is not thrown for unsupported object types ( <a
|
|
href="#dml2.1.2.1" shape="rect">2.1.2.1</a>, <a href="#dml2.3.5"
|
|
shape="rect">2.3.5</a>, <a href="#dml5.2.6"
|
|
shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>A field's type attribute does not indicate an implicit
|
|
<say-as> class to use when speaking out the field's value.
|
|
An explicit <say-as> must be used instead (<a
|
|
href="#dml2.1.4" shape="rect">2.1.4</a>, <a href="#dmlABuiltins"
|
|
shape="rect">Appendix P</a>)</li>
|
|
|
|
<li>added "accept" attribute to <menu> and <choice>
|
|
(<a href="#dml2.2.1" shape="rect">2.2.1</a>, <a href="#dml2.2.2"
|
|
shape="rect">2.2.2</a>)</li>
|
|
|
|
<li>An error.badfetch (previously, error.semantic) is thrown if a
|
|
<menu>'s dtmf attribute is set to true and it has choices
|
|
with DTMF sequences specified as something other than "*", "#",
|
|
or "0" (<a href="#dml2.2.1" shape="rect">2.2.1</a>)</li>
|
|
|
|
<li>Removed required support for access to builtin resources such
|
|
as grammars, and 'builtin' is treated as a platform-specific URI
|
|
scheme for accessing resources (<a href="#dml2.3.1.2"
|
|
shape="rect">2.3.1.2</a>, <a href="#dmlABuiltins"
|
|
shape="rect">Appendix P</a>)</li>
|
|
|
|
<li>Added 'accept' attribute to <option> and modified
|
|
description of 'choice phrase' in grammar generation (<a
|
|
href="#dml2.3.1.3" shape="rect">2.3.1.3</a>, <a href="#dml2.2.5"
|
|
shape="rect">2.2.5</a>)</li>
|
|
|
|
<li>removed "modal" attribute of <subdialog> (<a
|
|
href="#dml2.3.4" shape="rect">2.3.4</a>)</li>
|
|
|
|
<li>removed "fetchaudio" attribute from <object>(<a
|
|
href="#dml2.3.5" shape="rect">2.3.5</a>)</li>
|
|
|
|
<li>Removed capability of <value> to playback a record.
|
|
Only <audio> can be used to playback recording (<a
|
|
href="#dml2.3.6" shape="rect">2.3.6</a>, <a href="#dml4.1.3"
|
|
shape="rect">4.1.3</a>, <a href="#dml4.1.4"
|
|
shape="rect">4.1.4</a>)</li>
|
|
|
|
<li>If a platform supports simultaneous speech recognition and
|
|
recording, then spoken input can match an active non-local
|
|
speech grammar. If local speech grammars are specified, they
|
|
are treated as inactive (i.e. they are ignored), even if the
|
|
platform supports simultaneous recognition and recording
|
|
(<a href="#dml2.3.6" shape="rect">2.3.6</a>)</li>
|
|
|
|
<li>replaced "phone" URI schema with "tel" schema in
|
|
<transfer> dest (and destexpr) attribute (<a
|
|
href="#dml2.3.7" shape="rect">2.3.7</a>)</li>
|
|
|
|
<li>during bridged transfer, while bargein operates normally, the
|
|
bargeintype is fixed to "hotword", grammar activation is modal
|
|
(only local grammars are activated), and transferaudio begins
|
|
playing at the point the outgoing call begins (<a
|
|
href="#dml2.3.7" shape="rect">2.3.7</a>)</li>
|
|
|
|
<li>removed notational equivalence between <filled> in a
|
|
field and a form-level <filled> triggering on that field
|
|
(<a href="#dml2.4" shape="rect">2.4</a>)</li>
|
|
|
|
<li>The treatment of the 'type' in the <grammar> element
|
|
follows standard W3C practise. If a media type is returned by the
|
|
protocol, then it is authoritative: it cannot be override by the
|
|
VoiceXML platform even if it does not match the actual media type
|
|
of the resource or cannot be processed as a grammar. The value of
|
|
the 'type' attribute may be used to influence content type
|
|
negotiation (in HTTP 1.1 for example) and, only if no media type
|
|
is returned by the protocol, becomes the authorative media type
|
|
for the resource (<a href="#dml3.1.1.2" shape="rect">3.1.1.2</a>,
|
|
<a href="#dml3.1.1.4" shape="rect">3.1.1.4</a>)</li>
|
|
|
|
<li>TTS content in <choice>, <prompt>,
|
|
<enumerate>, and <audio> replaced with definition in
|
|
Speech Synthesis Markup Language <a href="#ref_SSML"
|
|
shape="rect">[SSML]</a>)</li>
|
|
|
|
<li>in <audio>, if the audio file cannot be played and the
|
|
content of the element is empty, no audio is played and no error
|
|
event is thrown (<a href="#dml4.1.3" shape="rect">4.1.3</a>)</li>
|
|
|
|
<li>removed "class", "mode" and "recsrc" attributes from
|
|
<value> (<a href="#dml4.1.4" shape="rect">4.1.4</a>)</li>
|
|
|
|
<li>removed standard session variable "session.uui". Added
|
|
new generic session variables "session.connection.protocol.name"
|
|
and "session.connection.aai", which would provide this
|
|
information and more (<a href="#dml5.1.4"
|
|
shape="rect">5.1.4</a>)</li>
|
|
|
|
<li>Replaced session.telephone variable space with
|
|
session.connection space which is not protocol-specific and more
|
|
extensible. Corresponding error names also changed. (<a
|
|
href="#dml5.1.4" shape="rect">5.1.4</a>)</li>
|
|
|
|
<li>The mechanism by which ECMAScript objects in the namelist of
|
|
<submit> are submitted is not currently defined but
|
|
reserved for future definition. Application developers may
|
|
explicit submit properties of the object instead of the object
|
|
itself (<a href="#dml5.3.8" shape="rect">5.3.8</a>)</li>
|
|
|
|
<li>removed "caching" attribute (<a href="#dml6.1"
|
|
shape="rect">6.1</a>)</li>
|
|
|
|
<li>added "maxage" and "maxstale" attributes (<a href="#dml6.1"
|
|
shape="rect">6.1</a>)</li>
|
|
|
|
<li>removed "stream" as value of fetchhint property (<a
|
|
href="#dml6.1.1" shape="rect">6.1.1</a>, <a href="#dml6.3.5"
|
|
shape="rect">6.3.5</a>)</li>
|
|
|
|
<li>removed "caching" from fetching properties (<a
|
|
href="#dml6.3.5" shape="rect">6.3.5</a>).</li>
|
|
|
|
<li>Platform-specific universal command grammars are optional (<a
|
|
href="#dml6.3.6" shape="rect">6.3.6</a>)</li>
|
|
</ul>
|
|
|
|
<h3 id="Modified"><a id="dmlAChangesModified"
|
|
name="dmlAChangesModified" shape="rect">Modified
|
|
Elements</a></h3>
|
|
|
|
<ul>
|
|
<li>Platforms may make a distinction between field and utterance
|
|
level confidence: i.e. field$.confidence and
|
|
application.lastresult$.confidence may differ (<a
|
|
href="#dml2.3.1" shape="rect">2.3.1</a>, <a href="#dml3.1.6.4"
|
|
shape="rect">3.1.6.4</a>, <a href="#dml5.1.5"
|
|
shape="rect">5.1.5</a>, <a href="#dml6.3.2"
|
|
shape="rect">6.3.2</a> )</li>
|
|
|
|
<li>Added 'srcexpr' attribute to <subdialog>(<a
|
|
href="#dml2.3.4" shape="rect">2.3.4</a>)</li>
|
|
|
|
<li>added "maxtime" shadow variable to <record>
|
|
(<a href="#dml2.3.6" shape="rect">2.3.6</a>)</li>
|
|
|
|
<li>added "transferaudio" attribute to <transfer>; added
|
|
"maxtimedisconnect", and "unknown" as values of bridge transfers;
|
|
added more error.connection events (<a href="#dml2.3.7"
|
|
shape="rect">2.3.7</a>)</li>
|
|
|
|
<li>added "aai" and "aaiexpr" attributes to allow data passing
|
|
with <transfer> (<a href="#dml2.3.7"
|
|
shape="rect">2.3.7</a>)</li>
|
|
|
|
<li>added 'dtmf' attribute to <link> (<a href="#dml2.5"
|
|
shape="rect">2.5</a>).</li>
|
|
|
|
<li>the XML Form of the W3C Speech Recognition Grammar
|
|
Specification <a href="#ref_SRGS" shape="rect">[SRGS]</a> must be
|
|
supported in <grammar> (<a href="#dml3.1"
|
|
shape="rect">3.1</a>).</li>
|
|
|
|
<li>added "weight", "mode", "xml:lang", "root" and "version"
|
|
attributes to <grammar> (<a href="#dml3.1"
|
|
shape="rect">3.1</a>).</li>
|
|
|
|
<li>added "xml:lang" attribute to <prompt> (<a
|
|
href="#dml4.1" shape="rect">4.1</a>).</li>
|
|
|
|
<li>added "bargeintype" attribute to <prompt> with values
|
|
"speech" and "hotword" (<a href="#dml4.1"
|
|
shape="rect">4.1</a>).</li>
|
|
|
|
<li>added "expr" attribute to <audio> element (<a
|
|
href="#dml4.1.3" shape="rect">4.1.3</a>)</li>
|
|
|
|
<li>added application variable "application.lastresult$"
|
|
describing last recognition result, including n-best (<a
|
|
href="#dml5.1.5" shape="rect">5.1.5</a>).</li>
|
|
|
|
<li>added "event", "eventexpr", "message" and "messageexpr" as
|
|
attributes of <throw>, <choice>, <link>, and
|
|
<return> (<a href="#dml5.2.1" shape="rect">5.2.1</a>).</li>
|
|
|
|
<li>added "_event" variable to <catch> (<a href="#dml5.2.2"
|
|
shape="rect">5.2.2</a>).</li>
|
|
|
|
<li><catch> is no longer allowed to specify an event
|
|
attribute with an empty string value (<a href="#dml5.2.2"
|
|
shape="rect">5.2.2</a>, <a href="#dml5.2.4"
|
|
shape="rect">5.2.4</a>)</li>
|
|
|
|
<li>added "error.badfetch.http.nnn" as pre-defined error type (<a
|
|
href="#dml5.2.6" shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>added "error.badfetch.protocol.<response code>" as
|
|
pre-defined error type (<a href="#dml5.2.6"
|
|
shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>added "maxspeechtimeout" event (<a href="#dml5.2.6"
|
|
shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>added "error.unsupported.language" pre-defined error type (<a
|
|
href="#dml5.2.6" shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>added required support for "multipart/form-data" value as
|
|
"enctype" of <submit> (<a href="#dml5.3.8"
|
|
shape="rect">5.3.8</a>)</li>
|
|
|
|
<li><script> can occur in <form> element (<a
|
|
href="#dml5.3.12" shape="rect">5.3.12</a>)</li>
|
|
|
|
<li>Failure to retrieve fetchaudio from its URI does not result
|
|
in a badfetch event being thrown; instead, no audio is played
|
|
during the fetch (<a href="#dml6.1.1"
|
|
shape="rect">6.1.1</a>)</li>
|
|
|
|
<li>HTTP is mandatory (<a href="#dml6.1.4"
|
|
shape="rect">6.1.4</a>)</li>
|
|
|
|
<li>added "maxspeechtimeout" property (<a href="#dml6.3.2"
|
|
shape="rect">6.3.2</a>)</li>
|
|
|
|
<li>Platform support for the completetimeout property is
|
|
optional. However, a platform which does not support this
|
|
property must use the maximum of the completetimeout and
|
|
incompletetimeout values as the value for the incompletetimeout,
|
|
and must document it (<a href="#dml6.3.2"
|
|
shape="rect">6.3.2</a>)</li>
|
|
|
|
<li>added "bargeintype" property (<a href="#dml6.3.4"
|
|
shape="rect">6.3.4</a>)</li>
|
|
|
|
<li>added "fetchaudiodelay" and "fetchaudiominimum" to fetch
|
|
properties (<a href="#dml6.3.5" shape="rect">6.3.5</a>)</li>
|
|
|
|
<li>added "maxnbest" session property (<a href="#dml6.3.6"
|
|
shape="rect">6.3.6</a>)</li>
|
|
|
|
<li>added "universals" property (with default "none") (<a
|
|
href="#dml6.3.6" shape="rect">6.3.6</a>).</li>
|
|
|
|
<li>Added defaults for fetching attributes, as well as "maxage"
|
|
and "maxstale" fetching attributes to: <choice>,
|
|
<subdialog>, <object>, <link>, <grammar>,
|
|
<audio>, <goto>, <submit> and
|
|
<script></li>
|
|
</ul>
|
|
|
|
<h3 id="Clarificat"><a id="dmlAChangesClarify"
|
|
name="dmlAChangesClarify" shape="rect">Clarifications</a></h3>
|
|
|
|
<ul>
|
|
<li>Clarification how grammar results are mapped into VoiceXML
|
|
including: notion of "input items" for form input which accept
|
|
input; only input items can be filled as a result of a form-level
|
|
grammar match; field-level grammar matches cannot fill input
|
|
items other than the current field; clarified that <object>
|
|
could be filled and trigger filled actions; added a design
|
|
principle for semantic mapping and effects on lastresult$, shadow
|
|
variables and process phase in the FIA (<a href="#dml1.2.4"
|
|
shape="rect">1.2.4</a>, <a href="#dml2.1.4"
|
|
shape="rect">2.1.4</a>, <a href="#dml2.1.5"
|
|
shape="rect">2.1.5</a>, <a href="#dml2.1.6.2.3"
|
|
shape="rect">2.1.6.2.3</a>, <a href="#dml2.2"
|
|
shape="rect">2.2</a>, <a href="#dml2.3.1" shape="rect">2.3.1</a>,
|
|
<a href="#dml2.3.1.3" shape="rect">2.3.1.3</a>, <a
|
|
href="#dml2.3.5" shape="rect">2.3.5</a>, <a href="#dml2.3.6"
|
|
shape="rect">2.3.6</a>, <a href="#dml2.3.7.2"
|
|
shape="rect">2.3.7.2</a>, <a href="#dml2.4" shape="rect">2.4</a>,
|
|
<a href="#dml2.5" shape="rect">2.5</a>, <a href="#dml3.1.1"
|
|
shape="rect">3.1.1</a>, <a href="#dml3.1.6"
|
|
shape="rect">3.1.6</a>, <a href="#dml3.1.6.1"
|
|
shape="rect">3.1.6.1</a>, <a href="#dml3.1.6.2"
|
|
shape="rect">3.1.6.2</a>, <a href="#dml3.1.6.3"
|
|
shape="rect">3.1.6.3</a>, <a href="#dml3.1.6.4"
|
|
shape="rect">3.1.6.4</a>, <a href="#dmlAFIA"
|
|
shape="rect">Appendix C</a>).</li>
|
|
|
|
<li>if no audio input or output resource is available, an
|
|
error.noresource must be thrown (<a href="#dml1.2.5"
|
|
shape="rect">1.2.5</a>, <a href="#dml5.2.6"
|
|
shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>Replaced misleading term 'field' item with 'form' or 'input'
|
|
item as appropriate (<a shape="rect" href="#dml1.3.1">1.3.1</a>,
|
|
<a shape="rect" href="#dml2.1.6.2.2">2.1.6.2.2</a>, <a
|
|
shape="rect" href="#dml2.3">2.3</a>, <a shape="rect"
|
|
href="#dml2.3.3">2.3.3</a>, <a shape="rect"
|
|
href="#dml2.3.5">2.3.5</a>, <a shape="rect"
|
|
href="#dml3.1.6.1">3.1.6.1</a>, <a shape="rect"
|
|
href="#dml4.1.3">4.1.3</a>, <a shape="rect"
|
|
href="#dml5.1.1">5.1.1</a>, <a shape="rect"
|
|
href="#dml5.1.3">5.1.3</a>, <a shape="rect"
|
|
href="#dml6.3">6.3</a>)</li>
|
|
|
|
<li>Clarified that application-level grammars may remain active
|
|
for the duration of the application subject to the grammar
|
|
activation rules in <a href="#dml3.1.4" shape="rect">Section
|
|
3.1.4</a> (<a href="#dml1.3.3" shape="rect">1.3.3</a>)</li>
|
|
|
|
<li>definitions of, and transitions between, root and leaf
|
|
document (<a href="#dml1.5.2" shape="rect">1.5.2</a>).</li>
|
|
|
|
<li>referencing application root document and its grammars (<a
|
|
href="#dml1.5.2" shape="rect">1.5.2</a>).</li>
|
|
|
|
<li>When a subdialog is invoked with only a fragment identifier,
|
|
the root and leaf pages remain unchanged and these pages are used
|
|
to initialize root and leaf contexts (<a href="#dml1.5.2"
|
|
shape="rect">1.5.2</a>)</li>
|
|
|
|
<li>In a root to root transition, root context initialization is
|
|
determined by the caching policy even when the current and target
|
|
applications have the same name (<a href="#dml1.5.2"
|
|
shape="rect">1.5.2</a>)</li>
|
|
|
|
<li>Clarification of URI transitions, especially fragment
|
|
identifiers, in relation to RFC2396 (<a href="#dml1.5.2"
|
|
shape="rect">1.5.2</a>, <a href="#dml2.3.4"
|
|
shape="rect">2.3.4</a>, <a href="#dml5.3.7"
|
|
shape="rect">5.3.7</a>, <a href="#dml5.3.8"
|
|
shape="rect">5.3.8</a>, <a href="#dml6.1.1"
|
|
shape="rect">6.1.1</a>)</li>
|
|
|
|
<li>Clarification of how root documents are treated in
|
|
multi-document applications and the benefits of using root
|
|
documents (<a href="#dml1.5.2" shape="rect">1.5.2</a>)</li>
|
|
|
|
<li>An error.badfetch is thrown when a document references a
|
|
non-existent root document, and that an error.semantic is thrown
|
|
if it references a root document which itself references a root
|
|
document (<a href="#dml1.5.2" shape="rect">1.5.2</a>)</li>
|
|
|
|
<li><subdialog> transferring control to another
|
|
<subdialog> and to another dialog via <goto> (<a
|
|
href="#dml1.5.3" shape="rect">1.5.3</a>).</li>
|
|
|
|
<li>Added section describing final processing state when there is
|
|
no longer a connection between the interpreter and the user.
|
|
Removed description of final processing in <catch>. (<a
|
|
href="#dml1.5.4" shape="rect">1.5.4</a>, <a href="#dml5.2.2"
|
|
shape="rect">5.2.2</a>)</li>
|
|
|
|
<li>scope specified on individual form grammars takes precedence
|
|
over the default grammar scope in a <form> (<a
|
|
href="#dml2.1" shape="rect">2.1</a>).</li>
|
|
|
|
<li>behaviour when executing unsupported <object> instances
|
|
(<a href="#dml2.1.2.1" shape="rect">2.1.2.1</a>, <a
|
|
href="#dml2.3.5" shape="rect">2.3.5</a>).</li>
|
|
|
|
<li>In <object>, when a platform does not support a
|
|
particular object, an error.unsupported.objectname event is
|
|
thrown where 'objectname' is a fixed string and is <b>not</b>
|
|
substituted with the name of the particular object. In general,
|
|
the substitutable components of an event name are indicated by
|
|
italics (e.g. <i>object</i> in error.unsupported.<i>object</i>)
|
|
(<a shape="rect" href="#dml2.1.2.1">2.1.2.1</a>, <a shape="rect"
|
|
href="#dml2.3.5">2.3.5</a>, <a shape="rect"
|
|
href="#dml5.2.6">5.2.6</a> )</li>
|
|
|
|
<li>If a platform does not support a specific <object>,
|
|
then error.unsupported.objectname is thrown (<a
|
|
href="#dml2.1.2" shape="rect">2.1.2</a>)</li>
|
|
|
|
<li>Multiple prompts in a field do not need to have count
|
|
attributes. One or more prompts in a field are queued for
|
|
playback according to the prompt selection algorithm in Section
|
|
4.1.6 (<a href="#dml2.1.4" shape="rect">2.1.4</a>)</li>
|
|
|
|
<li>effect of <goto nextitem> on form item (<a
|
|
href="#dml2.1.5" shape="rect">2.1.5</a>).</li>
|
|
|
|
<li>no variables, conditions or counters are reset when using
|
|
< goto nextitem> (<a href="#dml2.1.5"
|
|
shape="rect">2.1.5</a>).</li>
|
|
|
|
<li>Clarified that mixed initiative dialogs require forms with
|
|
form-level grammars and that there are many authoring styles for
|
|
mixed initiative including using <initial> and cond
|
|
attributes on <field> elements (<a href="#dml2.1.5"
|
|
shape="rect">2.1.5</a>)</li>
|
|
|
|
<li><goto nextitem> forces an immediate transfer to the
|
|
specified form item, even if any cond attribute present on the
|
|
form item evaluates to "false". (<a shape="rect"
|
|
href="#dml2.1.5.1">2.1.5.1</a>)</li>
|
|
|
|
<li>behaviour of <transfer>, <subdialog> and
|
|
<object> with audio playback in collect phase (<a
|
|
href="#dml2.1.6" shape="rect">2.1.6</a>).</li>
|
|
|
|
<li>Event handler selection in FIA process phase and
|
|
<filled> (<a href="#dml2.1.6.2"
|
|
shape="rect">2.1.6.2</a>).</li>
|
|
|
|
<li>Clarified that when errors raised in the select or collect
|
|
phases of the FIA result in an event being thrown, the FIA moves
|
|
directly to the process phase (<a href="#dml2.1.6.2"
|
|
shape="rect">2.1.6.2</a>, <a href="#dml2.1.6.2.1"
|
|
shape="rect">2.1.6.2.1</a>, <a href="#dml2.1.6.2.3"
|
|
shape="rect">2.1.6.2.3</a>)</li>
|
|
|
|
<li>When an error is thrown in executable content, no subsequent
|
|
executable elements in the procedural block are executed and, if
|
|
there is no explicit transfer of control, an implicit
|
|
<exit> is performed (<a href="#dml2.1.6.2.1"
|
|
shape="rect">2.1.6.2.1</a>, <a href="#dml5.3"
|
|
shape="rect">5.3</a>)</li>
|
|
|
|
<li>enumerated executable context elements which cause execution
|
|
to terminate (<a href="#dml2.1.6.2.3"
|
|
shape="rect">2.1.6.2.3</a>).</li>
|
|
|
|
<li><reprompt> does not terminate the FIA (<a
|
|
href="#dml2.1.6.2.3" shape="rect">2.1.6.2.3</a>).</li>
|
|
|
|
<li>Clarified that 'false' is the default value of the dtmf
|
|
attribute of <menu> (<a href="#dml2.2.1"
|
|
shape="rect">2.2.1</a>)</li>
|
|
|
|
<li>Clarified specification and behavior of mutually exclusive
|
|
attributes and child content ( <a href="#dml2.2.2"
|
|
shape="rect">2.2.2</a>, <a href="#dml2.3.4"
|
|
shape="rect">2.3.4</a>, <a href="#dml2.3.7"
|
|
shape="rect">2.3.7</a>, <a href="#dml2.5" shape="rect">2.5</a>,
|
|
<a href="#dml3.1.1.4" shape="rect">3.1.1.4</a>, <a
|
|
href="#dml4.1.3" shape="rect">4.1.3</a>, <a href="#dml5.2.1"
|
|
shape="rect">5.2.1</a>, <a href="#dml5.3.7"
|
|
shape="rect">5.3.7</a>, <a href="#dml5.3.8"
|
|
shape="rect">5.3.8</a>, <a href="#dml5.3.9"
|
|
shape="rect">5.3.9</a>, <a href="#dml5.3.10"
|
|
shape="rect">5.3.10</a>, <a href="#dml5.3.12"
|
|
shape="rect">5.3.12</a>, <a href="#dml6.4" shape="rect">6.4</a>
|
|
)</li>
|
|
|
|
<li>In <menu> it is a semantic error if dtmf="true" but
|
|
<choice>s have explicitly specified dtmf other than 0,* and
|
|
#. If more than 9 choices without specified dtmf, then no dtmf is
|
|
automatically assigned (no dtmf input can match the choice) but
|
|
no error is generated (<a href="#dml2.2.3"
|
|
shape="rect">2.2.3</a>)</li>
|
|
|
|
<li>use of <enumerate> (<a href="#dml2.2.4"
|
|
shape="rect">2.2.4</a>, <a href="#dml2.3.1"
|
|
shape="rect">2.3.1</a>)</li>
|
|
|
|
<li><grammar> overrides automatically generated grammars in
|
|
<choice> (<a href="#dml2.2.2" shape="rect">2.2.2</a>).</li>
|
|
|
|
<li><choice> expr evaluates to URI to transition to (<a
|
|
href="#dml2.2.2" shape="rect">2.2.2</a>).</li>
|
|
|
|
<li><choice> event handler without control transition,
|
|
causes menu to be re-executed (<a href="#dml2.2.2"
|
|
shape="rect">2.2.2</a>).</li>
|
|
|
|
<li>DTMF sequences specified in the dtmf attributes in
|
|
<choice>, <option> and <link> are equivalent to
|
|
simple DTMF grammars where DTMF properties apply to recognition
|
|
of the sequence. However, unlike grammars, whitespace is optional
|
|
in DTMF sequences (<a href="#dml2.2.2" shape="rect">2.2.2</a>, <a
|
|
href="#dml2.3.1.3" shape="rect">2.3.1.3</a>, <a href="#dml2.5"
|
|
shape="rect">2.5</a>)</li>
|
|
|
|
<li>Clarified that DTMF and speech grammars, but not grammar
|
|
fragments, are allowed in <choice> (<a href="#dml2.2.2"
|
|
shape="rect">2.2.2</a>)</li>
|
|
|
|
<li>For <enumerate>, if no DTMF sequence is assigned to the
|
|
choice element, or if a <grammar> element is specified in
|
|
<choice>, then the _dtmf variable is assigned the
|
|
ECMAScript undefined value (<a shape="rect"
|
|
href="#dml2.2.4">2.2.4</a>)</li>
|
|
|
|
<li>For <enumerate>, the value of _dtmf is a normalized
|
|
representation of the dtmf sequence (i.e. single whitespace
|
|
between DTMF tokens) (<a shape="rect"
|
|
href="#dml2.2.4">2.2.4</a>)</li>
|
|
|
|
<li>Specification of approximate grammar generation in
|
|
<menu> and <choice> (<a href="#dml2.2.5"
|
|
shape="rect">2.2.5</a>)</li>
|
|
|
|
<li>A form item is executed if it is not filled and its cond
|
|
attribute is not specified or evaluates to true (<a
|
|
href="#dml2.3" shape="rect">2.3</a>, <a href="#dml2.3.1"
|
|
shape="rect">2.3.1</a>)</li>
|
|
|
|
<li>Reorganized overview of form items to clarify which
|
|
characteristics apply to which form items. Also indicated that
|
|
the <initial> form item can contain <property> and
|
|
<catch> elements (<a href="#dml2.3"
|
|
shape="rect">2.3</a>)</li>
|
|
|
|
<li>Evaluation of an 'cond' expression takes place after
|
|
conversion to boolean. This affects the 'cond' attribute in form
|
|
items <field>, <block>, <initial>,
|
|
<subdialog>, <object>, <record>, and
|
|
<transfer> (<a href="#dml2.3" shape="rect">2.3</a>);
|
|
<prompt> (<a href="#dml4.1" shape="rect">4.1</a>); and
|
|
<catch> (<a href="#dml5.2.2" shape="rect">5.2.2</a>, <a
|
|
href="#dml5.2.4" shape="rect">5.2.4</a>)</li>
|
|
|
|
<li>Clarified that shadow variables are writeable and can be
|
|
modified by the application. Changed 'application.lastresult$' so
|
|
that it is also writeable and can be modified by the application
|
|
(<a href="#dml2.3" shape="rect">2.3</a>, <a href="#dml5.1.5"
|
|
shape="rect">5.1.5</a> )</li>
|
|
|
|
<li>assignment of field variable when DTMF attribute defined (<a
|
|
href="#dml2.3.1" shape="rect">2.3.1</a>).</li>
|
|
|
|
<li>The name of a field must be unique amongst form item names in
|
|
its form. Variables declared in a <script> element are
|
|
declared in the scope of the containing element of the
|
|
<script> element (<a href="#dml2.3.1"
|
|
shape="rect">2.3.1</a>, <a href="#dml5.3.12"
|
|
shape="rect">5.3.12</a>)</li>
|
|
|
|
<li>form item variable names must respect ECMAScript variable
|
|
naming conventions (<a href="#dml2.3.1" shape="rect">2.3.1</a>,
|
|
<a href="#dml5.1" shape="rect">5.1</a>).</li>
|
|
|
|
<li>If a specified builtin type of <field> is not supported
|
|
by the platform, an error.unsupported.builtin event is thrown. If
|
|
a platform does support builtin types, then it must support all
|
|
the builtin types in a given language (<a href="#dml2.3.1"
|
|
shape="rect">2.3.1</a>, <a href="#dml5.2.6"
|
|
shape="rect">5.2.6</a>, <a href="#dmlABuiltins"
|
|
shape="rect">Appendix P</a>)</li>
|
|
|
|
<li>use of DTMF and speech grammars with "builtin:" URI scheme
|
|
(<a href="#dml2.3.1.2" shape="rect">2.3.1.2</a>).</li>
|
|
|
|
<li>string returned when DTMF input when no "value" or CDATA
|
|
specified in <option> (<a href="#dml2.3.1.3"
|
|
shape="rect">2.3.1.3</a>).</li>
|
|
|
|
<li><option> and <grammar> can be used simultaneously
|
|
to specify grammars in a <field> (<a href="#dml2.3.1.3"
|
|
shape="rect">2.3.1.3</a>).</li>
|
|
|
|
<li>In an <option>, if neither CDATA content nor a dtmf
|
|
sequence is specified, then the default assignment for the value
|
|
attribute is undefined and the field's form item variable is not
|
|
filled (<a shape="rect" href="#dml2.3.1.3">2.3.1.3</a>)</li>
|
|
|
|
<li>In an <option>, the dtmf attribute is optional. if no
|
|
value is specified for the dtmf attribute, then no DTMF sequence
|
|
is associated with the option and hence it cannot be matched by
|
|
DTMF input (<a shape="rect" href="#dml2.3.1.3">2.3.1.3</a>)</li>
|
|
|
|
<li>Normal grammar scoping rules apply when visiting
|
|
<initial>; in particular, no input item grammars are
|
|
active (<a href="#dml2.3.3" shape="rect">2.3.3</a>)</li>
|
|
|
|
<li>Clarified that a form allows multiple <initial>
|
|
elements, and how they are selected for execution (<a
|
|
href="#dml2.3.3" shape="rect">2.3.3</a>, <a href="#dmlAFIA"
|
|
shape="rect">Appendix C</a>)</li>
|
|
|
|
<li>scope of variables in <subdialog> (<a href="#dml2.3.4"
|
|
shape="rect">2.3.4</a>).</li>
|
|
|
|
<li><subdialog> context is independent of its calling
|
|
context (variable instances are not shared) but its context
|
|
follows normal scoping rules for grammars, events, and variables
|
|
(<a href="#dml2.3.4" shape="rect">2.3.4</a>).</li>
|
|
|
|
<li>in <subdialog> use "expr" attribute to set variable if
|
|
no corresponding <param> specified (<a href="#dml2.3.4"
|
|
shape="rect">2.3.4</a>).</li>
|
|
|
|
<li>clarified description of subdialog's execution context (<a
|
|
href="#dml2.3.4" shape="rect">2.3.4</a>)</li>
|
|
|
|
<li>Clarification of how <return> passes data to its
|
|
calling dialog in <subdialog> (<a href="#dml2.3.4"
|
|
shape="rect">2.3.4</a>, <a href="#dml5.3.10"
|
|
shape="rect">5.3.10</a>)</li>
|
|
|
|
<li>Variables in subdialogs are matched to parameters by name and
|
|
in document order; parameter values are evaluated in the context
|
|
of the <param> element (<a href="#dml2.3.4"
|
|
shape="rect">2.3.4</a>)</li>
|
|
|
|
<li>An error.badfetch is thrown when an invalid transition is
|
|
attempted in <subdialog>, <goto> and <submit> .
|
|
The scope in which errors are handled during transitions is
|
|
platform-dependent (<a href="#dml2.3.4" shape="rect">2.3.4</a>,
|
|
<a href="#dml5.3.7" shape="rect">5.3.7</a>, <a href="#dml5.3.8"
|
|
shape="rect">5.3.8</a>)</li>
|
|
|
|
<li>Clarified that a <subdialog> without a <return>
|
|
continues until it encounters a <exit> or until no form
|
|
items remain eligible for the FIA to select (equivalent to an
|
|
<exit>) (<a href="#dml2.3.4" shape="rect">2.3.4</a>)</li>
|
|
|
|
<li>Clarified that a standalone query string is not a valid URI:
|
|
no special handling of them is therefore required in transitional
|
|
URIs specified in <subdialog> and <goto> (<a
|
|
href="#dml2.3.4" shape="rect">2.3.4</a>, <a href="#dml5.3.7"
|
|
shape="rect">5.3.7</a>, <a href="#dml6.1.1"
|
|
shape="rect">6.1.1</a>)</li>
|
|
|
|
<li>If the namelist attribute in <subdialog>,
|
|
<submit>, <clear>, <exit> or <return>
|
|
references an undeclared variable, then an error.semantic event
|
|
is thrown ( <a href="#dml2.3.4" shape="rect">2.3.4</a>, <a
|
|
href="#dml5.3.3" shape="rect">5.3.3</a>, <a href="#dml5.3.8"
|
|
shape="rect">5.3.8</a>, <a href="#dml5.3.9"
|
|
shape="rect">5.3.9</a>, <a href="#dml5.3.10"
|
|
shape="rect">5.3.10</a> )</li>
|
|
|
|
<li>In a <subdialog>, parameters must be declared as
|
|
<var> elements in the form executed as the subdialog or an
|
|
error.semantic will be thrown. (<a shape="rect"
|
|
href="#dml2.3.4">2.3.4</a>, <a shape="rect"
|
|
href="#dml6.4">6.4</a>)</li>
|
|
|
|
<li>Clarified that an <object> itself is responsible for
|
|
determining whether a parameter name or value it receives is
|
|
invalid. If so, an error is thrown (it may be a standard error or
|
|
an object-specific error) (<a href="#dml2.3.5"
|
|
shape="rect">2.3.5</a>)</li>
|
|
|
|
<li>user hangup during recording terminates recording normally;
|
|
data recorded prior to hangup can be returned to server (<a
|
|
href="#dml2.3.6" shape="rect">2.3.6</a>).</li>
|
|
|
|
<li>interpretation of grammars in <record> (<a
|
|
href="#dml2.3.6" shape="rect">2.3.6</a>).</li>
|
|
|
|
<li>field variable in <record> is a reference to recorded
|
|
audio. When submitting recorded data to a server, the "enctype"
|
|
of <submit> should be set to "multipart/form-data" (<a
|
|
href="#dml2.3.6" shape="rect">2.3.6</a>, <a href="#dml5.3.8"
|
|
shape="rect">5.3.8</a>).</li>
|
|
|
|
<li>Clarification of behavior when <record> dtmfterm
|
|
attribute set to false and DTMF input received (<a
|
|
href="#dml2.3.6" shape="rect">2.3.6</a>)</li>
|
|
|
|
<li>Clarification of when recording starts and behavior when
|
|
recording terminated before any audio data is collected (<a
|
|
href="#dml2.3.6" shape="rect">2.3.6</a>)</li>
|
|
|
|
<li>Clarified that how the <record> variable is implemented
|
|
may differ between platforms (although all platforms must support
|
|
its specified behavior in <audio> and <submit> (<a
|
|
href="#dml2.3.6" shape="rect">2.3.6</a>)</li>
|
|
|
|
<li>Clarified that the finalsilence and maxtime attributes of
|
|
<record> default to platform-specific values (<a
|
|
href="#dml2.3.6" shape="rect">2.3.6</a>)</li>
|
|
|
|
<li>During execution of the <record> element, if no audio
|
|
is collected before the user terminates recording with DTMF input
|
|
matching a local DTMF grammar (or when the dtmfterm attribute is
|
|
set to true), then the record variable is not filled (so shadow
|
|
variables are not set), and the FIA applies as normal without a
|
|
noinput event being thrown. However, information about the input
|
|
may be available in these situations via application.lastresult$
|
|
as described in Section 5.1.5. (<a href="#dml2.3.6"
|
|
shape="rect">2.3.6</a>)</li>
|
|
|
|
<li>In the <record> element, the dtmfterm attribute has
|
|
priority over specified local DTMF grammars (<a shape="rect"
|
|
href="#dml2.3.6">2.3.6</a>)</li>
|
|
|
|
<li>In <record>, no audio may be collected if DTMF or
|
|
speech input is received during prompt playback or <i>before</i>
|
|
the timeout interval <i>expires</i> (<a shape="rect"
|
|
href="#dml2.3.6">2.3.6</a>)</li>
|
|
|
|
<li>termination of <transfer> by speech or DTMF returns
|
|
near_end_disconnect status (<a href="#dml2.3.7"
|
|
shape="rect">2.3.7</a>).</li>
|
|
|
|
<li>value of "dest" attribute on <transfer> (<a
|
|
href="#dml2.3.7" shape="rect">2.3.7</a>).</li>
|
|
|
|
<li>the form item variable of <transfer> is undefined for
|
|
blind transfer (<a href="#dml2.3.7" shape="rect">2.3.7</a>).</li>
|
|
|
|
<li>Revision of <transfer> including: error events when
|
|
platform unable to handle 'dest'/'destexpr' URI; clarification
|
|
that platform is disconnected immediately when blind transfer
|
|
takes place; specification of events to be thrown if platform
|
|
cannot perform blind or bridged transfer; clarification that the
|
|
connection status is not available for blind transfer (although
|
|
some error conditions may be reported) ; transferaudio is ignored
|
|
for blind transfer; clarification of audio playback before and
|
|
during bridged transfer, including situation where transferaudio
|
|
ends before connection established and that queued audio is
|
|
flushed before starting transfer; clarification of timings for
|
|
listening for input and playback of audio; added name$.inputmode
|
|
and name$.utterance shadow variables; clarified that platform
|
|
support for listening for input during transfer is optional; (<a
|
|
href="#dml2.3.7" shape="rect">2.3.7</a>, <a href="#dml5.2.6"
|
|
shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>The bargeintype on bridged <transfer> is fixed to
|
|
"hotword" for the duration of the outgoing call (<a
|
|
href="#dml2.3.7" shape="rect">2.3.7</a>)</li>
|
|
|
|
<li>Platforms supporting either blind or bridged <transfer>
|
|
may support bargein input modes of DTMF, speech, or both, during
|
|
the call transfer to drop the far-end. In both blind and bridged
|
|
transfer, if the transfer was not terminated by a grammar match,
|
|
the shadow variable <i>name</i>$.inputmode is undefined. Blind
|
|
transfer attempts can only be cancelled up to the point the
|
|
outgoing call begins. In blind transfer, the format of
|
|
platform-specific error conditions should follow the naming
|
|
convention of other transfer form item variable values. The
|
|
caller can cancel a blind transfer attempt before the outgoing
|
|
call begins by barging in with a speech or DTMF command that
|
|
matches an active grammar during the playback of any queued
|
|
audio; in this case the form item variable is set, its shadow
|
|
variables are set as is application.lastresult$. If the caller
|
|
disconnects by hanging up during a blind transfer attempt before
|
|
the connection to the callee begins, a
|
|
connection.disconnect.hangup event will be thrown, and dialog
|
|
execution will transition to a handler for the hangup event. The
|
|
form item variable, and thus shadow variables, will not be set.
|
|
If the caller cancels the blind transfer attempt via a DTMF or
|
|
voice command before the outgoing call begins (during playback of
|
|
queued audio), the form item variable is set to
|
|
'near_end_disconnect'. In bridged transfer, the caller can cancel
|
|
the transfer attempt before the outgoing call begins by barging
|
|
in with a speech or DTMF command that matches an active grammar
|
|
during the playback of any queued audio. (<a shape="rect"
|
|
href="#dml2.3.7">2.3.7</a>)</li>
|
|
|
|
<li>Clarified that <transfer> variable and shadow variables
|
|
are not set if caller hangs up during call transfer or a call
|
|
transfer attempt. If a call is terminated by the caller with a
|
|
voice or DTMF command prior to the call being answered, the
|
|
duration shadow variable is set to 0 (<a href="#dml2.3.7.2.2"
|
|
shape="rect">2.3.7.2.2</a>)</li>
|
|
|
|
<li>Clarified that <transfer> utterance shadow variable is
|
|
set to the DTMF result if the transfer was terminated by DTMF
|
|
input (<a href="#dml2.3.7.2.2" shape="rect">2.3.7.2.2</a>)</li>
|
|
|
|
<li>Addressed situation in a bridged transfer where caller forces
|
|
callee to disconnect via DTMF or voice command before the
|
|
connection is established: (<a href="#dml2.3.7.2.2"
|
|
shape="rect">2.3.7.2.2</a>)</li>
|
|
|
|
<li>In <transfer>, the shadow variable name$.inputmode is
|
|
undefined if the transfer was not terminated by a grammar match.
|
|
(<a shape="rect" href="#dml2.3.7.2.2">2.3.7.2.2</a>)</li>
|
|
|
|
<li>Upon encountering a document containing a <filled>
|
|
element specifying either a 'mode' or 'namelist' attribute as a
|
|
child of an input item, then an error.badfetch is thrown by the
|
|
platform. In addition, an error.badfetch is thrown when the
|
|
document contains a <filled> element with a namelist
|
|
attribute referencing a control item variable (<a shape="rect"
|
|
href="#dml2.4">2.4</a>)</li>
|
|
|
|
<li><link>s have zero or more grammars (<a href="#dml2.5"
|
|
shape="rect">2.5</a>).</li>
|
|
|
|
<li>events throw by a <link> are handled by the best
|
|
qualified <catch> in active scope (<a href="#dml2.5"
|
|
shape="rect">2.5</a>).</li>
|
|
|
|
<li><link> can be a child of the form items <field>
|
|
and <initial> only (<a href="#dml2.5"
|
|
shape="rect">2.5</a>)</li>
|
|
|
|
<li>Clarified that a "scope" attribute on the element containing
|
|
a <link> element has no effect on the scope of the
|
|
<link>s grammars (<a href="#dml2.5"
|
|
shape="rect">2.5</a>)</li>
|
|
|
|
<li>Clarified that in <link>, any URIs in its content (e.g.
|
|
<grammar>s) are evaluated/resolved where the <link>
|
|
is defined, while any URIs and ECMAScript expressions in its
|
|
attributes are evaluated/resolved in the active dialog scope and
|
|
context (<a href="#dml2.5" shape="rect">2.5</a>)</li>
|
|
|
|
<li>In a <link>, grammars are not allowed to specify scope
|
|
as described in <a shape="rect" href="#dml3.1.3">3.1.3</a> (<a
|
|
shape="rect" href="#dml2.5">2.5</a>)</li>
|
|
|
|
<li>If execution is in a modal form item, then link grammars at
|
|
the application level are not active (<a shape="rect"
|
|
href="#dml2.5">2.5</a>)</li>
|
|
|
|
<li>"xml:lang" attribute in <grammar> does not require
|
|
multi-lingual support from platform (<a href="#dml3.1"
|
|
shape="rect">3.1</a>)</li>
|
|
|
|
<li>unsupported grammar language results in
|
|
error.unsupported.language event being thrown (<a
|
|
href="#dml3.1.1" shape="rect">3.1.1</a>)</li>
|
|
|
|
<li>unsupported language can be indicated in the message variable
|
|
of a <throw> (<a href="#dml3.1.1"
|
|
shape="rect">3.1.1</a>).</li>
|
|
|
|
<li>'number' results as a string which ECMAScript will
|
|
automatically convert to a number in a numerical expression;
|
|
string must not use a leading zero (<a href="#dml3.1.1"
|
|
shape="rect">3.1.1</a>)</li>
|
|
|
|
<li>Clarified that the SRGS <grammar> element is extended
|
|
in VoiceXML 2.0 to allow PCDATA for inline grammar formats
|
|
besides the XML format of SRGS ( <a href="#dml3.1.1"
|
|
shape="rect">3.1.1</a>, <a href="#dml3.1.1.4"
|
|
shape="rect">3.1.1.4</a> )</li>
|
|
|
|
<li>implicit grammars (such as options) do not support weights
|
|
(<a href="#dml3.1.1.3" shape="rect">3.1.1.3</a>).</li>
|
|
|
|
<li>The type attribute in <grammar> takes precedence over
|
|
other possible source of media type; if specified, and in
|
|
conflict with the type of the grammar, then an error is thrown
|
|
(<a href="#dml3.1.1.2" shape="rect">3.1.1.2</a>, <a
|
|
href="#dml3.1.1.4" shape="rect">3.1.1.4</a>)</li>
|
|
|
|
<li>Clarified the use and interpretation of <grammar>
|
|
attributes inherited from SRGS (version, xml:lang, mode, root,
|
|
tag-format, xml:base). Inline XML SRGS grammars follow the
|
|
behavior specified in SRGS. For inline ABNF SRGS grammars as well
|
|
as external ABNF and XML SRGS grammars the platform must ignore
|
|
these attributes. For all other grammar types, the use and
|
|
interpretation of these attributes is platform-dependent (<a
|
|
href="#dml3.1.1.4" shape="rect">3.1.1.4</a>)</li>
|
|
|
|
<li>Clarified that the root rule in SRGS grammars does not have
|
|
to be a public rule (<a href="#dml3.1.1.4"
|
|
shape="rect">3.1.1.4</a>)</li>
|
|
|
|
<li>The forms of rule reference defined by SRGS that are not
|
|
supported in VoiceXML 2.0 only apply when referencing external
|
|
grammars using 'src' attribute (<a shape="rect"
|
|
href="#dml3.1.1.4">3.1.1.4</a>)</li>
|
|
|
|
<li>Clarified the distinction between form-level and field-level
|
|
grammars (<a href="#dml3.1.6" shape="rect">3.1.6</a>, <a
|
|
href="#dml3.1.6.1" shape="rect">3.1.6.1</a>, <a
|
|
href="#dml3.1.6.2" shape="rect">3.1.6.2</a> )</li>
|
|
|
|
<li>"slot" can select properties at arbitrary levels of nesting
|
|
using dot-separated list; removed text suggesting that array
|
|
indexing expressions (e.g. "pizza.toppings[3]") are supported (<a
|
|
href="#dml3.1.6.1" shape="rect">3.1.6.1</a>)</li>
|
|
|
|
<li>Clarified that matching form-level grammars can override
|
|
existing values in input items and that <filled> processing
|
|
of these items takes place as described <a href="#dml2.4"
|
|
shape="rect">Section 2.4</a> and <a href="#dmlAFIA"
|
|
shape="rect">Appendix C</a> (<a href="#dml3.1.6.1"
|
|
shape="rect">3.1.6.1</a>)</li>
|
|
|
|
<li>Aligned description of DTMF grammar with that of speech
|
|
grammars: DTMF grammars can return a set of attribute-value pairs
|
|
as well as a string value (<a href="#dml3.1.2"
|
|
shape="rect">3.1.2</a>)</li>
|
|
|
|
<li>If a document contains a grammar specifying a scope and that
|
|
grammar is contained a field, in a <link> or in a menu
|
|
<choice>, then error.badfetch is thrown (<a
|
|
href="#dml3.1.3" shape="rect">3.1.3</a>)</li>
|
|
|
|
<li>If no grammars are active when input is expected in a
|
|
<form> or <menu>, an error.semantic event is thrown
|
|
(<a href="#dml3.1.4" shape="rect">3.1.4</a>)</li>
|
|
|
|
<li>The inputmodes property does not affect grammar activation
|
|
(<a href="#dml3.1.4" shape="rect">3.1.4</a>, <a href="#dml6.3.6"
|
|
shape="rect">6.3.6</a>)</li>
|
|
|
|
<li>If the input matches more than one active grammar with the
|
|
same precedence, then the first grammar in document order has
|
|
highest priority. (<a shape="rect"
|
|
href="#dml3.1.4">3.1.4</a>)</li>
|
|
|
|
<li>ongoing work on semantic attachments within <grammar>
|
|
(<a href="#dml3.1.5" shape="rect">3.1.5</a>)</li>
|
|
|
|
<li>Input item variables can be set by semantic results from
|
|
other input items (<a shape="rect"
|
|
href="#dml3.1.6">3.1.6</a>)</li>
|
|
|
|
<li>The default values for a <prompt>'s "bargein" and
|
|
"bargeintype" attributes are determined by the "bargein" and
|
|
"bargeintype" properties (<a href="#dml4.1"
|
|
shape="rect">4.1</a>)</li>
|
|
|
|
<li>Clarified that a time designator is a non-negative number
|
|
which must be followed by ms or s. Clarified that the following
|
|
attributes take time designators as their value: <prompt> -
|
|
timeout; <transfer> - maxtime (NB: default is now "0s"),
|
|
connecttimeout; <record> - maxtime, finalsilence. Clarified
|
|
that the following properties have time designator values:
|
|
fetchtimeout, completetimeout, incompletetimeout,
|
|
maxspeechtimeout, interdigittimeout, termtimeout, timeout,
|
|
fetchaudiodelay, fetchaudiominimum, fetchtimeout ( <a
|
|
href="#dml4.1" shape="rect">4.1</a>, <a href="#dml2.3.6"
|
|
shape="rect">2.3.6</a>, <a href="#dml2.3.7"
|
|
shape="rect">2.3.7</a>, <a href="#dml6.1.1"
|
|
shape="rect">6.1.1</a>, <a href="#dml6.3"
|
|
shape="rect">6.3</a>)</li>
|
|
|
|
<li>"xml:lang" attribute in <prompt> does not require
|
|
multi-lingual support from platform (<a href="#dml4.1.1"
|
|
shape="rect">4.1.1</a>)</li>
|
|
|
|
<li>unsupported synthesis language results in
|
|
error.unsupported.language event being thrown (<a
|
|
href="#dml4.1.1" shape="rect">4.1.1</a>).</li>
|
|
|
|
<li>enclosing <prompt> required if text contains speech
|
|
synthesis markup (<a href="#dml4.1.2"
|
|
shape="rect">4.1.2</a>).</li>
|
|
|
|
<li>When prompt content is specified without an explicit
|
|
<prompt> element then the prompt attributes are defined as
|
|
specified in the table in Section 4.1 (<a shape="rect"
|
|
href="#dml4.1.2">4.1.2</a>)</li>
|
|
|
|
<li>'alternate content' in <audio> (<a href="#dml4.1.3"
|
|
shape="rect">4.1.3</a>).</li>
|
|
|
|
<li>When <audio> 'expr' evaluates to ECMAScript undefined,
|
|
the content of the element ignored. If it evaluates to an invalid
|
|
URI, or the format is unsupported, etc, then the fallback
|
|
strategy is invoked (<a href="#dml4.1.3"
|
|
shape="rect">4.1.3</a>)</li>
|
|
|
|
<li>It is a platform optimization to stream audio in
|
|
<audio> (<a href="#dml4.1.3" shape="rect">4.1.3</a>)</li>
|
|
|
|
<li>Clarified that the expr attribute of <audio> is an
|
|
ECMAScript expression which references a previously
|
|
<record>ed audio, or evaluates to the URI of an audio
|
|
resource to fetch (<a href="#dml4.1.3"
|
|
shape="rect">4.1.3</a>)</li>
|
|
|
|
<li>stand-alone <value> element is legal outside
|
|
<prompt> (<a href="#dml4.1.4" shape="rect">4.1.4</a>).</li>
|
|
|
|
<li>Simplified evaluation of expr in <audio> so that it is
|
|
not treated specially: it is CDATA where XML special characters
|
|
do not need to be escaped. It is not treated as an SSML document,
|
|
or a document fragment. (<a href="#dml4.1.4"
|
|
shape="rect">4.1.4</a>)</li>
|
|
|
|
<li>buffered DTMF input is deleted when "bargein" is false on
|
|
<prompt> (<a href="#dml4.1.5" shape="rect">4.1.5</a>).</li>
|
|
|
|
<li>Clarified behavior when bargein occurs during a sequence of
|
|
prompts (<a href="#dml4.1.5" shape="rect">4.1.5</a>)</li>
|
|
|
|
<li>Clarified that when a prompt's "bargein" attribute is false,
|
|
no input is buffered while the prompt is playing (any DTMF
|
|
already buffered is discarded) (<a href="#dml4.1.5"
|
|
shape="rect">4.1.5</a>)</li>
|
|
|
|
<li>The "bargeintype" attribute of <prompt> applies to DTMF
|
|
input as well as speech input (<a href="#dml4.1.5.1"
|
|
shape="rect">4.1.5.1</a>)</li>
|
|
|
|
<li>When the bargeintype is speech, the prompt is stopped
|
|
irrespective of which grammars are active (<a shape="rect"
|
|
href="#dml4.1.5.1">4.1.5.1</a>)</li>
|
|
|
|
<li>With the hotword bargeintype, input not matching a grammar is
|
|
ignored even during the timeout period (<a shape="rect"
|
|
href="#dml4.1.5.1">4.1.5.1</a>)</li>
|
|
|
|
<li>Prompt counter are also maintained for <initial> items
|
|
in a form (<a href="#dml4.1.6" shape="rect">4.1.6</a>)</li>
|
|
|
|
<li>In prompt selection, whenever the system selects a given
|
|
input item in the select phase of FIA and the FIA performs normal
|
|
selection and queuing of prompts, the input item's associated
|
|
prompt counter is incremented (<a shape="rect"
|
|
href="#dml4.1.6">4.1.6</a>)</li>
|
|
|
|
<li>Clarified that each <prompt> has its own timeout value
|
|
and that a <prompt>'s timeout attribute defaults to the
|
|
timeout property when the prompt is queued (<a href="#dml4.1.7"
|
|
shape="rect">4.1.7</a>)</li>
|
|
|
|
<li>relationship between prompt queueing and input collection (<a
|
|
href="#dml4.1.8" shape="rect">4.1.8</a>).</li>
|
|
|
|
<li>Asychronous events unrelated to transition execution (e.g.
|
|
disconnect) are buffered until waiting state before being thrown
|
|
(<a href="#dml4.1.8" shape="rect">4.1.8</a>)</li>
|
|
|
|
<li>Clarified mapping between interpreter states and FIA; and
|
|
that activation of grammars and waiting for input occur
|
|
simultaneously with playback of prompts (<a href="#dml4.1.8"
|
|
shape="rect">4.1.8</a>)</li>
|
|
|
|
<li>Clarified that when a prompt bargein attribute is false,
|
|
input is not collected and DTMF buffered in the transition state
|
|
is deleted as described in 4.1.5 (<a href="#dml4.1.8"
|
|
shape="rect">4.1.8</a>)</li>
|
|
|
|
<li>Platforms may differ in whether or not they discard buffered
|
|
non-matching DTMF when an ASR grammar matches input (<a
|
|
href="#dml4.1.8" shape="rect">4.1.8</a>)</li>
|
|
|
|
<li>VoiceXML and ECMAScript variables are part of the same
|
|
variable space;variables declared in ECMAScript can be used
|
|
directly in VoiceXML (<a href="#dml5.1"
|
|
shape="rect">5.1</a>).</li>
|
|
|
|
<li>VoiceXML variable names, including field names, must follow
|
|
ECMAScript naming rules; variable name declarations cannot
|
|
contain a dot; the field name "a.b" is illegal (<a href="#dml5.1"
|
|
shape="rect">5.1</a>).</li>
|
|
|
|
<li>VoiceXML variables and variable scoping follows ECMAScript
|
|
scope chains; as a consequence, references to undeclared
|
|
ECMAScript variables result in error.semantic being thrown (<a
|
|
href="#dml5.1.1" shape="rect">5.1.1</a>, <a href="#dml5.1.2"
|
|
shape="rect">5.1.2</a>)</li>
|
|
|
|
<li>scope of variables (<a href="#dml5.1.2"
|
|
shape="rect">5.1.2</a>).</li>
|
|
|
|
<li>Clarified application and document scoping of variables in
|
|
application root documents (<a href="#dml5.1.2"
|
|
shape="rect">5.1.2</a>)</li>
|
|
|
|
<li>Dialog scope contains form item variables, not the variables
|
|
defined within each form item (<a href="#dml5.1.2"
|
|
shape="rect">5.1.2</a>)</li>
|
|
|
|
<li>only some cond operators need to be escaped (<a
|
|
href="#dml5.1.3" shape="rect">5.1.3</a>).</li>
|
|
|
|
<li>Clarified that a document with a variable x but without a
|
|
specified application root, then the variable can be referenced
|
|
as application.x and document.x (<a href="#dml5.1.3"
|
|
shape="rect">5.1.3</a>)</li>
|
|
|
|
<li>Clarified that "application.lastresult$" is an ECMAScript
|
|
array (<a href="#dml5.1.5" shape="rect">5.1.5</a>)</li>
|
|
|
|
<li>Clarification on persistence of lastresult application
|
|
variable. (<a href="#dml5.1.5" shape="rect">5.1.5</a>)</li>
|
|
|
|
<li>Interpretations in lastresult are ordered first by
|
|
confidence, and then by scope precedence of grammars (<a
|
|
href="#dml5.1.5" shape="rect">5.1.5</a>, <a href="#dml2.3.1"
|
|
shape="rect">2.3.1</a>, <a href="#dml3.1.4"
|
|
shape="rect">3.1.4</a>)</li>
|
|
|
|
<li>When a DTMF grammar is matched, the interpretation variable
|
|
of application.lastresult contains the matched digit string. (<a
|
|
href="#dml5.1.5" shape="rect">5.1.5</a>)</li>
|
|
|
|
<li>After a <nomatch>, application.lastresult$ is be set
|
|
but the values are platform-dependent (<a shape="rect"
|
|
href="#dml5.1.5">5.1.5</a>)</li>
|
|
|
|
<li>evaluation of relative URIs against active document (<a
|
|
href="#dml5.2" shape="rect">5.2</a>).</li>
|
|
|
|
<li>Clarified that catch elements use the innermost property of
|
|
the element where the event originated, not where the catch is
|
|
defined (<a href="#dml5.2" shape="rect">5.2</a>)</li>
|
|
|
|
<li>VoiceXML does not generally specify when events are thrown
|
|
(<a href="#dml5.2.1" shape="rect">5.2.1</a>).</li>
|
|
|
|
<li>Event counters associated with <catch>s are incremented
|
|
when an event occurs with same full or prefix matching name; this
|
|
affects selection of the catch handler with the
|
|
'correct count' in Section 5.2.4 (<a href="#dml5.2.2"
|
|
shape="rect">5.2.2</a>)</li>
|
|
|
|
<li>definition of "event" and "count" attributes of <catch>
|
|
(<a href="#dml5.2.2" shape="rect">5.2.2</a>).</li>
|
|
|
|
<li>no inherent limitations on <catch> in, for example,
|
|
case of user hangup (<a href="#dml5.2.2"
|
|
shape="rect">5.2.2</a>).</li>
|
|
|
|
<li><catch>'s event may be the string "." indicating that
|
|
all events are to be caught (<a href="#dml5.2.2"
|
|
shape="rect">5.2.2</a>).</li>
|
|
|
|
<li><catch> without a specified event attribute is
|
|
equivalent to one with event="." (<a href="#dml5.2.2"
|
|
shape="rect">5.2.2</a>, <a href="#dml5.2.4"
|
|
shape="rect">5.2.4</a>)</li>
|
|
|
|
<li>Clarified when form event counters are incremented and reset
|
|
(<a href="#dml5.2.2" shape="rect">5.2.2</a>)</li>
|
|
|
|
<li><catch> applies to form items except for blocks (<a
|
|
shape="rect" href="#dml5.2.2">5.2.2</a>)</li>
|
|
|
|
<li>"as if by copy" catch inheritance (<a href="#dml5.2"
|
|
shape="rect">5.2</a>, <a href="#dml5.2.4"
|
|
shape="rect">5.2.4</a>).</li>
|
|
|
|
<li>catch element selection algorithm (<a href="#dml5.2.4"
|
|
shape="rect">5.2.4</a>).</li>
|
|
|
|
<li>defined prefix match as token match rather than string match
|
|
(<a href="#dml5.2.4" shape="rect">5.2.4</a>).</li>
|
|
|
|
<li>In the <catch> element, an event attribute with an
|
|
empty string value is syntactically invalid. To catch all events,
|
|
the event attribute can be omitted, or specified as "." to prefix
|
|
match all events (<a href="#dml5.2.4"
|
|
shape="rect">5.2.4</a>)</li>
|
|
|
|
<li>"error.badfetch" pre-defined error type (<a href="#dml5.2.6"
|
|
shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>error.badfetch is thrown until the document is ready for
|
|
execution; whether variable initiation is part of execution is
|
|
platform-dependent (<a href="#dml5.2.6"
|
|
shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>Clarification of situations in which 'error.badfetch' is
|
|
thrown. A conforming browser may also throw events whose name
|
|
extends pre-defined events (<a href="#dml5.2.6"
|
|
shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>Application-specific and platform-specific event types should
|
|
use the reversed Internet domain name convention to avoid naming
|
|
conflicts (<a href="#dml5.2.6" shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>HTTPS is not the same protocol as HTTP (<a href="#dml5.2.6"
|
|
shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>Errors raised in the first document in a session, and errors
|
|
raised before entering the FIA in subsequent loaded documents are
|
|
handled in a platform-specific manner (<a href="#dml5.2.6"
|
|
shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>Removed 'divide by 0' as a run-time error which results in
|
|
error.semantic being thrown (ECMAScript does not report an error)
|
|
(<a href="#dml5.2.6" shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>Clarified that the event error.noauthorization is thrown in
|
|
more circumstances than just connection authorization failures
|
|
(<a href="#dml5.2.6" shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>Clarified that the event error.unsupport.<i>element</i> is
|
|
only thrown for VoiceXML 2.0 elements (<a href="#dml5.2.6"
|
|
shape="rect">5.2.6</a>)</li>
|
|
|
|
<li>The name attribute of a <var> element specifies a
|
|
variable without a scope prefix. If it specifies a variable with
|
|
a scope prefix, then an error.semantic event is thrown (<a
|
|
shape="rect" href="#dml5.3.1">5.3.1</a>)</li>
|
|
|
|
<li>Clarified that an error.semantic event is thrown if an
|
|
attempt is made to assign to an undeclared variable. Properties
|
|
of ECMAScript objects, e.g. o.foo, can be assigned directly;
|
|
attempting to declare them results in an error.semantic event
|
|
being thrown (<a href="#dml5.3.2" shape="rect">5.3.2</a>)</li>
|
|
|
|
<li>The name attribute of an <assign> element must
|
|
reference a variable which has been previously declared otherwise
|
|
an error.semantic event is thrown. By default, the scope in which
|
|
the variable is resolved is the closest enclosing scope of the
|
|
currently active element. To remove ambiguity, the variable name
|
|
may be prefixed with a scope name (<a shape="rect"
|
|
href="#dml5.3.2">5.3.2</a>)</li>
|
|
|
|
<li>The namelist of <clear> may specify variables other
|
|
than form item variables which are to be reset (<a
|
|
href="#dml5.3.3" shape="rect">5.3.3</a>)</li>
|
|
|
|
<li>The variable references in <clear>'s namelist are
|
|
resolved relative to the current scope according to Section 5.1.3
|
|
(<a href="#dml5.3.3" shape="rect">5.3.3</a>)</li>
|
|
|
|
<li>effect of <reprompt> in catch elements (<a
|
|
href="#dml5.3.6" shape="rect">5.3.6</a>)</li>
|
|
|
|
<li>behaviour of <reprompt> when in <catch> with
|
|
final <goto> (<a href="#dml5.3.6"
|
|
shape="rect">5.3.6</a>)</li>
|
|
|
|
<li>FIA performs normal prompt queueing after the execution of
|
|
catch elements when they end with a <submit> or
|
|
<return> as well as <goto> (<a href="#dml5.3.6"
|
|
shape="rect">5.3.6</a>, <a href="#dmlAFIA" shape="rect">Appendix
|
|
C</a>)</li>
|
|
|
|
<li>Clarified that a <reprompt> element has no effect
|
|
outside of a catch (<a href="#dml5.3.6"
|
|
shape="rect">5.3.6</a>)</li>
|
|
|
|
<li>effect of URI in <goto> on document variables (<a
|
|
href="#dml5.3.7" shape="rect">5.3.7</a>)</li>
|
|
|
|
<li>Clarified for <goto> that errors which occur during
|
|
form item transition, the event is handled in the dialog scope
|
|
(<a href="#dml5.3.7" shape="rect">5.3.7</a>)</li>
|
|
|
|
<li>When nextitem or expritem in <goto> reference an
|
|
non-existent form item, an error.badfetch event is thrown (<a
|
|
href="#dml5.3.7" shape="rect">5.3.7</a>)</li>
|
|
|
|
<li>variables declared in VoiceXML or ECMAScript can be submitted
|
|
(<a href="#dml5.3.8" shape="rect">5.3.8</a>).</li>
|
|
|
|
<li>Clarified some of the circumstances in which <submit>
|
|
can be satisfied by intermediate caches (<a href="#dml5.3.8"
|
|
shape="rect">5.3.8</a>)</li>
|
|
|
|
<li>In the <submit> element, the enctype attribute is only
|
|
relevant for when the method attribute is set to "post" (<a
|
|
shape="rect" href="#dml5.3.8">5.3.8</a>)</li>
|
|
|
|
<li><exit> does not throw an "exit" event (<a
|
|
href="#dml5.3.9" shape="rect">5.3.9</a>)</li>
|
|
|
|
<li>The value of the 'expr' attribute of <exit> is an
|
|
ECMAScript expression (<a href="#dml5.3.9"
|
|
shape="rect">5.3.9</a>)</li>
|
|
|
|
<li>Executing <disconnect/> causes the interpreter to (a)
|
|
enter the final processing state and (b) flush the prompt queue
|
|
(<a shape="rect" href="#dml5.3.11">5.3.11</a>)</li>
|
|
|
|
<li>no "type" attribute of <script> (<a href="#dml5.3.12"
|
|
shape="rect">5.3.12</a>).</li>
|
|
|
|
<li><script> evaluated along with <var> elements and
|
|
form item variables in <form> (<a href="#dml5.3.12"
|
|
shape="rect">5.3.12</a>)</li>
|
|
|
|
<li>definition of "charset" in <script> (<a
|
|
href="#dml5.3.12" shape="rect">5.3.12</a>)</li>
|
|
|
|
<li>Handling of <log> is platform-dependent (<a
|
|
href="#dml5.3.13" shape="rect">5.3.13</a>)</li>
|
|
|
|
<li>The label and expr attributes of the <log> element are
|
|
optional. (<a shape="rect" href="#dml5.3.13">5.3.13</a>)</li>
|
|
|
|
<li>revised prefetch (<a href="#dml6.1"
|
|
shape="rect">6.1</a>)</li>
|
|
|
|
<li>effect of "fetchhint" attribute (<a href="#dml6.1.1"
|
|
shape="rect">6.1.1</a>)</li>
|
|
|
|
<li>caching policy selection (<a href="#dml6.1.2"
|
|
shape="rect">6.1.2</a>)</li>
|
|
|
|
<li>caching follows HTTP 1.1 cache correctness rules (<a
|
|
href="#dml6.1.2" shape="rect">6.1.2</a>)</li>
|
|
|
|
<li>Clarified that there is no markup mechanism to control the
|
|
caching of application root documents (<a href="#dml6.1.2.1"
|
|
shape="rect">6.1.2.1</a>)</li>
|
|
|
|
<li>Clarified that first type of <meta> is expressed by the
|
|
attributes name and content, and the second type by http-equiv
|
|
and content (<a href="#dml6.2.1" shape="rect">6.2.1</a>)</li>
|
|
|
|
<li>When different values for a <property> are specified at
|
|
the same level, the last one in document order applies (<a
|
|
href="#dml6.3" shape="rect">6.3</a>)</li>
|
|
|
|
<li>Properties can be set in field input items but not control
|
|
items (<a href="#dml6.3" shape="rect">6.3</a>)</li>
|
|
|
|
<li>Clarified that if a platform detects a property has illegal
|
|
value, then it should throw an error.semantic (<a href="#dml6.3"
|
|
shape="rect">6.3</a>)</li>
|
|
|
|
<li>format of platform-specific properties (<a href="#dml6.3.1"
|
|
shape="rect">6.3.1</a>)</li>
|
|
|
|
<li>definitions of "completetimeout" and "incompletetimeout"
|
|
speech recognizer properties (<a href="#dml6.3.2"
|
|
shape="rect">6.3.2</a>)</li>
|
|
|
|
<li>Universal commands grammars are always active except in the
|
|
case of modal input items (<a href="#dml6.3.6"
|
|
shape="rect">6.3.6</a>)</li>
|
|
|
|
<li>Parameter values passed to <subdialog>s are always data
|
|
(<a href="#dml6.4" shape="rect">6.4</a>)</li>
|
|
|
|
<li>definition of time designation values (<a href="#dml6.5"
|
|
shape="rect">6.5</a>)</li>
|
|
|
|
<li>Clarified that the number format is that used in CSS2, and
|
|
that the value of the ASR properties confidencelevel,
|
|
sensitivity, and speedvsaccuracy are in this format (<a
|
|
href="#dml6.5" shape="rect">6.5</a>, <a href="#dml6.3.2"
|
|
shape="rect">6.3.2</a>)</li>
|
|
|
|
<li>Restricted field names, name attribute in <var> and
|
|
nextitem attribute in <goto> to NMTOKEN; extended name
|
|
attribute in <assign> to be like NMTOKEN but also allow '$'
|
|
(for shadow variable assignments); restricted namelist attribute
|
|
in <filled> to NMTOKENS; extended namelist attribute in
|
|
<exit>, <submit>, <clear>, and <return>
|
|
to be like NMTOKENS but allow '$' (for shadow variable
|
|
submissions) (<a href="#dmlADTD" shape="rect">Appendix B</a>, <a
|
|
href="#dmlASchema" shape="rect">Appendix O</a>)</li>
|
|
|
|
<li>Restricted the content model of <choice> to PCDATA and
|
|
<grammar> elements; clarified that <enumerate> cannot
|
|
occur inside another <enumerate> (<a href="#dmlADTD"
|
|
shape="rect">Appendix B</a>, <a href="#dmlASchema"
|
|
shape="rect">Appendix O</a>, <a href="#dml2.2.4"
|
|
shape="rect">2.2.4</a>)</li>
|
|
|
|
<li>Clarified that the DTD (unlike the schema) cannot correctly
|
|
express that the <metadata> element can contain elements
|
|
from other XML namespaces (<a href="#dmlADTD"
|
|
shape="rect">Appendix B</a>)</li>
|
|
|
|
<li>The DTD specifies the xmlns attribute of <vxml> as
|
|
FIXED and has the default value 'http://www.w3.org/2001/vxml' (<a
|
|
shape="rect" href="#dmlADTD">Appendix B</a>)</li>
|
|
|
|
<li>Aligned DTD and schema with text so that accept attribute on
|
|
<choice> does not default to 'exact' if unspecified (<a
|
|
shape="rect" href="#dmlADTD">Appendix B</a>, <a shape="rect"
|
|
href="#dmlASchema">Appendix O</a>)</li>
|
|
|
|
<li>FIA clarified that application.lastresult$ assignment happens
|
|
after every successful recognition (<a href="#dmlAFIA"
|
|
shape="rect">Appendix C</a>)</li>
|
|
|
|
<li>FIA clarified for matching <link> grammars inside the
|
|
current form or menu and for matching menu <choice>
|
|
grammars outside the current form or menu (<a href="#dmlAFIA"
|
|
shape="rect">Appendix C</a>)</li>
|
|
|
|
<li>FIA corrected that collection of active grammars does not
|
|
include grammars from elements in the <subdialog>'s call
|
|
chain (<a href="#dmlAFIA" shape="rect">Appendix C</a>)</li>
|
|
|
|
<li>FIA's Initialization Phase clarified for initialization of
|
|
<script> elements and form items (<a href="#dmlAFIA"
|
|
shape="rect">Appendix C</a>)</li>
|
|
|
|
<li>Clarified that events may be generated at several points
|
|
during FIA execution, and that how they are handled depends upon
|
|
which FIA phase is active (<a href="#dmlAFIA"
|
|
shape="rect">Appendix C</a>)</li>
|
|
|
|
<li>Clarified that in the FIA collect phase, only prompts from
|
|
input items and <initial> are selected and their prompt
|
|
counter incremented. The queueing of prompts in a <block>
|
|
takes place when the form item is executed (<a href="#dmlAFIA"
|
|
shape="rect">Appendix C</a>)</li>
|
|
|
|
<li>In the process phase of the FIA, <filled> actions are
|
|
not only triggered by utterance input - for example, they can
|
|
also be triggered when maxtime is reached during a <record>
|
|
execution (<a shape="rect" href="#dmlAFIA">Appendix C</a>)</li>
|
|
|
|
<li>Clarified the use of various timeouts for DTMF input (<a
|
|
href="#dmlATiming" shape="rect">Appendix D</a>)</li>
|
|
|
|
<li>If a Conforming processor cannot process a non-standard
|
|
VoiceXML element or attribute, then it must throw an
|
|
error.badfetch error (<a href="#dmlAConformance"
|
|
shape="rect">Appendix F</a>)</li>
|
|
|
|
<li>explanatory notes on portable use of builtins and expected
|
|
platform dependence (<a href="#dmlABuiltins"
|
|
shape="rect">Appendix P</a>)</li>
|
|
|
|
<li>parameterization of builtin DTMF and speech grammars (<a
|
|
href="#dmlABuiltins" shape="rect">Appendix P</a>).</li>
|
|
|
|
<li>handling of contradictory parameters to digits builtin (<a
|
|
href="#dmlABuiltins" shape="rect">Appendix P</a>).</li>
|
|
|
|
<li>result value returned from "number" builtin type (<a
|
|
href="#dmlABuiltins" shape="rect">Appendix P</a>).</li>
|
|
|
|
<li>Currency code not specified if not spoken (<a
|
|
href="#dmlABuiltins" shape="rect">Appendix P</a>).</li>
|
|
|
|
<li>Only the digit and boolean grammars can be parameterized (<a
|
|
href="#dmlABuiltins" shape="rect">Appendix P</a>)</li>
|
|
|
|
<li>Description of rendering builtin values using <say-as>
|
|
(<a href="#dmlABuiltins" shape="rect">Appendix P</a>)</li>
|
|
|
|
<li>Speech or DTMF <grammar>s in a <field> with a
|
|
specified builtin type are in addition to the builtin grammars;
|
|
they do not override them (<a href="#dmlABuiltins"
|
|
shape="rect">Appendix P</a>)</li>
|
|
</ul>
|
|
|
|
<h3 id="Miscellane"><a id="dmlAChangesMisc"
|
|
name="dmlAChangesMisc" shape="rect">Miscellaneous</a></h3>
|
|
|
|
<ul>
|
|
<li>Updated examples with XML encoding attribute, recommended
|
|
schema attributes, and escaped illegal XML characters (<,
|
|
>, &, etc...)</li>
|
|
|
|
<li>Using tentative media types (e.g. "application/srgs+xml")
|
|
submitted to IETF for approval</li>
|
|
|
|
<li>Added section describing the origins of VoiceXML and how it
|
|
relates to other work in the area (<a href="#dml1"
|
|
shape="rect">1</a>)</li>
|
|
|
|
<li>Specified set of required audio formats for <audio> and
|
|
<record> (<a href="#dml1.2.4" shape="rect">1.2.4</a>).</li>
|
|
|
|
<li>capabilities of conforming VoiceXML platform with respect to
|
|
speech and dtmf grammars, audio, TTS, record, and transfer
|
|
support (<a href="#dml1.2.5" shape="rect">1.2.5</a>).</li>
|
|
|
|
<li>platforms should identify themselves with User-Agent HTTP
|
|
header (<a href="#dml1.2.5" shape="rect">1.2.5</a>).</li>
|
|
|
|
<li>Builtin types and fundamental grammars are informative not
|
|
normative (<a href="#dml2.3.1" shape="rect">2.3.1</a>, <a
|
|
href="#dml2.3.1.1" shape="rect">2.3.1.1</a>, <a
|
|
href="#dml2.3.1.2" shape="rect">2.3.1.2</a>, <a
|
|
href="#dmlABuiltins" shape="rect">Appendix P</a> )</li>
|
|
|
|
<li>Updated section to match SRGS 1.0 specification (<a
|
|
href="#dml3" shape="rect">3</a>)</li>
|
|
|
|
<li>description of how semantic interpretations are mapped to
|
|
form variables (<a href="#dml3.1.6" shape="rect">3.1.6</a>).</li>
|
|
|
|
<li>Updated section to match SSML 1.0 specification (<a
|
|
href="#dml4" shape="rect">4</a>)</li>
|
|
|
|
<li>reserved the variable namespace "_$" for internal use (<a
|
|
href="#dml5.1" shape="rect">5.1</a>).</li>
|
|
|
|
<li>use of variables and form items with names "session",
|
|
"application", "document", and "dialog" not recommended (<a
|
|
href="#dml5.1.2" shape="rect">5.1.2</a>).</li>
|
|
|
|
<li>Added Recommendation that metadata information is expressed
|
|
in <metadata> rather than <meta>; removed recommended
|
|
metadata information using <meta>; added recommended
|
|
metadata information using RDF schema and Dublin Core properties
|
|
(<a href="#dml6.2" shape="rect">6.2</a>)</li>
|
|
|
|
<li>Changed conformance behavior when interpreter encounters
|
|
properties it cannot process: it must (rather than should) not
|
|
thrown an error.unsupported.property and must (rather than
|
|
should) ignore the property (<a href="#dml6.3.1"
|
|
shape="rect">6.3.1</a>)</li>
|
|
|
|
<li>DTD is now Informative rather than Normative (<a
|
|
href="#dmlADTD" shape="rect">Appendix B</a>)</li>
|
|
|
|
<li>set of required audio formats (<a href="#dmlAAudioFormats"
|
|
shape="rect">Appendix E</a>).</li>
|
|
|
|
<li>Replaced "audio/wav" with "audio/x-wav" in examples, and
|
|
added note that the media type "audio/wav" will be adopted when
|
|
officially registered with the IETF (<a href="#dmlAAudioFormats"
|
|
shape="rect">Appendix E</a>)</li>
|
|
|
|
<li>revised definition of Conforming VoiceXML Processor,
|
|
including requirement to support syntax and semantics of all
|
|
elements described in this document (<a href="#dmlAConformance"
|
|
shape="rect">Appendix F</a>).</li>
|
|
|
|
<li>Conforming document section references schema rather DTD
|
|
constraints (<a href="#dmlAConformance" shape="rect">Appendix
|
|
F</a>)</li>
|
|
|
|
<li>Conformance statement reflect that DTD is informative but
|
|
schema is normative. A conforming document must specify the
|
|
voiceXML namespace on the root element. The version="2.0"
|
|
attribute must also be present. It is recommended to provide
|
|
"xsi:schemaLocation" to indicate the location of the VoiceXML
|
|
schema. The DOCTYPE declaration is optional. The behavior of a
|
|
VoiceXML processor is undefined when encountering documents with
|
|
non-VoiceXML designated root elements (<a href="#dmlAConformance"
|
|
shape="rect">Appendix F</a>)</li>
|
|
|
|
<li>Revised description of how VoiceXML can address accessibility
|
|
requirements and issues (<a href="#dmlAAccessibility"
|
|
shape="rect">Appendix H</a>)</li>
|
|
|
|
<li>reusability appendix (<a href="#dmlAReusability"
|
|
shape="rect">Appendix K</a>).</li>
|
|
|
|
<li>Added references appendix (<a href="#dmlAReferences"
|
|
shape="rect">Appendix M</a>)</li>
|
|
|
|
<li>Added appendix describing VoiceXML media type and file suffix
|
|
including link to IETF memo for registration of VoiceXML Media
|
|
type (<a href="#dmlAMediaType" shape="rect">Appendix N</a>)</li>
|
|
|
|
<li>Definition of normative schema for VoiceXML. This uses
|
|
various other schema to adapt definitions from core schemas in
|
|
the grammar and synthesis specifications (<a href="#dmlASchema"
|
|
shape="rect">Appendix O</a>)</li>
|
|
|
|
<li>Verified schema with XML Spy 4.4, XSV (June 2002 version) and
|
|
Xerces 2 (Java and C++ versions) (<a href="#dmlASchema"
|
|
shape="rect">Appendix O</a>)</li>
|
|
|
|
<li>Added link to complete set of schema required for VoiceXML
|
|
2.0 (<a href="#dmlASchema" shape="rect">Appendix O</a>)</li>
|
|
</ul>
|
|
|
|
<h2 id="Appendix10"><a id="dmlAReusability"
|
|
name="dmlAReusability" shape="rect">Appendix K —
|
|
Reusability</a></h2>
|
|
|
|
<h3 id="L10470">K.1 Reusable dialog components</h3>
|
|
|
|
<p><i>Definition</i>: A packaged application fragment designed to
|
|
be invoked by arbitrary applications or other Reusable Dialog
|
|
Components. A Reusable Dialog Component (RDC) encapsulates the
|
|
code for an interaction with the caller.</p>
|
|
|
|
<p>Reusable dialog components provide pre-packaged functionality
|
|
"out-of-the-box" that enables developers to quickly build
|
|
applications by providing standard default settings and behavior.
|
|
They shield developers from having to worry about many of the
|
|
intricacies associated with building a robust speech dialog,
|
|
e.g., confidence score interpretation, error recovery mechanisms,
|
|
prompting, etc. This behavior can be customized by a developer if
|
|
necessary to provide application-specific prompts, vocabulary,
|
|
retry settings, etc.</p>
|
|
|
|
<p>In this version of VoiceXML, the only authentic reusable
|
|
component calling mechanisms are <subdialog> and
|
|
<object>. Components called this way follow a model similar
|
|
to subroutines in programming languages: the component is
|
|
configured by a well-defined set of parameters passed to the
|
|
component, the component has a relatively constrained interaction
|
|
with the calling application, the component returns a
|
|
well-defined result, and control returns automatically to the
|
|
point from which the component was called. This has all the
|
|
significant advantages of modularity, reentrancy, and easy reuse
|
|
provided by subroutines. Of the two kinds of components, only
|
|
<subdialog> components are guaranteed to be as portable as
|
|
VoiceXML itself. On the other hand, <object> components may
|
|
be able to package advanced, reusable functionality that has not
|
|
yet been introduced into the standard.</p>
|
|
|
|
<h3 id="L10480">K.2 Templates and samples</h3>
|
|
|
|
<p>Although reusable dialog components have the advantages of
|
|
modularity, reentrancy, and easy reuse as described above, the
|
|
disadvantage of such components is that they must be designed
|
|
very carefully with an eye to reuse, and even with the most
|
|
careful of designs it is possible that the application developer
|
|
will encounter situations for which the component cannot be
|
|
easily configured to handle the application requirements. In
|
|
addition, while the constrained interaction of a component with
|
|
its calling environment makes it possible for the component
|
|
designer to create a component that works predictably in
|
|
disparate environments, it also may make the user's interaction
|
|
with the component seem disconnected from the rest of the
|
|
application.</p>
|
|
|
|
<p>In such situations the application developer may wish to reuse
|
|
VoiceXML source code in the form of samples and templates -
|
|
samples designed for easy customizability. Such code is more
|
|
easily tailored for and integrated into a particular application,
|
|
at the expense of modularity and rentrancy.</p>
|
|
|
|
<p>Such templates and samples can be created by separating
|
|
interesting VoiceXML code from a main dialog and then
|
|
distributing that code by copy for use in other dialogs. This
|
|
form of reusability allows the user of the copied VoiceXML code
|
|
to modify it as necessary and continue to use their modified
|
|
version indefinitely.</p>
|
|
|
|
<p>VoiceXML facilitates this form of reusability by preserving
|
|
the separation of state between form elements. In this regard,
|
|
VoiceXML and <a href="#ref_HTML" shape="rect">[HTML]</a> are
|
|
similar. An HTML table can be copied from one HTML page to
|
|
another because the table can be displayed regardless of the
|
|
context before or after the table element.</p>
|
|
|
|
<p>Although parameterizability, modularity, and maintainability
|
|
may be sacrificed with this approach, it has the advantage of
|
|
being simple, quick, and eminently customizable.</p>
|
|
|
|
<h2 id="Appendix1l"><a id="dmlAAcknowledge"
|
|
name="dmlAAcknowledge" shape="rect">Appendix L
|
|
—Acknowledgements</a></h2>
|
|
|
|
<p>This W3C specification is based upon VoiceXML 1.0 submitted by
|
|
the VoiceXML Forum in May 2000. The VoiceXML Forum authors were:
|
|
Linda Boyer, IBM; Peter Danielsen, Lucent Technologies; Jim
|
|
Ferrans, Motorola; Gerald Karam, AT&T; David Ladd, Motorola;
|
|
Bruce Lucas, IBM; Kenneth Rehor, Lucent Technologies.</p>
|
|
|
|
<p>This version was written by the participants in the W3C Voice
|
|
Browser Working Group. The following have significantly
|
|
contributed to writing this specification:</p>
|
|
|
|
<ul>
|
|
<li>Paolo Baggia, Loquendo</li>
|
|
|
|
<li>Daniel C. Burnett, Nuance Communications</li>
|
|
|
|
<li>Emily Candell, Comverse</li>
|
|
|
|
<li>Jerry Carter, Invited Expert</li>
|
|
|
|
<li>Deborah Dahl, Invited Expert</li>
|
|
|
|
<li>Peter Danielsen, Lucent (until October 2002)</li>
|
|
|
|
<li>Martin Dragomirecky, Cisco</li>
|
|
|
|
<li>Jim Ferrans, Motorola</li>
|
|
|
|
<li>Andrew Hunt, ScanSoft</li>
|
|
|
|
<li>Gerald Karam, AT&T</li>
|
|
|
|
<li>Dave Ladd, Dynamicsoft</li>
|
|
|
|
<li>Paul Lamere, Sun Microsystems</li>
|
|
|
|
<li>Bruce Lucas, IBM</li>
|
|
|
|
<li>Scott McGlashan, HP</li>
|
|
|
|
<li>Mitsuru Oshima, General Magic</li>
|
|
|
|
<li>Brad Porter, Tellme</li>
|
|
|
|
<li>Gavriel Raanan, NMS Communications</li>
|
|
|
|
<li>Ken Rehor, Vocalocity</li>
|
|
|
|
<li>Steph Tryphonas, Tellme</li>
|
|
</ul>
|
|
|
|
<p>The Working Group would like to thank Dave Raggett and Jim
|
|
Larson for their invaluable management support.</p>
|
|
|
|
<h2 id="Appendix1m"><a id="dmlAReferences" name="dmlAReferences"
|
|
shape="rect">Appendix M —References</a></h2>
|
|
|
|
<h2><a id="s_norm-refs" shape="rect">M.1.</a> Normative
|
|
References</h2>
|
|
|
|
<dl>
|
|
<dt><a id="ref_CSS2" class="ref" shape="rect">[CSS2]</a></dt>
|
|
|
|
<dd>" <cite><a href="http://www.w3.org/TR/REC-CSS2/"
|
|
shape="rect">Cascading Style Sheets, level 2, CSS2
|
|
Specification</a></cite> ", Bos et al. W3C Recommendation, May
|
|
1998<br />
|
|
See http://www.w3.org/TR/REC-CSS2/</dd>
|
|
|
|
<dt><a id="ref_ECMASCRIPT" class="ref"
|
|
shape="rect">[ECMASCRIPT]</a></dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://www.ecma-international.org/publications/standards/Ecma-262.htm"
|
|
shape="rect">Standard ECMA-262 ECMAScript Language
|
|
Specification</a></cite> ", Standard ECMA-262, December 1999.<br
|
|
clear="none" />
|
|
See
|
|
http://www.ecma-international.org/publications/standards/Ecma-262.htm</dd>
|
|
|
|
<dt><a id="ref_RFC1521" class="ref"
|
|
shape="rect">[RFC1521]</a></dt>
|
|
|
|
<dd>" <cite><a href="http://www.ietf.org/rfc/rfc1521.txt"
|
|
shape="rect">MIME (Multipurpose Internet Mail Extensions) Part
|
|
One: Mechanisms for Specifying and Describing the Format of
|
|
Internet Message Bodies</a></cite> ", IETF RFC 1521, 1993<br
|
|
clear="none" />
|
|
See http://www.ietf.org/rfc/rfc1521.txt</dd>
|
|
|
|
<dt><a id="ref_RFC2396" class="ref"
|
|
shape="rect">[RFC2396]</a></dt>
|
|
|
|
<dd>" <cite><a href="http://www.ietf.org/rfc/rfc2396.txt"
|
|
shape="rect">Uniform Resource Identifiers (URI): Generic
|
|
Syntax</a></cite> ", IETF RFC 2396, 1998.<br />
|
|
See http://www.ietf.org/rfc/rfc2396.txt</dd>
|
|
|
|
<dt><a id="ref_RFC2616" class="ref"
|
|
shape="rect">[RFC2616]</a></dt>
|
|
|
|
<dd>" <cite><a href="http://www.ietf.org/rfc/rfc2616.txt"
|
|
shape="rect">Hypertext Transfer Protocol -- HTTP/1.1</a></cite>
|
|
", IETF RFC 2616, 1999.<br />
|
|
See http://www.ietf.org/rfc/rfc2616.txt</dd>
|
|
|
|
<dt><a id="ref_RFC2806" class="ref"
|
|
shape="rect">[RFC2806]</a></dt>
|
|
|
|
<dd>" <cite><a href="http://www.ietf.org/rfc/rfc2806.txt"
|
|
shape="rect">URLs for Telephone Calls</a></cite> ", IETF RFC
|
|
2806, 2000.<br />
|
|
See http://www.ietf.org/rfc/rfc2806.txt</dd>
|
|
|
|
<dt><a id="ref_RFC3066" class="ref"
|
|
shape="rect">[RFC3066]</a></dt>
|
|
|
|
<dd>" <cite><a href="http://www.ietf.org/rfc/rfc3066.txt"
|
|
shape="rect">Tags for the Identification of Languages</a></cite>
|
|
", IETF RFC 3066, 2001.<br />
|
|
<i>Note that <a href="#ref_XML" shape="rect">[XML]</a> adopted
|
|
RFC3066 through an <a
|
|
href="http://www.w3.org/XML/xml-V10-2e-errata#E11"
|
|
shape="rect">errata</a> as of 2001-02-22. RFC3066 obsoletes <a
|
|
href="#ref_RFC1766" shape="rect">[RFC1766]</a></i> .<br
|
|
clear="none" />
|
|
See http://www.ietf.org/rfc/rfc3066.txt</dd>
|
|
|
|
<dt>[<a id="ref_SCHEMA1" shape="rect">SCHEMA1</a>]</dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/"
|
|
shape="rect">XML Schema Part 1: Structures</a></cite> ". Thompson
|
|
et al. W3C Recommendation, May 2001.<br />
|
|
See http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/</dd>
|
|
|
|
<dt>[<a id="ref_SRGS" shape="rect">SRGS</a>]</dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://www.w3.org/TR/2003/PR-speech-grammar-20031218/"
|
|
shape="rect">Speech Recognition Grammar Specification Version
|
|
1.0</a></cite> ". Hunt and McGlashan. W3C Proposed Recommendation,
|
|
December 2003.<br />
|
|
See http://www.w3.org/TR/2003/PR-speech-grammar-20031218/</dd>
|
|
|
|
<dt>[<a id="ref_SSML" shape="rect">SSML</a>]</dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://www.w3.org/TR/2003/CR-speech-synthesis-20031218/"
|
|
shape="rect">Speech Synthesis Markup Language Version
|
|
1.0</a></cite> ". Burnett, Walker and Hunt. W3C Candidate
|
|
Recommendation, December 2003.<br />
|
|
See http://www.w3.org/TR/2003/CR-speech-synthesis-20031218/</dd>
|
|
|
|
<dt>[<a id="ref_UNICODE" shape="rect">UNICODE</a>]</dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://www.unicode.org/unicode/standard/standard.html"
|
|
shape="rect">The Unicode Standard</a></cite> ". The Unicode
|
|
Consortium.<br />
|
|
See http://www.unicode.org/unicode/standard/standard.html</dd>
|
|
|
|
<dt>[<a id="ref_XML" shape="rect">XML</a>]</dt>
|
|
|
|
<dd>" <cite><a href="http://www.w3.org/TR/2000/REC-xml-20001006"
|
|
shape="rect">Extensible Markup Language (XML) 1.0</a></cite> ".
|
|
Bray et al. W3C Recommendation.<br />
|
|
See http://www.w3.org/TR/2000/REC-xml-20001006</dd>
|
|
|
|
<dt>[<a id="ref_XML-BASE" shape="rect">XML-BASE</a>]</dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://www.w3.org/TR/2001/REC-xmlbase-20010627/"
|
|
shape="rect">XML Base</a></cite> ", J. Marsh, editor, W3C
|
|
Recommendation, June 2001.<br />
|
|
See http://www.w3.org/TR/2001/REC-xmlbase-20010627/.</dd>
|
|
|
|
<dt>[<a id="ref_XMLNAMES" shape="rect">XMLNAMES</a>]</dt>
|
|
|
|
<dd>" <cite><a href="http://www.w3.org/TR/1999/REC-xml-names-19990114/"
|
|
shape="rect">Namespaces in XML</a></cite> ". Bray et al. W3C
|
|
Recommendation, January 1999.<br />
|
|
See http://www.w3.org/TR/1999/REC-xml-names-19990114/</dd>
|
|
</dl>
|
|
|
|
<h2><a id="s_other-refs" shape="rect">M.2.</a> Informative
|
|
References</h2>
|
|
|
|
<dl>
|
|
<dt><a id="ref_ATAGIO" class="ref" shape="rect">[ATAGIO]</a></dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://www.w3.org/TR/2000/REC-ATAG10-20000203/"
|
|
shape="rect">Authoring Tool Accessibility Guidelines
|
|
1.0</a></cite> ", Treviranus et al. W3C Recommendation, February
|
|
2000.<br />
|
|
See http://www.w3.org/TR/2000/REC-ATAG10-20000203/</dd>
|
|
|
|
<dt><a id="ref_DC" class="ref" shape="rect">[DC]</a></dt>
|
|
|
|
<dd><cite><a href="http://dublincore.org" shape="rect">"Dublin Core
|
|
Metadata Initiative</a></cite> ", a Simple Content Description
|
|
Model for Electronic Resources.<br />
|
|
See http://dublincore.org/</dd>
|
|
|
|
<dt><a id="ref_HTML" class="ref" shape="rect">[HTML]</a></dt>
|
|
|
|
<dd><cite><a
|
|
href="http://www.w3.org/TR/1999/REC-html401-19991224/"
|
|
shape="rect">"HTML 4.01 Specification</a></cite> ", Dave Raggett
|
|
et al. W3C Recommendation, December 1999.<br />
|
|
See http://www.w3.org/TR/1999/REC-html401-19991224/</dd>
|
|
|
|
<dt><a id="ref_IANA" class="ref" shape="rect">[IANA]</a></dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://www.iana.org/assignments/character-sets"
|
|
shape="rect">IANA Character Sets</a></cite> ", IANA.<br
|
|
clear="none" />
|
|
See http://www.iana.org/assignments/character-sets</dd>
|
|
|
|
<dt><a id="ref_ISO4217" class="ref"
|
|
shape="rect">[ISO4217]</a></dt>
|
|
|
|
<dd>" <cite><a href="http://www.iso.ch/" shape="rect">ISO
|
|
4217:2001 Codes for the representation of currencies and
|
|
funds</a></cite> ", ISO, 2001<br />
|
|
See http://www.iso.ch/</dd>
|
|
|
|
<dt><a id="ref_JSAPI" class="ref" shape="rect">[JSAPI]</a></dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://java.sun.com/products/java-media/speech/index.jsp"
|
|
shape="rect">Java Speech API</a></cite> ", Sun Microsystems,
|
|
Inc.<br />
|
|
See
|
|
http://java.sun.com/products/java-media/speech/index.jsp</dd>
|
|
|
|
<dt><a id="ref_JSGF" class="ref" shape="rect">[JSGF]</a></dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://www.w3.org/TR/2000/NOTE-jsgf-20000605/"
|
|
shape="rect">JSpeech Grammar Format</a></cite> ", Andrew Hunt,
|
|
W3C Note, June 2000.<br />
|
|
See http://www.w3.org/TR/2000/NOTE-jsgf-20000605/</dd>
|
|
|
|
<dt><a id="ref_NLSML" class="ref" shape="rect">[NLSML]</a></dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://www.w3.org/TR/2000/WD-nl-spec-20001120/"
|
|
shape="rect">Natural Language Semantics Markup Language for the
|
|
Speech Interface Framework</a></cite> ", Deborah A. Dahl. W3C
|
|
Working Draft, November 2000<br />
|
|
See http://www.w3.org/TR/2000/WD-nl-spec-20001120/</dd>
|
|
|
|
<dt><a id="ref_RDF-SYNTAX" class="ref"
|
|
shape="rect">[RDF-SYNTAX]</a></dt>
|
|
|
|
<dd><cite><a href="http://www.w3.org/TR/REC-rdf-syntax/"
|
|
shape="rect">"Resource Description Framework (RDF) Model and
|
|
Syntax Specification</a></cite> ", Ora Lassila and Ralph R.
|
|
Swick. W3C Recommendation, February 1999.<br />
|
|
See http://www.w3.org/TR/REC-rdf-syntax/</dd>
|
|
|
|
<dt><a id="ref_RDF-SCHEMA" class="ref"
|
|
shape="rect">[RDF-SCHEMA]</a></dt>
|
|
|
|
<dd><cite><a
|
|
href="http://www.w3.org/TR/2000/CR-rdf-schema-20000327/"
|
|
shape="rect">"Resource Description Framework (RDF) Schema
|
|
Specification 1.0</a></cite> ", Dan Brickley and R.V. Guha. W3C
|
|
Candidate Recommendation, March 2000.<br />
|
|
See http://www.w3.org/TR/2000/CR-rdf-schema-20000327/</dd>
|
|
|
|
<dt><a id="ref_RFC1766" class="ref"
|
|
shape="rect">[RFC1766]</a></dt>
|
|
|
|
<dd>" <cite><a href="http://www.ietf.org/rfc/rfc1766.txt"
|
|
shape="rect">Tags for the Identification of Languages</a></cite>
|
|
", IETF RFC 1766, 1995<br />
|
|
<i>Note that <a href="#ref_XML" shape="rect">[XML]</a> adopted
|
|
RFC3066 through an <a
|
|
href="http://www.w3.org/XML/xml-V10-2e-errata#E11"
|
|
shape="rect">errata</a> as of 2001-02-22. <a href="#ref_RFC3066"
|
|
shape="rect">[RFC3066]</a> obsoletes RFC1766</i>.<br
|
|
clear="none" />
|
|
See http://www.ietf.org/rfc/rfc1766.txt</dd>
|
|
|
|
<dt><a id="ref_RFC2119" class="ref"
|
|
shape="rect">[RFC2119]</a></dt>
|
|
|
|
<dd>" <cite><a href="http://www.ietf.org/rfc/rfc2119.txt"
|
|
shape="rect">Key words for use in RFCs to Indicate Requirement
|
|
Levels</a></cite> ", IETF RFC 2119, 1997.<br />
|
|
See http://www.ietf.org/rfc/rfc2119.txt</dd>
|
|
|
|
<dt><a id="ref_RFC2361" class="ref"
|
|
shape="rect">[RFC2361]</a></dt>
|
|
|
|
<dd>" <cite><a href="http://www.ietf.org/rfc/rfc2361.txt"
|
|
shape="rect">WAVE and AVI Codec Registries</a></cite> ", IETF RFC
|
|
2361, 1998.<br />
|
|
See http://www.ietf.org/rfc/rfc2361.txt</dd>
|
|
|
|
<dt><a id="ref_SISR" class="ref" shape="rect">[SISR]</a></dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://www.w3.org/TR/2003/WD-semantic-interpretation-20030401/"
|
|
shape="rect">Semantic Interpretation for Speech
|
|
Recognition</a></cite> ", Luc Van Tichelen. W3C Working Draft,
|
|
April 2003.<br />
|
|
See
|
|
http://www.w3.org/TR/2003/WD-semantic-interpretation-20030401/</dd>
|
|
|
|
<dt><a id="ref_UAAGIO" class="ref" shape="rect">[UAAGIO]</a></dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://www.w3.org/TR/2002/PR-UAAG10-20021016/"
|
|
shape="rect">User Agent Accessibility Guidelines 1.0</a></cite>
|
|
", Jacobs et al. W3C Proposed Recommendation, October 2002.<br
|
|
clear="none" />
|
|
See http://www.w3.org/TR/2002/PR-UAAG10-20021016/</dd>
|
|
|
|
<dt><a id="ref_VOICEXML-1.0" class="ref"
|
|
shape="rect">[VOICEXML-1.0]</a></dt>
|
|
|
|
<dd>" <cite><a
|
|
href="http://www.w3.org/TR/2000/NOTE-voicexml-20000505/"
|
|
shape="rect">Voice eXtensible Markup Language 1.0</a></cite> ",
|
|
Boyer et al, W3C Note, May 2000.<br />
|
|
See http://www.w3.org/TR/2000/NOTE-voicexml-20000505/</dd>
|
|
|
|
<dt><a id="ref_WAI-WEBCONTENT" class="ref"
|
|
shape="rect">[WAI-WEBCONTENT]</a></dt>
|
|
|
|
<dd>" <cite><a href="http://www.w3.org/TR/WAI-WEBCONTENT/"
|
|
shape="rect">Web Content Accessibility Guidelines 1.0</a></cite>
|
|
", Chisholm et al. W3C Recommendation, May 1999<br
|
|
clear="none" />
|
|
See http://www.w3.org/TR/WAI-WEBCONTENT/</dd>
|
|
|
|
<dt><a id="ref_XAG" class="ref" shape="rect">[XAG]</a></dt>
|
|
|
|
<dd>" <cite><a href="http://www.w3.org/TR/xag.html"
|
|
shape="rect">XML Accessibility Guidelines</a></cite> ",
|
|
Dardailler et al. W3C Working Draft, October 2002<br
|
|
clear="none" />
|
|
See http://www.w3.org/TR/xag.html</dd>
|
|
</dl>
|
|
|
|
<h2 id="Appendix1n"><a id="dmlAMediaType" name="dmlAMediaType"
|
|
shape="rect">Appendix N —Media Type and File
|
|
Suffix</a></h2>
|
|
|
|
<p>The W3C Voice Browser Working Group has applied to IETF to
|
|
register a media type for VoiceXML. The requested media type is
|
|
<i>application/voicexml+xml</i>.</p>
|
|
|
|
<p>The W3C Voice Browser Working Group has adopted the convention
|
|
of using the ".vxml" filename suffix for VoiceXML documents.</p>
|
|
|
|
<h2 id="Appendix1schema1"><a id="dmlASchema" name="dmlASchema"
|
|
shape="rect">Appendix O —VoiceXML XML Schema Definition</a></h2>
|
|
|
|
<p><strong>This section is Normative.</strong></p>
|
|
|
|
<p>The XML Schema definition for VoiceXML is located at <a href="./vxml.xsd"
|
|
shape="rect">http://www.w3.org/TR/voicexml20/vxml.xsd</a>.</p>
|
|
|
|
<p>The VoiceXML schema depends upon other schemas defined in the
|
|
VoiceXML namespace:</p>
|
|
|
|
<ul>
|
|
<li><a href="./vxml-datatypes.xsd"
|
|
shape="rect">vxml-datatypes.xsd</a> : definition of datatypes
|
|
used in the VoiceXML schema</li>
|
|
|
|
<li><a href="./vxml-attribs.xsd"
|
|
shape="rect">vxml-attribs.xsd</a> : definition of attributes and
|
|
attribute groups used in the VoiceXML schema</li>
|
|
|
|
<li><a href="./vxml-grammar-restriction.xsd"
|
|
shape="rect">vxml-grammar-restriction.xsd</a>: this schema
|
|
references the no-namespace schema of the Speech Recognition
|
|
Grammar Specification 1.0 <a href="#ref_SRGS"
|
|
shape="rect">[SRGS]</a> and restricts some of its definitions for
|
|
embedding in the VoiceXML namespace.</li>
|
|
|
|
<li><a href="./vxml-grammar-extension.xsd"
|
|
shape="rect">vxml-grammar-extension.xsd</a>: this schema
|
|
references vxml-grammar-restriction.xsd and extends some of its
|
|
definitions for VoiceXML.</li>
|
|
|
|
<li><a href="./vxml-synthesis-restriction.xsd"
|
|
shape="rect">vxml-synthesis-restriction.xsd</a>: this schema
|
|
references the no-namespace schema of the Speech Synthesis Markup
|
|
Language 1.0 <a href="#ref_SSML" shape="rect">[SSML]</a> and
|
|
extends as well as restricts some of its definitions for
|
|
embedding in the VoiceXML namespace.</li>
|
|
|
|
<li><a href="./vxml-synthesis-extension.xsd"
|
|
shape="rect">vxml-synthesis-extension.xsd</a>: this schema
|
|
references vxml-synthesis-restriction.xsd and extends some of its
|
|
definitions for VoiceXML.</li>
|
|
</ul>
|
|
|
|
<p>The complete set of Speech Interface Framework schema required
|
|
for VoiceXML 2.0 is available <a href="./vxml-schema.zip"
|
|
shape="rect">here</a>.</p>
|
|
|
|
<h2 id="Appendixbuiltins"><a id="dmlABuiltins"
|
|
name="dmlABuiltins" shape="rect">Appendix P — Builtin
|
|
Grammar Types</a></h2>
|
|
|
|
<p>The <field> type attribute in <a href="#dml2.3.1"
|
|
shape="rect">Section 2.3.1</a> is used to specify a builtin
|
|
grammar for one of the fundamental types. Platform support for
|
|
fundamental builtin grammars is optional. If a platform does
|
|
support builtin types, then it must follow the description given
|
|
in this appendix as closely as possible, including all the
|
|
builtins for a given language.</p>
|
|
|
|
<p>Each builtin type has a convention for the format of the value
|
|
returned. These are independent of language and of the
|
|
implementation. The return type for builtin fields is a string
|
|
except for the boolean field type. To access the actual
|
|
recognition result, the author can reference the <field>
|
|
shadow variable <i>name</i>$.utterance. Alternatively, the
|
|
developer can access application.lastresult$, where
|
|
application.lastresult$.interpretation has the same string value
|
|
as application.lastresult$.utterance.</p>
|
|
|
|
<p>The builtin types are defined in such a way that a VoiceXML
|
|
application developer can assume some consistency of user input
|
|
across implementations. This permits help messages and other
|
|
prompts to be independent of platform in many instances. For
|
|
example, the boolean type's grammar should minimally allow
|
|
"yes" and "no" responses in English, but each implementation is
|
|
free to add other choices, such as "yeah" and "nope".</p>
|
|
|
|
<p>In cases where an application requires specific behavior or
|
|
different behavior than defined for a builtin, it should use an
|
|
explicit field grammar. The following are circumstances in which
|
|
an application must provide an explicit field grammar in order to
|
|
ensure portability of the application with a consistent user
|
|
interface:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>A platform is not required to implement a grammar that accepts
|
|
all possible values that might be returned by a builtin. For
|
|
instance, the currency builtin defines the return value
|
|
formatting for a very broad range of currencies (<a
|
|
href="#ref_ISO4217" shape="rect">[ISO4217]</a>). The platform is
|
|
not required to support spoken input that includes any of the
|
|
world's currencies since that can negatively impact recognition
|
|
accuracy. Similarly, the number builtin can return positive or
|
|
negative floating point numbers but the grammar is not required
|
|
to support all possible spoken floating point numbers.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Builtins are also limited in their ability to handle
|
|
underspecified spoken input. For instance, "20 peso" cannot be
|
|
resolved to a specific <a href="#ref_ISO4217"
|
|
shape="rect">[ISO4217]</a> currency code because the "peso" is
|
|
the name of the currency of numerous nations. In such cases the
|
|
platform may return a specific currency code according to the
|
|
language or may omit the currency code.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>All builtin types must support both voice and DTMF entry.</p>
|
|
|
|
<p>The set of accepted spoken input for each builtin type is
|
|
platform dependent and will vary by language.</p>
|
|
|
|
<p>The value returned by a builtin type can be read out using the
|
|
<say-as> element. VoiceXML extends <say-as> in
|
|
<a href="#ref_SSML" shape="rect">[SSML]</a> by adding
|
|
'interpret-as' values corresponding to each builtin type.
|
|
These values take the form "vxml:<i><type></i>" where
|
|
<i>type</i> is a builtin type. The precise rendering of builtin
|
|
types is platform-specific and will vary by language.</p>
|
|
|
|
<p>The builtin types are:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 66: builtin types">
|
|
<caption align="bottom">Table 66: Builtin Types</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>boolean</th>
|
|
<td>Inputs include affirmative and
|
|
negative phrases appropriate to the current language. DTMF 1 is
|
|
affirmative and 2 is negative. The result is ECMAScript true for
|
|
affirmative or false for negative. The value will be submitted as
|
|
the string "true" or the string "false". If the field value is
|
|
subsequently used in <say-as> with the interpret-as value
|
|
"vxml:boolean", it will be spoken as an affirmative or negative
|
|
phrase appropriate to the current language.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>date</th>
|
|
<td>Valid spoken inputs include phrases
|
|
that specify a date, including a month day and year. DTMF inputs
|
|
are: four digits for the year, followed by two digits for the
|
|
month, and two digits for the day. The result is a fixed-length
|
|
date string with format yyyymmdd, e.g. "20000704". If the year is
|
|
not specified, yyyy is returned as "????"; if the month is not
|
|
specified mm is returned as "??"; and if the day is not specified
|
|
dd is returned as "??". If the value is subsequently used in
|
|
<say-as> with the interpret-as value "vxml:date", it will
|
|
be spoken as date phrase appropriate to the current language.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>digits</th>
|
|
<td>Valid spoken or DTMF inputs include
|
|
one or more digits, 0 through 9. The result is a string of
|
|
digits. If the result is subsequently used in <say-as> with
|
|
the interpret-as value "vxml:digits", it will be spoken as a
|
|
sequence of digits appropriate to the current language. A user
|
|
can say for example "two one two seven", but not "twenty one
|
|
hundred and twenty-seven". A platform may support constructs
|
|
such as "two double-five eight".</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>currency</th>
|
|
<td>Valid spoken inputs include phrases
|
|
that specify a currency amount. For DTMF input, the "*" key will
|
|
act as the decimal point. The result is a string with the format
|
|
UUUmm.nn, where UUU is the three character currency indicator
|
|
according to ISO standard 4217 <a href="#ref_ISO4217"
|
|
shape="rect">[ISO4217]</a>, or mm.nn if the currency is not
|
|
spoken by the user or if the currency cannot be reliably
|
|
determined (e.g. "dollar" and "peso" are ambiguous). If the field
|
|
is subsequently used in <say-as> with the
|
|
interpret-as value "vxml:currency", it will be spoken as a
|
|
currency amount appropriate to the current language.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>number</th>
|
|
<td>Valid spoken inputs include phrases
|
|
that specify numbers, such as "one hundred twenty-three", or
|
|
"five point three". Valid DTMF input includes positive numbers
|
|
entered using digits and "*" to represent a decimal point. The
|
|
result is a string of digits from 0 to 9 and may optionally
|
|
include a decimal point (".") and/or a plus or minus sign.
|
|
ECMAScript automatically converts result strings to numerical
|
|
values when used in numerical expressions. The result must not
|
|
use a leading zero (which would cause ECMAScript to interpret as
|
|
an octal number). If the field is subsequently used in
|
|
<say-as> with the interpret-as value "vxml:number", it
|
|
will be spoken as a number appropriate to the current
|
|
language.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>phone</th>
|
|
<td>Valid spoken inputs include phrases
|
|
that specify a phone number. DTMF asterisk "*" represents "x".
|
|
The result is a string containing a telephone number consisting
|
|
of a string of digits and optionally containing the character "x"
|
|
to indicate a phone number with an extension. For North America,
|
|
a result could be "8005551234x789". If the field is subsequently
|
|
used in <say-as> with the interpret-as value "vxml:phone",
|
|
it will be spoken as a phone number appropriate to the current
|
|
language.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>time</th>
|
|
<td>Valid spoken inputs include phrases
|
|
that specify a time, including hours and minutes. The result is a
|
|
five character string in the format hhmmx, where x is one of "a"
|
|
for AM, "p" for PM, "h" to indicate a time specified using 24
|
|
hour clock, or "?" to indicate an ambiguous time. Input can be
|
|
via DTMF. Because there is no DTMF convention for specifying
|
|
AM/PM, in the case of DTMF input, the result will always end with
|
|
"h" or "?". If the field is subsequently used in <say-as>
|
|
with the interpret-as value "vxml:time", it will be spoken as
|
|
a time appropriate to the current language.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>An example of a <field> element with a builtin grammar
|
|
type:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<field name="lo_fat_meal" type="boolean">
|
|
|
|
<prompt>
|
|
Do you want a low fat meal on this flight?
|
|
</prompt>
|
|
<help>
|
|
Low fat means less than 10 grams of fat, and under
|
|
250 calories.
|
|
</help>
|
|
<filled>
|
|
<prompt>
|
|
I heard <emphasis><say-as interpret-as="vxml:boolean">
|
|
<value expr="lo_fat_meal"/></say-as></emphasis>.
|
|
</prompt>
|
|
</filled>
|
|
</field>
|
|
</pre>
|
|
|
|
<p>In this example, the boolean type indicates that inputs are
|
|
various forms of true and false. The value actually put into the
|
|
field is either true or false. The field would be read out using
|
|
the appropriate affirmative or negative response in prompts.</p>
|
|
|
|
<p>In the next example, digits indicates that input will be
|
|
spoken or keyed digits. The result is stored as a string, and
|
|
rendered as digits using the <say-as> with
|
|
"vxml:digits" as the value for the interpret-as attribute, i.e.,
|
|
"one-two-three", not "one hundred twenty-three". The
|
|
<filled> action tests the field to see if it has 12 digits.
|
|
If not, the user hears the error message.</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<field name="ticket_num" type="digits">
|
|
<prompt>
|
|
Read the 12 digit number from your ticket.
|
|
</prompt>
|
|
<help>The 12 digit number is to the lower left.</help>
|
|
<filled>
|
|
<if cond="ticket_num.length != 12">
|
|
<prompt>
|
|
Sorry, I didn't hear exactly 12 digits.
|
|
</prompt>
|
|
<assign name="ticket_num" expr="undefined"/>
|
|
<else/>
|
|
<prompt>I heard <say-as interpret-as="vxml:digits">
|
|
<value expr="ticket_num"/></say-as>
|
|
</prompt>
|
|
</if>
|
|
</filled>
|
|
</field>
|
|
</pre>
|
|
|
|
<p>The builtin boolean grammar and builtin digits grammar can be
|
|
parameterized. This is done by explicitly referring to builtin
|
|
grammars using a platform-specific builtin URI scheme and using a
|
|
URI-style query syntax of the form
|
|
<i>type</i>?<i>param</i>=<i>value</i> in the src attribute of a
|
|
<grammar> element, or in the type attribute of a field, for
|
|
example:</p>
|
|
|
|
<pre class="example" xml:space="preserve">
|
|
<grammar src="builtin:dtmf/boolean?y=7;n=9"/>
|
|
|
|
<field type="boolean?y=7;n=9">
|
|
<prompt>
|
|
If this is correct say yes or press seven, if not, say no or press nine.
|
|
</prompt>
|
|
</field>
|
|
|
|
<field type="digits?minlength=3;maxlength=5">
|
|
<prompt>Please enter your passcode</prompt>
|
|
</field>
|
|
</pre>
|
|
|
|
<p>Where the <grammar> parameterizes the builtin DTMF
|
|
grammar, the first <field> parameterizes the builtin DTMF
|
|
grammar (the speech grammar will be activated as normal) and the
|
|
second <field> parameterizes both builtin DTMF and speech
|
|
grammars. Parameters which are undefined for a given grammar type
|
|
will be ignored; for example, "builtin:grammar/boolean?y=7".</p>
|
|
|
|
<p>The digits and boolean grammars can be parameterized as
|
|
follows:</p>
|
|
|
|
<table cellspacing="0" cellpadding="5" width="80%" border="1"
|
|
summary="Table 67: digit and boolean grammar parameterization">
|
|
<caption align="bottom">Table 67: Digit and Boolean Grammar
|
|
Parameterization</caption>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<th>digits?minlength=<i>n</i> </th>
|
|
<td>A string of at least <i>n</i> digits.
|
|
Applicable to speech and DTMF grammars. If minlength conflicts
|
|
with either the length or maxlength attributes then a
|
|
error.badfetch event is thrown.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>digits?maxlength=<i>n</i> </th>
|
|
<td>A string of at most <i>n</i> digits.
|
|
Applicable to speech and DTMF grammars. If maxlength conflicts
|
|
with either the length or minlength attributes then a
|
|
error.badfetch event is thrown.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>digits?length=<i>n</i> </th>
|
|
<td>A string of exactly <i>n</i> digits.
|
|
Applicable to speech and DTMF grammars. If length conflicts with
|
|
either the minlength or maxlength attributes then a
|
|
error.badfetch event is thrown.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>boolean?y=<i>d</i> </th>
|
|
<td>A grammar that treats the keypress
|
|
<i>d</i> as an affirmative answer. Applicable only to the DTMF
|
|
grammar.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th>boolean?n=<i>d</i> </th>
|
|
<td>A grammar that treats the keypress
|
|
<i>d</i> as a negative answer. Applicable only to the DTMF
|
|
grammar.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Note that more than one parameter may be specified separated
|
|
by ";" as illustrated above. When a <grammar> element with
|
|
the mode set to "voice" (the default value) is specified in a
|
|
<field>, it is in addition to the default speech grammar
|
|
mplied by the type attribute of the field. Likewise, when a
|
|
<grammar> element with the mode set to "dtmf" is specified
|
|
in a <field>, it is in addition to the default DTMF
|
|
grammar.</p>
|
|
|
|
<!--- APPENDICES: END =-->
|
|
<div class="navbar">
|
|
<hr />
|
|
<a href="#toc" shape="rect">table of contents</a></div>
|
|
</body>
|
|
</html>
|
|
|