sss - CTI论坛-中国领先的ICT行业网站

Download Report

Transcript sss - CTI论坛-中国领先的ICT行业网站

VOICEXML简介
Voice Extensible Markup Language
VOICEXML的特点:
是全球的标准,与平台无关
可以在内存中执行,效率很高
为语音门户制定的
可以实现真正意义上的交互
BROWSER
WWW SERVER
BROWSER
WWW SERVER
WWW SERVER
VXML 浏览器
交换机
VOICEXML的构成:
一个简单的FORM例子:HELLO WORLD
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<block>Hello World!</block>
</form>
</vxml>
MENU例子一
<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>
MENU例子二
<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>
一个应用可以有多个页面组成
ROOT DOCUMENT
LEAF DOCUMENT
Application root document (app-root.vxml)
<?xml version="1.0"?>
<vxml version="2.0">
<var name="bye" expr="'Ciao'"/>
<link next="operator_xfer.vxml">
<grammar>
<rule id="root" scope="public">operator</rule>
</grammar>
</link>
</vxml>
Leaf document (leaf.vxml)
<?xml version="1.0"?>
<vxml version="2.0" application="app-root.vxml">
<form id="say_goodbye">
<field name="answer" type="boolean">
< prompt >Shall we say <value expr="application.bye"/>?</prompt>
<filled>
<if cond="answer">
<exit/>
</if>
<clear namelist="answer"/>
</filled>
</field>
</form>
</vxml>
FORM内部的元素
<field>
<object>
<record>
Declares an input field in a form
Interact with a custom extension
Record an audio sample
Invoke another dialog as a subdialog of the
<subdialog>
current one
<submit>
Submit values to a document server
<transfer> Transfer the caller to another destination
<var>
Declare a variable
Declares initial logic upon entry into a (mixed<initial>
initiative) form
<filled>
An action executed when fields are filled
一个FIELD的例子
<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><value expr="lo_fat_meal"/></emphasis>.
</prompt>
</filled>
</field>
一个OBJECT的例子
<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>
一个RECORD的例子
<record name="greeting" beep="true" maxtime="10s"
finalsilence="4000ms" dtmfterm="true" type="audio/wav">
<prompt>
At the tone, please say your greeting.
</prompt>
<noinput>
I didn't hear anything, please try again.
</noinput>
</record>
一个SUBMIT的例子
<submit next="log_request" method="post"
namelist="name rank serial_number"
fetchtimeout="100s"
fetchaudio="audio/brahms2.wav"/>
一个TRANSFER的例子
The interpreter remains connected to the call; the original
bridge
caller resumes his session with the interpreter after the far
transfer
end disconnects.
No resumption is possible; as soon as the call connects, the
platform throws a telephone.disconnect.transfer. The
blind
interpreter disconnects from the session and continues
transfer execution (if anything remains to execute) but cannot regain
control of the call. The caller and callee remain connected in
a conversation.
busy
noanswer
network_busy
The endpoint refused the call.
There was no answer within the time specified
by the connecttimeout attribute.
Some intermediate network refused the call.
The call completed and was terminated by the
caller.
The call completed and was terminated by the
far_end_disconnect
callee.
The call completed and was terminated by the
network_disconnect
network.
The call duration exceeded the value of
maxtime_disconnect maxtime attribute and was terminated by the
platform.
This value may be returned if the outcome of
the transfer is unknown, for instance if the
unknown
platform does not support reporting the
outcome of blind transfer completion.
near_end_disconnect
<transfer name="mycall" dest="tel:+358-555-1234567"
transferaudio="elevator_music.wav"
connecttimeout="60s" bridge="true">
<filled>
<assign name="mydur" expr="mycall$.duration"/>
<if cond="mycall == 'busy'">
<prompt>
Sorry, our customer support team is busy serving
other customers. Please try again later.
</prompt>
<elseif cond="mycall == 'noanswer'"/>
<prompt>
Sorry, our customer support team's normal hours
are 9 am to 7 pm Monday through Saturday.
</prompt>
</if>
</filled>
</transfer>
FIA Form Interpretation Algorithm
<form>
<field name = “first” cond = “true”>
</field>
<field name = “second” cond = “false”>
</field>
<object name =”third” cond = “true”>
<filled>
<goto next = …/>
</filled>
</object>
<field name = “forth” expr = “value”>
</field>
<filled>
<clear namelist="first"/>
</filled>
</form>
VOICEXML的不足:
没有呼出的元素
没有会议的元素
谢谢大家