Click here to Skip to main content
15,918,516 members
Articles / Web Development / HTML

CCXML/VXML : The smart world of IVR

Rate me:
Please Sign up or sign in to vote.
5.00/5 (8 votes)
22 Jun 2014CPOL7 min read 30.6K   546   13   4
Welcome to the wonderful word of CCXML/VXML


Interactive Voice Response (IVR) is always a fascination to most of us. Receiving a positive welcome human voice asking to press 1 for do this and press 2 to do that always makes us curious that how it is be bein made possible. Fortunately being part of large scale bank phone banking is a mandatory channel for our customers. This leads me to the wonderful world of IVR. This article simply provides a glimpse of what can be achievable through this medium.


The background for this article is a set of simple requirements we received from our IT division. We have to call some 20 K customers and play a recorded message. That’s it. Initial solution was to use contact center, engaged two, three agents who have a customer list and they simply call one by one stating the message. But then we floated the idea to use IVR for the same purpose. The idea gets accepted, materialized and executed successfully.

Since on the internet we don’t have much sample applications at one place that briefly explain this idea that’s what triggered me to write an article on this topic.


Avaya voice portal is the core technology behind this Telephony magic.  As per vendor own statement “Avaya Voice Portal is a Web Services based self-service platform that brings together the power of Web Services and IP Telephony to create more powerful, profitable, and satisfying speech and touch-tone solutions.” We are not going to discuss Avaya Core Technology here as it will make this article more complex but what we do explain is how we have configured our application in AVP to achieve the desired results.

CCXML/VXML is the mantra for telephony developers. Just like a programming language like C# we use to build numerous types of applications CCXML/VXML is the telephony language we use to build telephony applications.  

CCXML is the abbreviation of “Call Control extensible Markup Language”. CCXML is a high-level industry standard for Call Control that can run over any telephony platform. It is an XML based language that control call initiations, setup, call monitoring and events that can control the behavior of a call. CCXML allows the technology industry to use the strength of Web and technologies to smartly control calls on and off the telephone network.  Whereas VXML is the abbreviation of "Voice eXtensible Markup Language". VoiceXML is designed for creating audio dialogs that feature speech, audio, speech recognition, DTMF key input, and call recording.  Its primary objective is to bring the advantages of Web-based development and content delivery to interactive voice response applications.  

In simple words if we like to initiate a call to the customer we will use CCXML and if we like to have a dialog between customers like playing a message then we will use VXML. If you are more interested to dig deeper in CCXML/VXML look at following URLs.

Sample Call Application

In order to give you a true taste of what actually is an IVR application, Sample Call application is being built for you.

It’s just like any ordinary web application. The reason for being it a web application is because AVP forces us to configure applications as http based web applications. Sample application has two interfaces. The front end provides an interface to the user to enter mobile number of a person we will try to call. The second interface is for Avaya, which starts executing our page (which is configured at AVP). The execution flow is as follows:

Configuration at AVP Interface

Application configuration at Avaya end is very easy. Please see below image to know how to add an application url

Following guidelines should be followed regarding Avaya Configurations:

  • Type must be set to CCXML as the sample application generates CCXML to control the call Flow
  • URL option should be set o Single
  • CCXML URL: This is your application url that generate CCXML
  • For sample application we do not require any kind of authentication
  • No speech Servers are required
  • Since application is going to initiate call to the customers therefore outbound option is selected.

For detail understanding of these options please use vendor documentation

Sample Application Structure

Sample application is divided into two interfaces. One is the front end where user will provide mobile numbers and the second interface is for Avaya which call back our application to process the call initiation request

As you can see above the solution explorer shows the complete project files used in the sample application. It has following parts

AvayaService: Avaya provides a web service to invoke its call interface. You should call your vendor and ask about this same web service. This web service is critical as it tells AVP to call back our configured url.

The normal web service call is look like this http://<IP>/axis/services/AppIntfWS

AVPWebServiceClient: AVPWebSericeClient is wrapper class that wraps AayaService calling mechanism, it holds credential details required to invoke avaya service and also provide additional parameters to Avaya like Mobile Number and session details.

CcxmlHttpRequest: CcxmlHttpRequest reads configuration from web.config and launches AVPWebServiceClient.

SampleCall.aspx: SampleCall.aspx is the front end interface on which user will provide the mobile numbers to which call will be initiated.

IVR: IVR holds audio files welcome.wav which Avaya will play to the cell phone owner when calls get connected to mobile phone. It also contains CallControl.aspx (This file along with path is configured in AVP portal as elaborated in the above diagram) which is the most critical file. CallControl.aspx is responsible for emitting CCXML which AVP executes and do as directed in the CallControl.aspx

Web.Config: Web.config contains credential details and IP for accessing Avaya Web Service.


This is the name of the application we created in Avaya Voice Portal interface


User Id requires for invoking Avaya Web Service


Password requires for invoking Avaya Web Service


Domain for invoking Avaya Web Service


UTL for Avaya Web Service

Inside CallControl.aspx 

Callcontrol.aspx is unique in the sense that when executed by ASPX engine it will not return HTML rather it return CCXML. The structure of CCXML is simple because of the fact that it’s just like any ordinary XML as the name CCXML suggest. CCXML starts with CCXML header because it is an entry point for the AVP CCXML parsing engine.

<ccxml version="1.0" xmlns=””/>

CallControl.aspx declares and initializes a number of variables used for the processing. Being event driven nature of CCXML we have used events to initiate call to the mobile user. This is done using createCall ccxml command.

Once call is connected AVP initiate dialog with the phone. The dialog plays welcome.wav which simply says hello. This is done use dialogstart ccxml command. Dialogstart requires VXML to process dialog instructions hence we have provided welcome.aspx as a parameter to DialogStart command. Wellcome.aspx returns VXML just like callcontrol.aspx which returned CCXML.

After Playing of welcome.wav AVP fires dialog.exit event. Using this event we close the call using disconnect command and session finally ends gracefully.

Basic Understanding of CCXML/VXML

Just like any other programming language CCXML also support a number of features. Please see below for a brief description. For a detail overview of CCXML/VXML please see vendor documentation





<var name="state" expr="'init'" />


Uses for variable declaration and initialization


<assign name="TelNo" expr="03001111111" />

User for assigning values to variables


<log expr="'-- In init ccxml loaded event'"/>

CCXML support rich logging support. <log> tag
is used for variety of logging purpose.


<eventprocessor statevariable="state"/>

EventProcess command tells AVP to initialize Event Processor and make it ready for further processing. Every CCXML must have one event process tag


<transition state="init" event="ccxml.loaded"></transition>

AVP fires event and delegate to the application. It is upto the application to decide which events to capture and program accordingly


<if cond="TelNo != '#'"></if>

Just like any other programming languages CCXML provide conditional statements as well. Using conditional tags developers can control the application flow depending upon their application logic


<send target="" targettype="'ccxml'" name="'user.SmsCall'"/>

AVP also facilitate to fire custom user event using send command


<createcall dest="'tel:+' + PreDialedNumber + TelNo" connectionid="Connection_ID" timeout="60000" hints="hints"/>

Call to the mobile is being made using createcall command. AVP fires a series of system events like connection.ringing, connection.connected events to propagate status of connection to the application and let application decide to control the logic.


<dialogstart connectionid="Connection_ID" dialogid="holddialogid" src="'Welcome.aspx'" type="'application/voicexml+xml'"/>

Application usually initiate requires playing sound, DTMF for controlling the application flow. AVP naturally supports dialog based communication. Dialogstart command is used to initiate dialog


<disconnect connectionid="Connection_ID" />

Disconnect command advise AVP to disconnection current call session with the mobile user gracefully


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Product Manager Avanza Solutions
Pakistan Pakistan
Asif embarked on his programming journey back in 1991 when he first encountered 80286 8-16 MHz systems. His programming repertoire began with dBase III+, FoxPro, C, and assembly language, where he honed exceptional skills that have been a cornerstone of his development career.

Over the years, Asif's programming saga has seen him delve into a wide array of technologies and languages, ranging from C++, VC++, Java, Delphi, RPG400, SQL Server, and Oracle, to name just a few. His insatiable curiosity continues to lead him towards newer horizons, such as DOT Net Technologies, SOA architectures, BI, DSL, and beyond. These learning experiences are underscored by a robust theoretical foundation, with a penchant for research.

Beyond the realm of technology, Asif's interests include delving into the pages of fiction, exploring biotechnology, and gazing at the wonders of Astronomy. He finds joy in watching movies, and during his free time, he delights in quality moments spent with his children.

Comments and Discussions

Questiondoubt about ccxml Pin
Fercho083-Sep-19 11:47
Fercho083-Sep-19 11:47 
QuestionHow to wait until User press answer button to start dialog Pin
Hoannd8-Sep-15 17:28
Hoannd8-Sep-15 17:28 
QuestionHow to get the caller number and store as soon as the phone rings Pin
shahid0070424-Dec-14 1:16
shahid0070424-Dec-14 1:16 
QuestionCCXML/VXML: The smart world of IVR Question: How to get AVAYA Pin
Tin LeUSA2-Dec-14 3:42
Tin LeUSA2-Dec-14 3:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.