VoiceXML Development Frequently Asked Questions

This FAQ contains answers to questions about VoiceXML development.

  1. What is the relationship between VoiceXML and JavaScript?
  2. Is the use of JavaScript a Tellme-specific extension?
  3. What JavaScript runtime engine does the Tellme Platform use?
  4. What version of JavaScript does Tellme support?
  5. How do JavaScript objects like the "document" and "window" map to voice applications?
Q: What is the relationship between VoiceXML and JavaScript?
A: The VoiceXML 1.0 specification defines not just the DTD for an XML-based voice markup language, but a complete voice application execution environment integrating the power of a general-purpose, procedural scripting language, ECMAScript (commonly known as JavaScript) with the declarative simplicity of XML.

The XML portion of the VoiceXML specification is designed purely to simplify the description of a voice application's call flow. It divides the application into a series of "dialogs" which gather data from the user, and between which control either flows sequentially or deterministically based on user input and the desired application behavior. The strength of this XML-based framework is the ease in which a specific caller interaction may be described. Each dialog encapsulates the processing for a single user interaction, including the prompts to play, the processing of caller input, and error handling. Though scoped variables, data operators, and branching/looping statements do exist within this framework, these constructs are primarily used to manage the call flow, rather than manipulate application data.

By allowing JavaScript code to be embedded within the XML call-flow framework, the designers of VoiceXML provided the mechanism to implement higher-order application functions such as data validation and manipulation, calculations, and business rules. JavaScript plays exactly the same role when embedded within a VoiceXML source file as JavaScript embedded within a Web page or HTML source file.

The use of the XML-framework for defining the overall flow of the application, combined with the power of the embedded JavaScript allows the creation of powerful voice applications quickly and easily. Tellme Consumer applications make extensive use of JavaScript to perform tasks such as randomizing user prompts or validating input data. The Tellme Blackjack game, for example, is implemented entirely using VoiceXML and JavaScript in a single file. It has no server-side component.

Q: Is the use of JavaScript a Tellme-specific extension?
A: No. The ability to embed JavaScript code into a VoiceXML page is a part of the VoiceXML 1.0 specification created by the VoiceXML Forum.

Q: What JavaScript runtime engine does the Tellme Platform use?
A: The Tellme Platform uses the JavaScript engine from the Mozilla (Netscape) codebase.

Q: What version of JavaScript does Tellme support?
A: Version 1.5 RC 6 of the Mozilla Foundation's JavaScript engine code-named SpiderMonkey.

Q: How do JavaScript objects like the "document" and "window" map to voice applications?
A: The object model exposed by Web browsers such as Netscape Navigator and Microsoft Internet Explorer is applicable to Web browsers only. JavaScript is a general purpose programming language that provides a facility to allow its host to extend the language by adding objects, properties, and methods. The Tellme VoiceXML interpreter hosts the JavaScript engine and extends the language with a limited set of global functions to write text to the Debug Log and to set and retrieve cookies.

[24]7 Inc.| Terms of Service| Privacy Policy| General Disclaimers