Avaya DevConnect Center
Home IP Communications Contact Centers Unified Communications Communications Enabled Business Processes Avaya DevConnect Portal RSS Feed
Register to join the Avaya DevConnect Program to gain access to Avaya APIs & SDKs, purchase Avaya products for development at discounted prices, and receive a discount on training and certification. More information
Sign up for your free email newsletter today!
Avaya Developer News

More Newsletters

Take the Challenge: Build Your Own Voice-Enabled Applications
Learn how to create voice apps with Avaya's Eclipse-based Dialog Designer and the Interactive Response or Voice Portal platforms and easily deploy them on IBM WebSphere Application Server. 

Your company uses IBM's WebSphere suite of products. You're familiar with Eclipse. Your company is an Avaya customer using Avaya Interactive Response (IR) or Avaya's Voice Portal platforms. Here's some breaking news out of Avaya: You can use your existing WebSphere Application Server (WAS), along with Avaya's Interactive Response or Voice Portal platform, to run voice applications you create with Dialog Designer. Avaya's Dialog Designer Integrated Development Environment (IDE) provides a tool set that leverages both your company's WAS and communications infrastructures to speech enable your Web applications.

Related Resources
  • Article: Avaya Makes Voice Application Development Look Easy

  • Upgrade Your Avaya Dialog Designer Software

  • Avaya Dialog Designer Getting Started Guide

  • Dialog Designer Product Brief

  • Dialog Designer's Developer Guide (PDF, 2.85MB)

  • DevX WAS Resource Center

  • Download WebSphere Application Server

  • This article will walk you through building a basic voice application using Dialog Designer and deploying it on a WebSphere Application Server. First, let's go over some of the architecture behind it all.

    Voice Portal enables you to build a single business-value application that can be presented to users visually through a portal and Web browser interface, or audibly through a speech-driven interface. The presentation layer—the UI (GUI or VUI)—will be different depending on whether the user is interacting via telephone or Web, and those parts will be written differently, but Dialog Designer (both IR and VoicePortal) takes advantage of the standard 3-tier Web architecture and allows the application developer the opportunity to reuse the business logic. For example, it is easy to present a fill-in form with pull down menus visually through a Web page, but enabling a user to navigate through field by field using a speech interface is much more complex. In the past, you would have had to create two independent applications—one tailored for the Web, and one for interactive voice response (IVR)—to accomplish the same business process task. With a voice portal, much of the application infrastructure can be common across both access methods, thus reducing development and maintenance costs.

    Dialog Designer is based on Eclipse, which makes it compatible with other Eclipse-based tools, such as IBM's WebSphere Application Server. As a result, applications written for Avaya IR and Voice Portal platforms that are written with Dialog Designer, or another Eclipse-based voice IDE, can easily run on WebSphere Applications Server.

    Further, Avaya IR and Voice Portal support integration with WebSphere Voice Server as a speech engine for speech recognition. WebSphere Voice Server is one of the speech engines that can be configured to run as part of the Avaya Voice Portal platform. Voice Portal and Avaya IR also leverage Web services and Service-Oriented Architecture (SOA) to access information.

    Let's go through how to build a basic "Zip Code" speech application using Dialog Designer, and then explore how to deploy the application to IBM WAS. After you learn the basics of developing a voice application with Dialog Designer, you'll take a brief look at a sample Web services application available on Avaya's DeveloperConnection site.

    Downloading and Installing
    If you have not signed up as an Avaya DeveloperConnection member, you'll need to do that first. Here's how:
    1. Go to the DeveloperConnection area on the Avaya site. In the box on the left, either click Member Login if you have already registered, or click Register Now if you have not already registered.
    2. Next, click Avaya Product Information/Documentation/SDKs under Do Your Research. Click the link under Premium DevConnect Content called Sort by Avaya Platform. Next, under Avaya Self Service, click Avaya Dialog Designer.
    3. Scroll down and click Download Avaya Dialog Designer. The application is about a 250 MB download, so be sure you have a high-speed connection.
    4. Install Dialog Designer. After you download the zipped file and save it to your hard drive, locate the setup.exe file and launch it. Follow the installation wizard to set up Eclipse, set up Apache Tomcat, configure Eclipse to display the Dialog Designer plug in, and configure the Microsoft Speech SDK.

    To configure the software and make Dialog Designer fully functional, you'll need to create access options; set up the workspace; set Dialog Designer preferences; and if you want to use a microphone to simulate responses, configure the SDK for microphone input. See the Avaya Dialog Designer Getting Started Guide for details (located on the Dialog Designer page in DevConnect where you downloaded the application).

    Creating a Basic Application
    To create a basic application, you will create four types of voice nodes: Start, Prompt and Collect, Announce, and Return. Each node will perform a specific function, such as prompt and collect, that allows you to create a prompt that requests that the user give the system certain information, and then set variables that allow the system to collect that information. These nodes, once they're created, will be connected to create a call flow. In a more complex application, you could have numerous call flows. You'll just create one call flow here.

    First, you need to start Dialog Designer. After opening Eclipse from either the icon on your desktop or from the Start menu, go to the Window menu, and select the Perspectives submenu. On the Perspectives submenu, select Speech. Dialog Designer opens in the Eclipse window.

    Click the New icon on the toolbar, and select Speech Project from the menu to create a speech project. When the Speech Project window displays, type the name zipcode in the Project Name box. Click the Next button to scroll through the next two windows until the Languages window displays.

    In the Languages window, select the language in which you want to create your speech application. Click the Finish button. A new project called zipcode is created, with the file called main.flow, and a call flow opens with AppRoot as the root directory.

    The first node displays on the canvass in the zipcode tab on the right, along with the palette used for building applications in the Navigate tab on the left. The first node, Start, is already named for you by default.

    You can use templates available in Dialog Designer under the Templates folder on the menu next to the canvass to create your nodes using pre-built nodes, which perform specific functions such as prompt and collect.

    Creating the Prompt and Collect Node
    Next, you will create a Prompt and Collect node that tells the system to accept five numbers as variables for the caller's zip code. The Prompt and Collect node will play recorded speech, prompting the caller to input his or her zip code, and then collect zip code information from the caller.

    Create the Prompt and Collect node by clicking once on the Prompt and Collect Node icon from the palette next to the canvass and clicking a second time in the canvass. Name it getzip by clicking in it and typing the name. Click the Enter key. Double-click the getzip so you can view the node's properties in the Avaya Properties tab below the canvass. In the Avaya Properties tab, type the name getzip under Value.

    Next, double-click the Prompt and Collect node to open it and reveal the Callflow item editor. Then, rename the input field from untitiled to zipcode.

    Now that you have created and named your Prompt and Collect Node, you will create a variable in the Input field that matches the name of the input field that you will assign to your Announce node later. Click on the Input field, and in the Avaya Properties tab, name it zipcode. Set the N-Best value equal to 1, and set the Modal to false.

    Next, you need to define its prompts and grammar. The prompt defines what speech the system will say to the caller. For the getzip node, you will create three prompts and one grammar. The first prompts the user to input the zip code.

    Click the Create a New Prompt icon on the toolbar. A window displays asking you to name the new prompt file. Name it input. Click Finish. On the zipcode [main.flow] window, double-click the getzip node. Under Input, select the Prompt, then right-click and select Edit Prompt. You can now add segments to the prompt. Click TTS (Text-to-Speech) to assign text-to-speech to the prompt, and click again in the canvass. Click the TTS you just added, and in the Avaya Properties tab under Value, type, "Please speak your five-digit zip code." Click Save.

    In the intro.prompt tab, assign the Bergein type to speech. Set the Play Order equal to standard, and in Prompt Level, type 1.

    Return to the zipcode[main.flow] window, and click the Prompt you just created. You now need to assign the value intro (which will assign the TTS) in the Avaya Properties tab. You can now select intro from the drop-down menu under the Value column. Click Save.

    Note: After you save the first time, you should see a dialog box that tells you how many errors you have in your project. These errors display only because you are not finished with your project. You will see errors if you have created and named the nodes, but you have not assigned grammar and prompts where needed or if you have not connected the nodes. In the Problems tab at the bottom you will see a list of the errors you have. Double-click each error and you can see where in your project the error lies. Do not bother rectifying the issue or issues now; finish the project first.

    Now you need to create a grammar for the getzip node, so the system will know what values to accept. Under the File menu, select New, Grammar File. Select your project, and then name the grammar file zipcode. Select the Type to be Static; select the Mode to be Voice; select the Custom option in the Style drop-down list box. Click Finish. Click Save. In the getzip window, select the Grammar you just created, and right-click to select Edit Grammar. In the first column, type on each row the words for the numbers one through nine, making sure to include zero at the end. Also, type oh in case the caller says the letter O in place of a zero. Click Save.

    In a more sophisticated application, you may want to look up the value in a database or perhaps you need the numerical value of the zip code, like 95033, and not nine, five, zero, three, three. In that case, you also need to set the tag for each row in the first column. The Input is one and the tag is 1. However, in this example where you simply play back the result, it will work without doing this step.

    In the one row, under columns 2, 3, 4, and 5, type %1. The %1 in the last four columns is a reference to the first column.

    Return to the getzip window and select the Grammar. In the Avaya Properties window, select Name to be zipcode in the Value column.

    Now, you need to create and assign a prompt to No Input. This is speech that the system will repeat back if the caller does not respond with any input. Under File, select New then Prompt File.

    A window displays asking you to name the new prompt file. Name it niprompt. Click Finish. Select the Prompt under No Input and right-click to select Edit Prompt. Add a TTS. In the Avaya Properties window, Value column, type, "Sorry I did not hear you". Click Save.

    On the getzip window under No Input, select the Prompt, then click in the Avaya Properties tab. You can now select niprompt from the drop-down menu under the Value column. Click Save.

    Now, you need to create and assign a prompt to No Match. This is speech that the system will repeat back if no match with the zip code is found. Under File, select New, Prompt File.

    A window displays asking you to name the new prompt file. Name it nmprompt. Click Finish. Select the Prompt under No Match and right-click to select Edit Prompt. Add a TTS. In the Avaya Properties window, Value column, type, "A zip code is 5 digits". Click Save.

    On the getzip window under No Match, select the Prompt, then click in the Avaya Properties tab. You can now select nmprompt from the drop-down menu under the Value column. Click Save.

    After you have created the three prompts and one grammar for the getzip node, save the file, and click Generate, Project under the Project menu.

    Creating the Announce Node
    Next, create an Announce node. The Announce node will play back the zip code input that was just collected from the caller with the getzip node when the application is complete. Return to the Application Flow tab. Click the Announce option under Templates, and click again in the canvass. Name it result. Click Enter.

    Now you need to create, name, and assign a value to the prompt for the result node. Click the New, Prompt File on the File menu. A window displays asking you to name the new prompt file. Name it result. Click Finish.

    Right-click on the newly-named prompt in the zipcode window and select the Edit Prompt option. Under Segment to the left of the canvass, click TTS and then click in the canvass. In the Avaya Properties window, type the text in the Value column that you want the system to speak to the caller after the zip code is spoken. Type, "Your zip code is ". Click Save.

    Next, in the same window, click the Text Variable icon and add a text variable to the canvass. Assign it the value zipcode in the Value column on the Avaya Properties tab. Make sure the Format is equal to Text. Click Save.

    Next, you must select the zipcode variable and a field within the zipcode complex variable.

    When you created the Prompt and Collect node, you created a variable in the Input field that matches the name of the input field on your Announce node. Now, the system knows what text to play back to the caller.

    Create the last node by selecting the Return Node option and clicking on the canvass. Name it Done. Click Save.

    Connecting the Nodes
    Now you need to connect the nodes. In the zipcode [main.flow] window, select the Application Flow tab at the bottom of the canvass. Click the Connector icon to the left of the canvass. On the call flow you have created in the canvass, click Next to the right of the Start node. Then, click the Prompt and Collect node you created called getzip. You now have connected the Start Node with the first Prompt and Collect Node. Generate the code.

    Next, click Next to the right of the getzip node, and then click the Announce node that you named result. You have connected the Prompt and Collect node to the Announce Node.

    Next, click Next to the right of the Announce Node called result, and then click the Return node that you named done. You have now connected all nodes in your application.

    Save the project.

    Testing the Application with the Simulator
    You can simulate the voice application you just created by selecting the project in the Navigator tab. Right-click the project name. Then, on the pop-up menu, click Generate.

    Next, start Tomcat by clicking the Tomcat icon on the toolbar.

    Click in the Avaya Voice Browser tab, below the canvass, and select your project. Click the Start Call icon, and follow the voice prompts. Your application should simulate a dialog between you and the system, asking you for your zip code. Speak your zip code into your computer's microphone. Dialog Designer will respond to confirm your zip code.

    Congratulations, you have now successfully developed a voice-enabled application using Dialog Designer. Now you are ready to take on a real application, after which you can deploy it to your server.

    Deploying the Application to a WebSphere Server
    You can deploy your application to any Java-based Web server, but as an IBM developer, you can use your existing WebSphere Application Server to host the application. Dialog Designer has a Export option under the File menu. Select the Export option to start up the Export Wizard. Next, on the Platform Details window, select the platform to which you want to deploy the application. Select the application server (in this case, it's likely WebSphere). Next select the speech recognition server.

    Depending on the application server you are using, further configuration of the server may be required. This varies by server, so you may need to consult Dialog Designer documentation or your server's documentation.

    Sample Google Web Services Application
    Now that you have learned the basics of Dialog Designer, you can access the sample Google Web Services Application and try to replicate it. Avaya created this sample Web services application and documented in detail how it operates. A detailed configuration of the hardware required to deploy a Dialog Designer Web Services application, along with a multitude of other helpful information, can be found in the Google Web Services Sample Application Documentation.

    The Google Web Services Application describes how to invoke a Web Service Description Language (WSDL) file hosted by Google to perform a Google search on any valid zip code (US) provided by the caller. The first ten results are obtained and read back to the caller in sequence. This application requires many more nodes than the basic nodes you created in your Zip Code application. These are the nodes you will need to create: collectzipcode; sendtogoogle; parseresults; announcehits; announceresults; choices; goodbye; getnext; exit.

    As a developer, you will need to get a Google API key from Google to execute this demo. Information about this process is available in the application notes where you download the sample application.

    You can find more information on creating your own Web services application with Dialog Designer by logging into Avaya DeveloperConnection and accessing the Dialog Designer page from which you downloaded the application. Further, Avaya DeveloperConnection contains an abundance of information on its Dialog Designer page that can help you learn more about creating voice-enabled applications for Avaya Voice Portal with Dialog Designer.


       
    Shari L. Gould has more than 16 years of journalism and technical writing experience. Shari has written for numerous leading publications throughout her career, most recently Software Development Times and its various publications, and had an article hand picked by Sun Microsystems for inclusion in its Solaris Developer Connection. She also has more than 10 years experience working with high-tech companies documenting everything from network designs and installations, through software design and APIs, to user interfaces. Shari currently is pursuing her Master's degree in Criminal Justice, specializing in Information Security.



    JupiterOnlineMedia

    internet.com earthweb.com Devx.com mediabistro.com Graphics.com

    Search:

    Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

    Jupitermedia Corporate Info

    Copyright 2008 Jupitermedia Corporation All Rights Reserved.
    Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

    Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers