Lesson 1: Getting Started

This lesson will guide you through the creation of a "hello world" VoiceXML application, but just to be different we're going to call it "Welcome to Genie University!".  You're going to understand the fundamental structure of a VoiceXML application, and we'll get you running your first VoiceXML program.

Step 1. Start with the first and last lines, which are common to every VoiceXML application

Open your favorite text editor.

First we need to acknowledge our roots. VoiceXML is a variant of "XML":


<?xml version="1.0"?>

Now we will specify what version of VoiceXML we're running:


<?xml version="1.0"?> <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml"> . . . (soon we're going to put our code in here) </vxml>

Every VoiceXML document will start and end as above. Notice the final </vxml> with a slash before the vxml. The slash means "end" as in "end vxml". The majority of VoiceXML tags are written that way, with a beginning and an end - much like braces ( "{ }" ) in the C programming language. This is quite a bit different from html, where the closing tag was allowed but not usually required.

Step 2. Now let's write our first VoiceXML application


<?xml version="1.0"?> <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml"> <form> <block> Welcome to Genie University! </block> </form> </vxml>

What could be easier?

The <form> tag is what groups sections of input and output together. It is also known as a "dialog". (In this document, there is only one form, but a document could of course contain any number of forms.)

Why don't you save your document as "welcome.vxml"? You can call it whatever you want, but it must have a ".vxml" extension.

Just to be clear with regard to terminology:

Each form (dialog) can contain one or more field items.

Application -> Document (Page) -> Form (Dialog) -> Field item

(For more detail on which tags can be grouped under or over a given tag, check the Parents and Children listed in its entry in the VoiceXML 2.0 tag reference.)

Step 3: Upload your VoiceXML application to a web site

Your application needs to be readable (by the VoiceGenie VoiceXML Browser) on a web site. There are many web sites that offer their services free of charge.

Let's imagine that your file ends up at


http://www.freewebsite.com/yourname/welcome.vxml

You will need to know this information when you set up your VoiceGenie extension (Step 5).

(Many free web hosts don't allow the posting of .vxml files, or add advertising information that causes errors when the pages are loaded.

Step 4: Log in to the Developer Workshop

If you're following this tutorial, then you're already logged in.

Step 5: Create an extension that points to your application

Step 6: Test your application

You are now ready to test your application: