VoiceXML Learn


VoiceXML concepts

  • Dialogs
  • VoiceXML application is always in one conversational state or dialog at a given time. Each dialog is followed by another dialog, and if no dialog is specified next,then the execution of the VoiceXML application is terminated.There are two types of dialogs, forms and menus Forms collect user inputs in the form of values, just like an HTML form. Menus present the user with a list of options to select from.
  • Sessions
  • user begins to interac with a VoiceXML document.
  • Applications
  • An application is a collection of VoiceXML documents.
  • Grammars
  • A grammar specifies a list of permissible vocabulary for the user to select from in order to interact with the VoiceXML application.
  • Events
  • An event is thrown by the VoiceXML platform for a number of reasons, such as when a user does not respond to an input, doesn't respond correctly, requests help, etc.
  • Links
  • A link specifies a transition that is common to all dialogs in the scope of the link.

A basic VoiceXML

<xml> version tag

<?xml version="1.0"?>

<vxml> root tag

<vxml version = "2.0" xmlns="http://www.w3.org/2001/vxml">

Basic VoiceXML structure

 <?xml version="1.0"?>
  <vxml version = "2.0" xmlns="http://www.w3.org/2001/vxml">
  ...
  <?/vxml>
  

An example: Hello world!

 <?xml version="1.0"?>
  <vxml version = "2.0" xmlns="http://www.w3.org/2001/vxml">
   <form>
    <block>Hello world!</block>
   </form>
  </vxml>
  

Form items

Element Purpose
<assign> Assign a variable a value
<audio> Play an audio clip within a prompt
<block> A container of (non-interactive) executable code
<catch> Catch an event
<choice> Define a menu item
<clear> Clear one or more form item variables
<disconnect> Disconnect a session
<else> Used in <if> elements
<elseif> Used in <if> elements
<enumerate> Shorthand for enumerating the choices in a menu
<error> Catch an error event
<exit> Exit a session
<field> Declares an input field in a form
<filled> An action executed when fields are filled
<form> A dialog for presenting information and collecting data
<catch> Catch an event
<goto> Go to another dialog in the same or different document
<grammar> Specify a speech recognition or DTMF grammar
<help> Catch a help event
<if> Simple conditional logic
<initial> Declares initial logic upon entry into a (mixed initiative) form
<link> Specify a transition common to all dialogs in the link's scope
<log> Generate a debug message
<menu> A dialog for choosing amongst alternative destinations
<meta> Define a metadata item as a name/value pair
<metadata> Define metadata information using a metadata schema
<noinput> Catch a noinput event
<nomatch> Catch a nomatch event
<object> Interact with a custom extension
<option> Specify an option in a <field>
<param> Parameter in <object> or <subdialog>
<prompt> Queue speech synthesis and audio output to the user
<property> Control implementation platform settings.
<record> Record an audio sample
<reprompt> Play a field prompt when a field is re-visited after an event
<return> Return from a subdialog.
<script> Specify a block of ECMAScript client-side scripting logic
<subdialog> Invoke another dialog as a subdialog of the current one
<submit> Submit values to a document server
<throw> Throw an event.
<transfer> Transfer the caller to another destination
<value> Insert the value of an expression in a prompt
<var> Declare a variable
<vxml> Top-level element in each VoiceXML document

Grammars

There are grammar is most important. This is the sample. A speech grammar specifies a list of vocabulary for the user to select from to interact with the VoiceXML application. Following is an example of how you could define a grammar.
 <grammar>
 <![CDATA[
 [
 [one excellent dtmf-1] {<option "excellent">}
 [two good dtmf-2] {<option "good">}
 [three fair dtmf-3] {<option "fair">}
 [four poor dtmf-4] {<option "poor">}
 [five help dtmf-5] {<option "help">}
 ]
 ]]>
 </grammar>
   

Comments

Post a Comment

Popular posts from this blog

How to Install Asterisk 11 on Ubuntu 14.04 LTS

VoiceXML Introduction

Server Tomcat v6.0 Server at localhost failed to start