Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

CCXML/VXML : The smart world of IVR

0.00/5 (No votes)
22 Jun 2014 1  
Welcome to the wonderful word of CCXML/VXML

Introduction

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.

Background  

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.

Technology  

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.

http://en.wikipedia.org/wiki/Call_Control_eXtensible_Markup_Language http://en.wikipedia.org/wiki/VoiceXML

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.

AvayaToken

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

UserID

User Id requires for invoking Avaya Web Service

Password

Password requires for invoking Avaya Web Service

domain

Domain for invoking Avaya Web Service

AvayaService.AppIntfWS

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=”http://www.w3.org/2002/09/ccxml”/>

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

Command

Usage

Description

Var

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

 

Uses for variable declaration and initialization

Assign

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

User for assigning values to variables

Log

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

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

eventprocessor

<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

<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

<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

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

AVP also facilitate to fire custom user event using send command

Createcall

<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

<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

<disconnect connectionid="Connection_ID" />

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

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here