CallXML 3.0 Development GuideHome  |  Frameset Home

  Learning CallXML 3.0  |  TOC  |  Container Inheritance  

Tutorial: Hello World Phone application

This simple Lesson will step you through the creation and deployment of a "hello world" application. When we're done, you'll have a basic understanding of creating phone applications using web technologies; and you can call the resulting Hello world application.

In this Lesson, we will:


Step 1: record an audio file

Use your favorite sound recording utility to record a file that says "hello world". You can use the windows sound recorder to do this.

After you have recorded the file, save it in uLaw wave format and give it the name "helloworld.wav". If you're using the Windows Sound recorder, Select "File" "Save as"..., press the "Change..." button, and change the attributes to "8,000 Hz, 8 Bit, Mono", as shown below:





Alternatively, you can also use the Voxeo Audio recorder. Simply log into your account, open the Voxeo File Manager, and follow the instructions on the bottom right to record an audio file into your www/audio directory:



Or, if you'd rather not record your own file, you can download our sample "hello world" audio file, which is already in the correct format.

Step 2: write the main CallXML file


Open up your favorite text editor to write a few lines of CallXML. First, you'll need to put in the file a standard XML header. Every XML document you write, including CallXML documents, will need a header like this:

<?xml version="1.0" encoding="UTF-8" ?>


Next, you should add the main <callxml> element; always be certain that you have set the version attribute to "3.0". This element will contain all the other callxml elements we'll put into this file.

<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="3.0">


Now we will add a callxml element which will play an audio file. The <prompt> element can have several different attributes, but for now we'll just use using the "value" attribute which indicates where the audio file is located. Note that when we use the <prompt> element to output an audio file, we don't have to declare the '.wav' file extension. Also note that if we don't have an existing file called 'helloworld.wav', then the CallXML 3.0 platform will output the contents of the 'value' tag via text-to-speech. Pretty cool, huh?


<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="2.0">
  <prompt value="helloworld"/>


Last, we need to add a closing </callxml> element. This is one of the big differences between XML and HTML. In XML, all elements must be closed. Remember: If you don't close all your elements, your CallXML scripts won't work. The final file should look like this:

<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="3.0">
  <prompt value="helloworld"/>
</callxml>


Your callxml file is now done. Go ahead and save it as "helloworld.xml", in the same directory as the audio file you previously recorded.

Step 3: upload your CallXML & audio files to the web

Next you need to post or upload your callxml and audio files to a web server. If you don't have access to a web server, you can use the Voxeo File Manager to store your files on our servers.

Make sure you put both the callxml and audio files in the same directory on your web site or server. In this example, we might put the files into http://www.myserver.com/helloworld, so that our callxml file would be at http://www.myserver.com/helloworld.xml, and our audio file would be at http://www.myserver.com/helloworld.wav.




Step 4: sign up for a voxeo account

If you have already signed up for a voxeo account, you can skip forward to the next step. Signing up for a voxeo account is absolutely free. The link below will pop-up a new window where you provide basic contact information to sign up for an account. When you're done signing up for an account, just close the pop-up window and return here to move on to step 5.

click here to sign up for a voxeo account

Step 5: link a phone number to your callXML URL

Not sure how to map an application to a phone number? Check out the Quick Start Mapping Guide for info!


Step 6: call your application


You are now ready to try out your application. Call the number you received in step 5. You should hear your "hello world" audio file.

Welcome to the world of phone application development. Use your knowledge for the power of Good!

  CallXML 3.0 source code.




  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login
  Learning CallXML 3.0  |  TOC  |  Container Inheritance  

© 2008 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site