Sunteți pe pagina 1din 11

VoiceXML Developer Training Part 1

October 2006

VoiceXML

2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice

VoiceXML Developer Training Part 1

October 2006

Agenda
Part 1. VoiceXML Key Concepts
Part 2. Dialogs
VoiceXml

developm ent

Part 3. Outputs
Part 4. Inputs
Part 5. Control Flow
Part 6. Call Control
Part 7. Server Interaction
Part 8. Resources handling
Part 9. OCMP Specifics

HP Restricted

VoiceXML Developer Training Part 1

October 2006

High-level concepts
XML-based language.
Combination of several other languages concepts:
Declarative (ex: HTML): describes a static sequence of user
interaction.
Procedural (ex: ECMA script): avoids round-trips to the server
after every user interaction..
Event-driven (ex: Microsoft): catches the user interaction events
(disconnect).
Object-oriented (ex: Java): handful of constructs where
objects have a series of properties (ex: variable attributes).

HP Restricted

VoiceXML Developer Training Part 1

October 2006

Features
Design for creating audio dialogs:
Play audio (prerecorded or synthesized).
Listen and recognize audio.
Record of spoken input.
Recognition of spoken and DTMF key input.
Basic telephony control.

HP Restricted

VoiceXML Developer Training Part 1

October 2006

Dialogs
A VoiceXML document
defines a finite state
machine where each state is
a dialog.

doc1.vxml
Dialog 1
Transition: <goto
next=#dialog 2>

The user is always in one


dialog at any time.

Dialog 2
Each dialog specifies the
next dialog to transition to
using an URL.

Transition: <goto
next=http://xyz.com/doc2.vxml>

HP Restricted

VoiceXML Developer Training Part 1

October 2006

Voice XML: user interaction


Using dialogs:
Forms: <form> presents information (outputs) and collects
values (inputs).
Menus : <menu> presents a choice of options and navigates
to another dialog based on the choice.
VoiceXML Application

Outputs:
<audio>, <prompt>
Inputs:
<grammar>, <record>
Control flow: events
handling, variables
Call Control: <transfer>,
<disconnect>
HP Restricted

10

VoiceXML Interpreter

OCMP BASE

10

VoiceXML Developer Training Part 1

October 2006

VoiceXML basic example

<?xml version="1.0 encoding=ISO-8859-1?>


<vxml version="2.0"
xmlns="http://www.w3.org/2001/vxml" >
<form>
XML form
<block>
Play a synthesized
Hello world!
message + call
<disconnect />
disconnnection
</block>
</form>
</vxml>

HP Restricted

XML namespace: collection of names, identified by a URI


reference [RFC2396], which are used in XML documents as element
types and attribute names.

12

12

VoiceXML Developer Training Part 1

October 2006

Application concepts
session

Begins when the user starts to interact


with the VoiceXML interpreter.

application

Set of VoiceXML documents.

document

Each file of the application.

dialog
anonymous

<menu> or <form>
<block>, <filled> & <catch>

HP Restricted

14

14

VoiceXML Developer Training Part 1

October 2006

Application design 1/2


An application is a set of
documents which shares the
same root document.
Root

Root document:
Loaded once a document is
loaded.
Remain loaded until
transition to a nonapplication document.

Doc1

Doc2

Doc3

While loaded, its


information is available to
all application documents.
HP Restricted

16

16

VoiceXML Developer Training Part 1

October 2006

Application design 2/2


myroot.vxml
Root

Doc1

<?xml version="1.0 ?>


<vxml version="2.0>
<link dtmf=0 next=http://xyz.com/help.vxml/>
</vxml>
<?xml version="1.0"?>
<vxml version="2.0 application=myroot.vxml>
<form>
<block>
You can press 0 for help at any time
</block>
</form>

</vxml>

leaf.vxml

HP Restricted

18

18

VoiceXML Developer Training Part 1

October 2006

HP Restricted

20

20

S-ar putea să vă placă și