Environment Options and Trade-offs
When choosing an environment, you must consider the trade-offs between having your own simulated environment and using a Web-based tool. Having your own build-and-execute environment gives you the most control but may require more "getting your hands dirty" than some readers want. Conversely, the Internet tools approach will already support the nuts-and-bolts of what most developers want to do, but how the tools work is pretty much out of your control.
When we talk about toolkits we are talking about several different things. Here "toolkit" includes single-vendor solutions that may be an Integrated Development Environment (IDE), a suite of individual development tools that are loosely integrated, or a Web-based development environment, a relatively new type of tool.
We will talk about three basic environments:
Hosted environment (PC-based with hosting)
Simulator environment (PC-based with simulation)
In a hosted environment, you code using your favorite text editor, put your VoiceXML code on a Web server, and access your application through a voice service provider (VSP). This is the primary function of VSPs, so all support this, some free through developer programs.
There are numerous advantages to using a VSP instead of a simulator that you interact with through your PC microphone and speakers (or headset). Ignoring for the moment any Web-based development tools VSPs have, by using a VSP, you will be using the "real" voice Web interfacethe telephone. By using the same interface as your users, you can more easily identify problems, such as interface issues and network latency.
But several VSPs have gone beyond just providing voice services to also offer Web-based tools. They include Web-based environments that provide everything you need to write applications. Some even remove the need for putting your VoiceXML on a Web server by hosting your VoiceXML, while also allowing you to link to a remote server if you wantfor example, if you are writing server-side code, which would require you to use a hosted environment.
For ease of installation and configuration, the Web-based tools available through the developer programs of these companies are the way to go. We will call this a Web-based environment.
If you are only interested in working with VoiceXML at a high level and not some of the underlying technologies, you can avoid the discussion of simulators, XML editors, and suchjust join one of the developer programs, and you can be writing and testing VoiceXML code in a few minutes. Whichever approach you decide to take, visit the simulator and VSP Web sites and check out what they are doing. Each vendor offers valuable tools whether you decide to use its complete environment.
So why not just register for some of the Web-based toolkits and be done with it? In many cases, this is the best course, but often circumstances require assembling a custom environment.
If you use dial-up Internet access and have a single phone line, you may not like a Web-based environment. If that line also provides Internet access, you must disconnect your Internet session, dial the phone number to test your application, and then reestablish an Internet connection.
Some VSPs alleviate this problem somewhat by providing a "validator" that checks the syntax of your VoiceXML and a text interface that allows you to interact with your applications via keyboard input. These are useful, but by this point you are getting pretty far away from how your application will actually work.
Another possible advantage to using a simulator is that through installing, configuring, and maintaining it, you gain greater knowledge of the internals of how VoiceXML interpreters and gateways work. If that is your interest, you may prefer the simulator approach.
The following sections look in detail at each environment option.
At a high level, implementation of a VoiceXML project consists of writing the VoiceXML code, providing supporting data such as audio files and grammars, debugging the code, and running the application via a VoiceXML gateway. To accomplish these tasks, a minimum set of tools consists of a text editor, access to a Web server, and VoiceXML gateway support from a VSP. We will now look at each necessary component and some options you can choose between.
To start writing VoiceXML, the only real requirement is a text editor. In Windows, you may use Notepad or WordPad (remember to use the "Text Document" file type). A number of excellent shareware and freeware programmer text editors also are available with features such as advanced file management and text color coding.
VoiceXML editing tools are also becoming available. Although any XML editor that allows you to import a DTD will work, there are now a few VoiceXML-specific editors available, such as those from Voxeo and HeyAnita. Tellme networks also offers an EMACS VoiceXML major mode download.
Voxeo Designer is an example of an editor specifically for VoiceXML. Using Designer, you can view and edit your program through either a flowchart view or actual code. Although tools such as this are not essential, they are interesting and probably helpful when you are starting with VoiceXML.
After you have created a VoiceXML program, the next step in running in a hosted environment is to put your program on an appropriate Web server so that you can link your application's URL to a phone number served by VoiceXML gateway. Although some VSPs allow you to upload your VoiceXML code to their servers, this limits your ability to write server-side code.
The changes required to your Web server vary from VSP to VSP and, depending on
your service provider and Web server, no additional MIME types may be
necessary. Browse your VSP's FAQ to learn its current requirements for the
particular Web server software you are using. Following is an example of the
kind of change you may have to make to add a new MIME type to your Web
server:File extension: text/vxml Content type: VoiceXML source code MIME type: text/xml
Other MIME types you are likely to see on various platforms are application/x-vxml, application/vxml, and text/x-vxml. Additionally, some VSPs may require other types, such as supported audio file formatsbe sure to check your VSP's requirements.
If you are using Apache HTTP Server, modify the httpd.conf file to add the new MIME type.
If you are using Microsoft IIS Server, open the Management Console and select Action. From the Actions menu, select Properties, File Types. Now you can enter the new MIME type.
If you are using Java Web Server, open the Management Console in your Web browser. Select the Management link and then select MIME Types. Add the new MIME type here.
Running Your VoiceXML Code
You've saved a simple VoiceXML program and put it on your Web server. The next step is to get an account with a VSP. The service providers we are going to talk about may do much more than offer VSP services, in fact, that may not be their focus at all. These companies, however, do offer VSP service through developer programs that are open to membership.
Some developer programs we will discuss include: BeVocal (http://www.bevocal.com), HeyAnita (http://www.heyanita.com), Tellme Networks (http://www.tellme.com), VoiceGenie (http://www.voicegenie.com), and Voxeo (http://www.voxeo.com). At the time of this writing, these companies provided free accounts, some with toll-free telephone access, for programmers who joined their developer programs.
As long as VSPs provide free developer programs, it makes sense to become familiar with as many of them as possible until you develop a preference, and perhaps even afterwards to keep an eye on new features.
To run your VoiceXML application, you need to link your application's URL to a telephone number (and possibly a combination of ID and PIN) provided by the VSP you select. After you join a VSP's developer program, use the following procedure to link your application to a phone number from the VSP.
Log in to BeVocal's Café developer network with your user ID and password. After logging in, you see the File Management page. From here, go to the Remote URL Based Application Development section. Enter the URL of your application (see Figure 3.1) and click the Add button. The URL now appears in your list of URLs at the bottom of the page. There you can click Activate to make your application active.
Figure 3.1 Enter your application's URL in Café's File Management screen to run your code using BeVocal.
When you call BeVocal Café to access your application, you are prompted to enter your PIN and user ID. You then are taken immediately to your application.
Log in to HeyAnita's FreeSpeech developer network with your developer ID and PIN. Select the URLApp tab. There enter your application's URL (see Figure 3.2). After you have entered the URL of your application, you can click Check Syntax to confirm that FreeSpeech correctly accesses your VoiceXML code. Click Update to make your application active.
Figure 3.2 Enter your application's URL in FreeSpeech's URLApp tab to run your code using HeyAnita.
When you call FreeSpeech to access your application, you are prompted to enter your developer ID and PIN. After you have logged in, you are prompted whether you want to access RapidApp, FileApp, or URLApp. Use the appropriate response for the URLApp menu item to access the application you configured previously through the FreeSpeech Web site.
Log in to Tellme Studio with your Developer ID and PIN. On the Application URL tab, enter your application's URL (see Figure 3.3). Click Update. You can run your application by dialing the access phone number and when prompted enter your Developer ID and PIN.
VoiceGenie Developer Workshop
Log in to VoiceGenie's Developer Workshop with your username and password. From the main workshop page, select Manage Extensions from the Tools category. Next, on the Manage Extensions screen, enter your application's URL (see Figure 3.4) and click the Add Extension button. The next screen reports the extension your application was assigned and the access phone number.
You can run your application by dialing the access phone number and when prompted enter the extension you were assigned.
Figure 3.3 Enter your application's URL in Studio's Application URL tab to run your code using Tellme.
Figure 3.4 Enter your application's URL in Developer Workshop's Manage Extensions screen to run your code using VoiceGenie.
Log in to Voxeo Community developer network with your developer username and password. When you are logged in, the Voxeo Account Manager appears on your desktop. From the frame on the left, select Applications, <add new app> (see Figure 3.5). This brings up the Application Provisioning Wizard.
Figure 3.5 Access Voxeo's Application Provisioning Wizard by selecting <add new app>.
On the first page of the wizard, click Next. On the following screen, enter the name of your application and click Next. On the next screen, enter your application's URL (see Figure 3.6) and click Next. In the next screen, you are asked to select your markup language, VoiceXML or CallXML. Select VoiceXML and click Next. Then you are asked to select a phone exchange.
Note that calls to your service are not free, and calling from an exchange different from the one you select here could result in long-distance telephone charges. On the next screen, confirm your previous choices and select Next. The final screen lists the phone number to access your service.
Before you call Voxeo Community, note that you will avoid problems by referencing Nuance's VoiceXML DTD stored at Voxeo. To do that, specify the document type in the line after your code specifying the XML version. For example
Figure 3.6 Enter your application's URL in the wizard's Application URL text field.
<?xml version="1.0"?> <!DOCTYPE vxml PUBLIC '-//Nuance/DTD VoiceXML 1.0b//EN' 'http://community.voxeo.com/vxml/nuancevoicexml.dtd'> <vxml version="1.0">
Now when you call the number supplied to you when you registered the application's URL, you are taken directly to your application.
As we have discussed, there may be times when you want or need to run your VoiceXML code using a simulator. One product that serves this purpose is IBM's WebSphere VoiceServer SDK.
Simulators require a good-quality microphone and speakers or a headset that combines both. In general, headsets function well for speech recognition, as do microphones that feature some type of noise cancellation. In general, if your microphone cannot make quality recordings using Windows' Sound Recorder utility, you will be disappointed with its results when combined with a desktop VoiceXML simulator.
Following are step-by-step instructions for installing and configuring this product and instructions how to use it to run your VoiceXML code.
IBM WebSphere Voice Server SDK
This product can be downloaded from the IBM alphaWorks site, alphaworks.ibm.com or via CD, which can be ordered from the alphaWorks site. The primary requirements are 200 MB of disk space (330 MB if you download from the Web), Windows NT 4.0 with Service Pack 6a or later, Sun Java Runtime Environment (JRE) 1.3 (which is included in the VoiceServer SDK distribution), and Adobe Acrobat Reader version 4.0.5 (also included in the distribution). During the installation process, you are prompted if your PC does not have a correct JRE.
After you have completed the installation steps, and your system has rebooted, use the Audio Setup program to configure your microphone. To test your installation, run the included sample by selecting from the Windows desktop Start, Programs, IBM Websphere Voice SDK, Audio Sample. This command should run IBM's sample, which records a message and plays it back.
To run your own VoiceXML programs, enter the following command from the directory that contains your source:
You will then be talking to your HelloWorld program. The Voice Server SDK comes with samples and documentation, including an excellent programmers guide.