Tutorial: Build your own email reader by phone using VoiceXML
Build your own email reader by phone using VoiceXMLby Mukund Bhagavan
This article demonstrates how to build an email reader for any phone using VoiceXML and Java Server Pages (JSP). The email reader application is an interesting application that illustrates the power of VoiceXML for every day use. The application allows a user to (a) register for the email reader by phone service by providing a POP server name, username, password and choosing a 4-digit pin that maps to this POP account (b) dial into the email reader and login using the chosen 4-digit pin and (c) listen and browse emails retrieved from the POP server. The user can browse through the sender and subject headers for all emails and then say 'more' to listen to the body of any email. For source code, download the following three zip files: download1.zip, wavs1.zip, and wavs2.zip. All three files should be downloaded to the same directory.
The development of the Email Reader application consists of the following steps:
- Application Design
- Application Testing
Development EnvironmentThe Email Reader application was created using the BeVocal Cafi, a web-based VoiceXML development platform. The BeVocal Cafi provides several tools for voice application development such as a VoiceXML trace tool, debugger, and text emulator and resources including extensive documentation and newsgroup support to enable developers to rapidly build VoiceXML applications.
- Design the dialog. The dialog of an application is an essential part of the voice user interface.
- Create audio for pre-recorded prompts. Pre-recorded audio significantly improves the quality and usability of a voice application. Where necessary, use text-to-speech (TTS) for audio output.
- Build an application in VoiceXML using static content
- Use the VoiceXML Checker to check for syntax errors and use the Vocal Debugger to test flow of dialogs.
- Test the application by calling the toll free number (1-877-33-VOCAL) provided by the Cafi.
- Extend the application to serve dynamic content using server side scripts (such as JSP)
- Test the application flow either by calling in or using the text-based tool (Vocal Scripter). Use the Trace tool to trace application flow while the call is in progress. Alternatively, you can use the Log Browser to view historical trace logs.
- Deploy your application as a demo and distribute it to a limited user group to gather user feedback
Application DesignThe application design for the email reader is quite simple. There are two discreet steps in the application:
- One-time registration. The registration provides a way for users to provide their POP account info and choose a pin that maps to this account. The POP account info and the pin mapping are stored to a persistent storage, and in this case it's a flat file. When the user calls in through the phone and logs in using their pin, the user's POP account info is retrieved from the flat file and used for fetching the emails.
- Call the application and listen to email. When a user calls the application, the application invokes a VoiceXML document that requests the user's pin that was previously entered on the web page. This pin is submitted to a JSP that fetches the user's email and generates the VoiceXML to read out the emails.
Page 1 of 2