VoiceXML: Events, Errors, and ECMAScript. Acknowledgements Prof. Mctear, Natural Language Processing, University.

Slides:



Advertisements
Similar presentations
CGI & HTML forms CGI Common Gateway Interface  A web server is only a pipe between user-agents  and content – it does not generate content.
Advertisements

VoiceXML: Application and Session variables, N- best and Multiple Interpretations.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Java Script Session1 INTRODUCTION.
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
XML and JavaScript Introduction. XML Brief Introduction:- 1) Understanding XML Documents:- An XML document is comprised of one or more named elements.
The Web Warrior Guide to Web Design Technologies
Introduction to C Programming
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
VoiceXML and Internet Telephony Kundan Singh and Henning Schulzrinne Columbia University Joint work (in progress) with Daniel,
DT211/3 Internet Application Development
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
Tutorial 11 Working with Operators and Expressions
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
8/6/2015Auto Attendants 1 Smarter Communications.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Using Data Active Server Pages Objectives In this chapter, you will: Learn about variables and constants Explore application and session variables Learn.
4.1 JavaScript Introduction
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
Web forms in PHP Forms Recap  Way of allowing user interaction  Allows users to input data that can then be processed by a program / stored in a back-end.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Tutorial 14 Working with Forms and Regular Expressions.
HTML DOM.  The HTML DOM defines a standard way for accessing and manipulating HTML documents.  The DOM presents an HTML document as a tree- structure.
IT533 Lectures Session Management in ASP.NET. Session Tracking 2 Personalization Personalization makes it possible for e-businesses to communicate effectively.
Introduction to Python
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
ITCS 6010 SALT. Speech Application Language Tags (SALT) Speech interface markup language Extension of HTML and other markup languages Adds speech and.
VoiceXML: Forms, Menus, Grammars, Form Interpretation Algorithm.
Integrating VoiceXML with SIP services
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Chapter 8 Cookies And Security JavaScript, Third Edition.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Tutorial 8 Programming with ActionScript 3.0. XP Objectives Review the basics of ActionScript programming Compare ActionScript 2.0 and ActionScript 3.0.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
1 Maryland ColdFusion User Group Session Management December 2001 Michael Schuler
ITBP 119 Algorithms and Problem Solving Section 2.1 Installing software Section 2.2 First Programs Section 2.3 Variables.
PHP2. PHP Form Handling The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input. Name: Age:
Database Handling, Sessions, and AJAX. Post Back ASP.NET Functionality The IsPostBack method in ASP.NET is similar to the BlackBerry.refresh method –IsPostBack.
© 2006 Cisco Systems, Inc. All rights reserved.1 Connection 7.0 Serviceability Reports Todd Blaisdell.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 4 Looping.
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
JavaScript, Fourth Edition
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
Creating User Interfaces Another example. Classwork/homework: work on VoiceXML project.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Part:2.  Keywords are words with special meaning in JavaScript  Keyword var ◦ Used to declare the names of variables ◦ A variable is a location in the.
Tutorial 11 1 JavaScript Operators and Expressions.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
Oracle Business Intelligence Foundation – Testing and Deploying OBI Repository.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
IPEmotion License Management PM (V1.2).
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 JavaScript.
CS 330 Class 7 Comments on Exam Programming plan for today:
Introduction to Triggers
Scripts & Functions Scripts and functions are contained in .m-files
Intro to PHP & Variables
WEB PROGRAMMING JavaScript.
JavaScript: Introduction to Scripting
PHP-II.
Presentation transcript:

VoiceXML: Events, Errors, and ECMAScript

Acknowledgements Prof. Mctear, Natural Language Processing, University of Ulster.

Events 1.Plain events – happen normally, involve special event handler 2.Error events - unexpected situations, may cause application to terminate Plain eventsError events cancel, help, exit (user)error.badfetch noinput, nomatch (user input)error.semantic connection.disconnect.hanguperror.noauthorization maxspeechtimeouterror.unsupported.builtin Note: how events are handled is platform-dependent

Default catch handlers Event TypeAction canceldon’t reprompt errorexit interpreter exitexit interpreter helpreprompt noinputreprompt nomatchreprompt maxspeechtimeoutreprompt connection.disconnectexit interpreter all othersexit interpreter

noinput, nomatch System does not detect any speech. This event is thrown when the timeout interval is exceeded (in IBM WebSphere Voice Toolkit the default timeout interval is 500 milliseconds). The user’s input does not match the recognition grammar. The default behaviour in the IBM WebSphere Voice Toolkit for this event is to output a message and then re-prompt. These (and other) default event handlers can be modified. Properties such as “timeout” can also be modified.

I did not understand what you said. Please answer the question again.

Shorthand elements Some common events, such as noinput, nomatch, help, and error have shorthand versions, e.g. I did not understand, please try again. I didn’t hear anything. Please speak a little louder. With counters:

Used to define application-specific events e.g. user has failed 3 times to enter valid id That is not a valid i d … Please check your i d. Goodbye

Event handlers and scope Event handlers can be defined at different scope levels Scope levels form a hierarchy. Event handlers defined in a higher scope level are inherited at lower scope levels within the hierarchy. A local event handler overrides or replaces an inherited event handler. If a local event handler has the same name as an inherited event handler, then the local event handler replaces the inherited event handler. The VoiceXML interpreter examines the following containers in the order listed to select an event handler: 1. Field 2. Dialog 3. Document 4. Application 5. Session

Tutorial Exercises: Error handling Aim: to explore events such as and and modify their default behaviours 1.Run the file ‘studentsystem1b.vxml’ and test how it behaves when a) You do not say anything; b) You say something that is not in the specified recognition vocabulary. 2.Modify the default behaviours for and using counters for alternative behaviours. 3.Define an application specific event using that causes the application to terminate with some form of explanation following an event such as repeated failure to elicit valid input. The event could be a third failure to elicit the user’s spoken input, with an event thrown such as “error.no_input”. This event can be caught, causing the system to transfer to a human operator. Include a prompt that explains what is happening. If transfer is not possible, then use or to cause the application to terminate.

What is ECMAScript? Used as the scripting language of VoiceXML for client- side processing, e.g. to validate user input (without requiring access to the server), or to dynamically generate values. VoiceXML variables are completely equivalent to ECMAScript variables. The “expr” and the “cond” attributes reference ECMAScript expressions. Escaping characters to conform to the rules of XML e.g. Or use the element e.g. <![CDATA[... ECMAScript code... ]]>

ECMAScript Example <![CDATA[ var now=new Date(); hours=now.getHours(); minutes=now.getMinutes(); seconds=now.getSeconds(); ]]> The current time is hours, minutes, and <value expr ="seconds"/> seconds.

More on the date object The Date object stores a year, month, day, date, hour, minute, and second. Methods of the Date object include : getSeconds( ) returns the seconds in Date get Minutes( ) returns the minutes in Date getHours( ) returns the hours in Date getDay( ) returns the day of the week in Date beginning at 0 getDate( ) returns the day of the month in Date getMonth( ) returns the month in Date beginning at 0 getFullYear( ) returns the year as a 4 digit string

Example with : Calculating variable interest What is the amount in your account? <![CDATA[ if (amount <= 1000) {interest = 0.02} if (amount > 1000 && amount <= 10000) {interest = 0.03} if (amount > 10000) {interest = 0.04} interest_calculated = interest * amount; ]]> the interest on your balance is

Tutorial Exercise: ECMAScript Using the file ‘interest.vxml’ as a basis, create a file called ‘commission.vxml’ that elicits the selling price of a property and then calculates the commission fee based on the following rules: 1. if (amount <= 90000) {fee = 0.05} 2. if (amount > && amount <= ) {fee = 0.04} 3. if (amount > ) {fee = 0.03}

Universal Commands and Navigation

Overview Using a root document for global commands and storing information Navigation within and between documents The element Exercises: Using a root document Creating a subdialog

Root document Simple applications may consist of one document. Larger applications may consist of several documents, one of which is the root document, and the others are child documents of the root document. The root document can contain event handlers, grammars, variables, scripts and other constructs in the scope of the application which are inherited by the child documents. These elements are active throughout the entire application, unless otherwise specified. The child documents must reference the root document using the “application” attribute of the element, e.g. (assuming root document is called “root.vxml”: Note: the root document can have any arbitrary name)

root.vxml main menu start over Variable stored with application scope - can be referenced by leaf documents Link with grammar of words available throughout application and specification of where to go next

logon.vxml what is your four digit pin Assigns value to the variable ‘user_pin’ which Is stored with application scope in ‘root.vxml’

Retrieving the value The value stored as an application level variable can be retrieved as follows: Your pin is The prompt demonstrates that the value of ‘user-pin’ is available to each leaf document that references ‘root.vxml’

More on Navigation Transition to other forms etc when the FIA has processed a form (dialog) - Used within the element to select and transition to another dialog. - Used within,,,,,,,,, and - Used within,,, and Used within,,,,,,,,, and

Attributes for navigation Specifying the target item: next - A URI reference e.g. next=" (absolute reference) next=“students.vxml“ (relative e.g. in same directory) next=“students.vxml #first_query" (specifies dialog within the document) nextitem - The name of an input item within the same form e.g. nextitem = “student_name” expr - A URI reference that is dynamically determined by evaluating the ECMAScript expression e.g. expr=“student_system' + '#' + ‘first_query'“ expritem - The name of an input item within the same form

transition to another form item within current form, another form within current document, or another document transitioning to another dialog or document using will cause the old dialog’s variables to be lost. If the variables are to persist across multiple documents, they should be stored with application scope used to submit values to the document server via an HTTP GET or POST request “namelist” attribute specifies which values are being submitted e.g. Control will not necessarily return to the calling document. For example, the script specified in the “next” attribute might generate a VoiceXML document dynamically and execution will continue with this document.

terminates all loaded documents and returns control to the voice browser which determines what to do next Attributes: expr—ECMAScript expression that is evaluated as the return value namelist—List of variable names to be returned example

Causes the voice browser to disconnect example Note: Before ending the session, developers can catch the event to perform some post- disconnect processing such as submitting any remaining data to a Web server.

(1) Enables the user to connect via the telephone to another voice application on another speech server. Also enables the user to connect to a person's telephone. Frequently this will be an operator or help agent that assists a user having trouble. blind transfer the caller can converse only with the party on the other end of the connection. bridge transfer the caller may converse with another party and also hear prompts and respond by speaking or pressing the keys on a touchtone telephone. This enables the caller to proactively end the transferred call.

(2) When the transfer is complete, the connection is broken. Once the transfer disconnects, the instructions in the element associated with the element are interpreted. The input-form-item variable may contain values including the following which indicate why the transfer was not successful: busy - The other person was busy. noanswer - The other person did not answer. network_busy - An intermediate network was not able to transfer the call. Various shadow variables contain information about a successful transfer e.g.. duration of the call transfer in seconds. mode used by the caller to terminate the transferred call (voice or DTMF

Enables frequently used code to be saved in a library and re-used in several applications When invoked, a subdialog executes in a new execution environment; it does not inherit any parameters from the calling dialog. The subdialog proceeds until it encounters: element—Ends the execution of a subdialog and returns control and data to the calling dialog. Data is returned to the calling dialog as a namelist. When the subdialog returns, its execution environment is deleted. element—Execution stops No form items remain eligible for the FIA to select - Execution stops

Welcome to the Student System Main Menu hello liz | margaret | mike | guest Please say your user name Go to subdialog to elicit name which is returned to main dialog for greeting studentsystem3a.vxml

Welcome john | david | rosemary | jennifer Please say your user name </prompt hello 2 Pass value into subdialog for validation studentsystem3b.vxml

Welcome … elicit name … hello the student number is 3 Pass values in both directions: elicit value and pass to subdialog for validation, return to main dialog with result studentsystem3c.vxml

Tutorial Exercises: Using a root document 1.Assuming that you have separate documents for the main elements of the Student System - student details, course details, view student details, reports, and a main menu document - create a root document with links to these documents. Provide a link in the root document that will enable the user to navigate to the main menu document from any other document in the application. 2.Create a variable with application scope in the root document to hold the user's pin. Elicit a value for the user's pin in a file such as logon.vxml, store the value in the root document and access it from some other child document.

Tutorial Exercises: Subdialog (1) 3.Passing values back from a subdialog following some computation within the subdialog Load and run the file studentsystem3a.vxml. You can say one of the student names (john, david, rosemary or jennifer) in response to the system prompt. 4.Passing values into a subdialog to be referenced in that subdialog Load and run the file studentsystem3b.vxml. As before, you can say one of the student names (John, David, Rosemary, Jennifer) in response to the system prompt.

Tutorial Exercises: Subdialog (1) 5.Passing values in both directions Load and run the file studentsystem3c.vxml. This time you have to say the student name 'John' for the conditional statement in the subdialog to evaluate correctly. 6. Add further conditions in the subdialog for the names 'David' and 'Rosemary'. Amend the code in the main dialog so that if the user says the name 'Jennifer', the system responds 'Sorry that student is not listed in the database'. Note: Names that are not in the database will still have to be included in the recognition vocabulary to be recognised and passed on to the subdialog.