Voice Portals and VoiceXML, Part 4

Learn how to add dynamic functionality to VoiceXML applications in this last of a four-part series.

Steve Milroy

July 31, 2001

2 Min Read
ITPro Today logo


You can host VoiceXML applications on any typical Web server, and you can use any server-page technology—such as Active Server Pages (ASP), ColdFusion, or Java Server Pages (JSP)—to develop and deliver dynamic VoiceXML content. I prefer ASP because learning and using VBScript is easy, and you can use many third-party tools with ASP. All ASP features work with VoiceXML applications, including ADO and custom COM objects such as functions and sessions. You can use cookies, too, but because all users share the same voice browser when they use a VoiceXML application, cookies hold little value.

To use ASP to create a dynamic VoiceXML application, you need to change the file extension from .vxml to .asp. Doing so forces the application to use the ASP engine. Now, you can begin to add dynamic features to the application. (To review the VoiceXML code sample, click Download the Code from the Article Info box at the right.) The code demonstrates how to use ASP to add dynamic functionality to the VoiceXML code example presented in my previous Wireless & Mobile UPDATE Tips and Tricks article.

The new code shows the application's first new dynamic aspect: the ability to use the Response object to generate the Welcome menu. I used a static string to output in this example, but you can use any variable from dynamic content.

Embedded grammar is the application's second new dynamic aspect. At the top of the VoiceXML file, I dimensioned variables, created a connection to the VoiceXML database, defined a SQL statement, and established a recordset with all the English and Spanish grammar and option values, which are used to match verbal input for use of the application.

After you create the recordset, you can use it to dynamically generate the grammar definition. When you use the correct syntax and the grammar tags, you can loop through the recordset and output the grammar values. You can also see that the "hangup" option remains static, so you can use a combination of static and dynamic content for the grammar or any other VoiceXML content. The advantage? You can leave static such commonly used grammar as "back" and "help."

The real world doesn't always welcome new VoiceXML applications with open arms. At the Tellme.com studio, I created and tested this article's examples and several commercial VoiceXML applications. As the commercial applications neared completion, I tried to organize deployment with Tellme.com's voice-browser Voice ASP service. Tellme.com's representative, however, told me that my client's estimated call volume was so small that the company couldn't use the applications. Voice ASPs Voxeo and BeVocal expressed more interest. If you want to deploy VoiceXML applications on a small scale, visit Voxeo or BeVocal online.

The next Wireless & Mobile Tips and Tricks column will address wireless middleware, infrastructure that facilitates the delivery of wireless applications.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like