Creating your first VoiceXML application – Part1
Hello, in this post we will get acquainted with VoiceXML and CCXML – the most commonly used standards for building voice applications.
Introduction
VoiceXML (VXML) is the W3C’s standard XML format for specifying interactive voice dialogues between a human and a computer. It allows voice applications to be developed and deployed in an analogous way to HTML for visual applications. Just as HTML documents are interpreted by a visual web browser, VoiceXML documents are interpreted by a voice browser. A common architecture is to deploy banks of voice browsers attached to the Public Switched Telephone Network (PSTN) to allow users to interact with voice applications over the telephone.
CCXML (Call Control XML) – is the W3C standard markup language for controlling how phone calls are placed, answered, transferred, conferenced, and more. CCXML works hand-in-hand with VoiceXML to provide a 100% standards and XML based solution for any telephony application.
In this post I will use Voxeo.com (IVR and VoIP provider) developer tools to run our examples. Please register your own free account here to get started.
VoiceXML has tags that instruct the voice browser to provide speech synthesis, automatic speech recognition, dialog management, and audio playback. The following is an example of a VoiceXML document:
<form>
<block>
<prompt>Hello world!</prompt>
</block>
</form>
</vxml>
When interpreted by a VoiceXML interpreter this will output “Hello world” with synthesized speech. Some applications may use static VoiceXML pages, while others rely on dynamic VoiceXML page generation. In this example we will create very basic voice recognition application that takes in user city from predefined list and provide current weather condition for it.
Create static VXML application
So let’s start with static VXML file first. Create the following file and save it as “weather.vxml”:
<vxml version="2.1">
<form id="choiceMenu">
<field name="city">
<prompt>Please, specify your city</prompt>
<!-- Insert an inline grammar -->
<grammar type="text/gsl">
[london paris milan]
</grammar>
<!-- Reprompt user if he doesn't provide an answer -->
<noinput>
Sorry, what did you say?
<reprompt />
</noinput>
<!-- Handle the case when no match is found -->
<nomatch>
Sorry, but such city is not in my list. Please, try again.
<reprompt />
</nomatch>
</field>
<!-- Set our options. -->
<filled namelist="city">
<if cond="city == 'london'">
<prompt>Currently in London +5</prompt>
<elseif cond="city == 'paris'" />
<prompt>Currently in Paris +10</prompt>
<elseif cond="city == 'milan'" />
<prompt>Currently in Milan +15</prompt>
</if>
</filled>
</form>
</vxml>
Test it!
1. Upload your application
Login here into your Voxeo.com developer account

Click on “Files, Logs, & Reports” link

Upload your application into “www” directory

2. Assign a phone number
To test out a phone-based application, you obviously need a phone, and that implies a number to call. You will get a free Voxeo phone number by creating new application.
Under “Account” menu select “Application Manager”

Create new application with such parameters

3. Run it
Now you can test your application by calling the preferred number from “Contact Methods” tab. Calls from Skype to Skype VoIP number are free
You should hear a voice prompt “Please, specify your city”. Say “London” for instance and get an answer “Currently in London +5″.
Got it? Great.
That’s all for today. In next part we will generate our VXML file dynamically to get actual information about the weather. Stay tuned.
TweetTagged as voicexml, voxeo

Pingback: Creating your first VoiceXML application – Part2 | Oleg Puzanov