9 - dynamic voicexml and jsp

19
Dynamic VoiceXML and JSP 

Upload: ajay-mishra

Post on 13-Oct-2015

43 views

Category:

Documents


2 download

DESCRIPTION

VoiceXML and JSP implementation

TRANSCRIPT

  • Dynamic VoiceXML and JSP

  • Overview Dynamic VoiceXMLRetrieving information from the WebChanging information on the WebDynamic generation of VoiceXML documentsDynamic grammar generation

  • From static to dynamic VoiceXMLAim to create Web applications that emit standards-compliant VoiceXML. Similar to visual Web - static HTML pages have been replaced over time by server-side Web application frameworks that emit HTML. Abstract the details of back-end integration, as well as the underlying business logic that determines the transitions among different stages in an application, Helps developers integrate user tasks into larger applications. Move from voice-specific programming model to one in which voice interaction is authored as a specialized view that binds to a common underlying Web application.

  • Web server e.g. Apache Tomcat Scripting language e.g. Java Server Pages (JSP) Dynamic VoiceXML

  • Types of transactionRetrieving information e.g. users name, balance, recent transactionsChanging information e.g. change pin, transfer fundsGetting items from a database to create a recognition grammar e.g. account types for a particular customer

  • ProcessesThe system submits the digit string to a web server using The web server invokes a JSP script.The script makes a connection to a database using the JDBC-ODBC bridge.A record is retrieved from the database.Items from the retrieved database record are incorporated into dynamically generated VoiceXML code.

  • Retrieving informationDatabase: bank.mdb

    Getting the users nameuserdetails.vxmluserdetails.jsp

    Getting balancebalance.vxmlbalance.jsp

    Recent transactionstransactions.vxmltransactions.jsp

  • example
  • userdetails.jspvxml file with embedded JSP e.g.

  • Getting data for Dynamic Output if(rs.next()) {//set up variables to contain the database fields data String firstname;String lastname;// etc.

    // obtain and print out the record of the database.do{firstname = rs.getString(2);lastname = rs.getString(3);// etc. }while (rs.next()); } //end of if

  • Dynamic Output//set up dynamic vxml %>

    Hello

  • Dynamic GrammarsA dynamic grammar is required when the recognition vocabulary relevant to a prompt is not known in advancee.g. each person may have different account names, so the recognition vocabulary should include only those names that are relevant for the current user The information would normally be kept in a database, which would be regularly up-dated. A static grammar that is created in advance would be difficult to update every time the database is changed. A better solution is to dynamically create the grammar at run-time by consulting the most recent entries in the database.

  • Creating dynamic grammarsConnecting to a database to retrieve a list of words to be modelled.Creating an inline or external grammar file that contains these words.Retrieving the list of words involves the use of a JSP file to access a database and retrieve the required words. The grammar file requires a procedure to write the words with the appropriate grammar format and to call the grammar, as appropriate.

  • Exampleaccount_details.vxml

    accdetails.jsp

    Dynamically creates grammarsfor the fields destination and source.

  • do{acc = rs.getString(1);accgrammar.append("");accgrammar.append(acc);accgrammar.append(""); }while (rs.next());

    what is the source account?

  • what is the source account?

    Current Savings

    Dynamically generated output

  • Some more examplesbalance.vxmlAsks for pin and account (can say savings, current or all)balance.jspQueries depending on which account (or all accounts)Dynamically creates messages for balance for each account

    change_pin.vxmlElicits values for old and new pinchange_pin.jspUpdates pin

  • Example: recent transactionstransactions.vxmlasks for pintransactions.jspLooks up last 5 transactionsDynamically creates output e.g. Transaction 1 500.0 from Current account to Savings account on 20050401