Creating a VoiceXML page in the Java WEB Development framework

Source: Internet
Author: User
Tags java web

Over the past five years, the WEB has grown more rapidly than ever before. Once primarily text-based software program media "Web browsers" have now developed into a source of information that can be used by any connected device. The first list of devices that can be accessed on a Web page is a mobile phone, followed by a pager, handheld device, personal Electronics assistant, and any other device that can be connected to the web via a wireless connection. In recent years, the phone has joined the camp, and the calls to use WEB programs on regular phone lines are growing.

The more appropriate name for this newest type of application (user access to the online service via telephone) is the Telephony application (telephone application). Obviously, because the phone cannot be used to "click a link," The application interaction is almost entirely through speech processing. Instead of clicking the link, the user says "account information" or uses the keyboard to follow a pre-recorded instruction.

The ability to service telephones with existing (or slightly modified) Web applications is a powerful idea and one of the areas that many Web developers are eager to explore. The most important thing to know about WEB applications and telephony applications is that you can actually use the same combination of technologies to create both applications. HTML, XHTML, and XML are the three underlying technologies that are most commonly used under the Web interface, and VoiceXML (or VXML) is a closely related technique that enables telephony clients to take advantage of web interaction. JavaServer Pages and servlet, PHP scripts, and Ruby applications can respond to phone requests as easily as they would in a handheld device or Web browser. In this article, we focus on using the Java platform to service simple VoiceXML applications, but you can apply the methods described in this article to PHP, Perl, or any programming language you choose.

VoiceXML, ccxml or Callxml?

The most common standard for building voice applications is VoiceXML. Most VXML browsers support VoiceXML 2.0, and this version of VXML is used throughout this article. VXML conforms to the standard of the consortium and develops rapidly, and the current version is still v2.1. VXML 3.0 is about to launch.

Ccxml is the abbreviation for call Control XML and is the newest member of the phone tag that conforms to the requirements of the consortium. Ccxml is more advanced than most VoiceXML, providing support for callback, event listeners, and multiple-path and multiparty sessions. But unless you specifically need these attributes, the best option might be to continue using voicexml,voicexml more stably and with more extensive applications.

Callxml is a platform that is specific to Voxeo. Callxml is easy to learn and provides support for key phone (touchtone) input (note that it does not support speech recognition). The biggest flaw in Callxml is the vendor-specific. Voxeo is a very good site with countless resources, but being locked down by one vendor is definitely a bad idea. At this point, most developers will discover again that VoiceXML is more suited to their needs.

VoiceXML 101

Before you touch the Java aspects of the VoiceXML world, you should have a general understanding of how the VoiceXML application works. After that, I'll introduce you to a very simple VoiceXML application. The sample application will enable you to view the VXML file while ensuring that you have access to (and use) the Voxeo call-assignment service, which is critical to the content later in this article.

A simple VXML page

VoiceXML should at least start with a VXML file, using VoiceXML-style XML versions to tell telephony applications what they should and can do. Listing 1 shows a very simple VXML file. Save this file to your local computer (download the complete sample source code in the download section, but in any case, you should develop your own habit of handling this type of file).

Listing 1. A very simple VXML file.

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.1">
  <form>
   <block>
    <prompt>
     Things are working correctly! Congratulations.
    </prompt>
   </block>
  </form>
</vxml>

For VoiceXML, this is very basic, and if you don't know enough about grammar, check out the other VoiceXML articles listed in resources. The VXML file in Listing 1 contains only one hint and does not provide any interactivity, and you will see more advanced usage in the section dealing with Java code. But for now, use this simple test case to make sure your environment is working properly.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.