Professional Documents
Culture Documents
SJ; Reviewed:
SPOC 3/11/2008
1 of 32
CCXML_App
Contents
About this Tutorial ............................................................................................................................ 4
Intended Audience .............................................................................................................. 4
Prerequisites ....................................................................................................................... 4
Chapter 1:
Introduction................................................................................................................. 5
Chapter 2:
Chapter 3:
Chapter 4:
4.1
4.2
4.3
4.4
4.5
4.6
4.1.2
Attributes .......................................................................................... 13
4.1.3
Example............................................................................................ 13
Attributes .......................................................................................... 14
4.2.2
Example............................................................................................ 14
<accept>................................................................................................................. 14
4.3.1
Attributes .......................................................................................... 14
4.3.2
Example............................................................................................ 15
<redirect> ............................................................................................................... 15
4.4.1
Attributes .......................................................................................... 15
4.4.2
Example............................................................................................ 16
<reject> .................................................................................................................. 16
4.5.1
Attributes .......................................................................................... 16
4.5.2
Example............................................................................................ 16
<createcall>............................................................................................................ 17
4.6.1
SJ; Reviewed:
SPOC 3/11/2008
Attributes .......................................................................................... 17
2 of 32
CCXML_App
4.6.2
4.7
4.8
4.9
4.10
Example............................................................................................ 18
<disconnect> .......................................................................................................... 18
4.7.1
Attributes .......................................................................................... 19
4.7.2
Example............................................................................................ 19
<dialogstart>........................................................................................................... 19
4.8.1
Attributes .......................................................................................... 19
4.8.2
Example............................................................................................ 21
<send> ................................................................................................................... 21
4.9.1
Attributes .......................................................................................... 22
4.9.2
Example............................................................................................ 23
<fetch> ................................................................................................................... 23
4.10.1 Attributes .......................................................................................... 23
4.10.2 Example............................................................................................ 25
Chapter 5:
Chapter 6:
References 31
SJ; Reviewed:
SPOC 3/11/2008
3 of 32
CCXML_App
Chapter 1: Introduction: This chapter provides the overview of CCXML and the significance of
CCXML plug-in software component for developing a CCXML application using Dialog Designer.
Chapter 2: Installing CCXML Plug-in: This chapter describes the procedure for installing CCXML
plug-in in Dialog Designer.
Chapter 3: Developing a CCXML Project: This chapter describes the steps to create a CCXML
application using the Dialog Designer CCXML plug-in.
Chapter 4: CCXML Functionality Supported by Avaya Dialog Designer: This chapter describes the
frequently used CCXML elements that are supported by Dialog Designer.
Chapter 5: A Sample CCXML Application - OutboundCall: This chapter describes a sample CCXML
application that places an outbound call and logs the call status information.
Chapter 6: Code Blocks in the OutboundCall CCXML Application: This chapter describes the basic
code blocks needed to develop a CCXML application.
After completing this tutorial, the developer will be able to develop CCXML applications using the Avaya
Dialog Designer CCXML plug-in.
Intended Audience
This tutorial is intended for developers who want to develop CCXML applications using Avaya Dialog
Designer. For more information about the Avaya Dialog Designer, refer to [2] and [3].
Prerequisites
A basic understanding of CCXML functionality and familiarity with Java language, JSP tags, Eclipse IDE
and telephony application call flow is needed.
SJ; Reviewed:
SPOC 3/11/2008
4 of 32
CCXML_App
Chapter 1: Introduction
The Call Control eXtensible Markup Language (CCXML) is an XML-based mark-up language that is
designed to provide call control for telephony systems, thereby enabling developers to write documents
that perform advanced call handling. CCXML is designed to provide telephony call control support for
dialog systems, such as VoiceXML. While VXML can be used with any dialog systems capable of
handling media, CCXML has been designed to complement and integrate with a VoiceXML interpreter. It
should be noted that the two languages - CCXML and VoiceXML - are separate and are not required in
an implementation of either language. For example, CCXML could be integrated with a more traditional
Interactive Voice Response (IVR) system, and VoiceXML or other dialog systems could be integrated with
other call control systems.
Note: The CCXML specification is provided by World Wide Web Consortium (W3C). For more information
about CCXML specification, refer to [4].
The Dialog Designer 4.1.7 installer comes bundled with CCXML plug-in 4.1.7. The CCXML plug-in is a
software component that is used to develop CCXML applications that can be integrated with any standard
VXML/CCXML platform like the Avaya Voice Portal 4.1.
The following chapters describe various CCXML elements and attributes that can be used in the
development of a CCXML application using CCXML plug-in 4.1.7 which is supported by Avaya Voice
Portal 4.1 and later.
SJ; Reviewed:
SPOC 3/11/2008
5 of 32
CCXML_App
4. Select Search for new features to install option and click Next.
SJ; Reviewed:
SPOC 3/11/2008
6 of 32
CCXML_App
SJ; Reviewed:
SPOC 3/11/2008
7 of 32
CCXML_App
8. The DDCCXML_4.1.7_200712031700.jar file entry gets added to the Sites to include in search:
section. Select DDCCXML_4.1.7_200712031700.jar check box and click Finish to install the
CCXML plug-in.
Note: For additional installation details, refer to the Dialog Designer installation note that comes bundled
with the Dialog Designer installer.
The next chapter describes the steps for creating a CCXML application using the Dialog Designer
CCXML plug-in.
SJ; Reviewed:
SPOC 3/11/2008
8 of 32
CCXML_App
SJ; Reviewed:
SPOC 3/11/2008
9 of 32
CCXML_App
3. Enter the values for project specific parameters: Vendor and Category. Click Next.
SJ; Reviewed:
SPOC 3/11/2008
10 of 32
CCXML_App
5. On successful creation of the project, the start.ccxml file is created in the ccxml folder of the
project. If no template is selected during project generation, then the start.ccxml file is created
with no CCXML elements and the developer has to manually add the required CCXML elements. If a
template is selected (for example, Accept call template), then the start.ccxml file contains few
CCXML elements already present in the start.ccxml file as shown below.
The next chapter describes various CCXML elements and attributes that are supported by the Dialog
Designer, which the developer can add to the CCXML project (i.e., add manually to the start.ccxml
file) as per the requirement.
Chapter 5: A Sample CCXML Application - OutboundCall describes a sample CCXML application named
OutboundCall.
SJ; Reviewed:
SPOC 3/11/2008
11 of 32
CCXML_App
CCXML Element
Functionality
<var>
Declares a variable
<assign>
<script>
<accept>
<redirect>
<reject>
<createcall>
<disconnect>
<dialogstart>
<send>
Call an event
<fetch>
The detailed description about each of the above mentioned elements is given below.
SJ; Reviewed:
SPOC 3/11/2008
12 of 32
CCXML_App
4.1.2 Attributes
<var>
Name
Required
Description
name
TRUE
Indicates the name of the variable. It should be a valid ECMA script variable
name.
expr
FALSE
Indicates the new value of the variable. This is the initial value. It can be any
valid ECMAScript expression.
Name
Required
Description
name
TRUE
expr
TRUE
Indicates the new value of the variable. It can be any valid ECMAScript
expression.
<assign>
4.1.3 Example
This example shows how to declare a variable state and assign a value to it using ECMA script.
<var name="state" />
<assign name="state" expr="initial"/>
SJ; Reviewed:
SPOC 3/11/2008
13 of 32
CCXML_App
4.2.1 Attributes
Name
Required
Description
src
FALSE
4.2.2 Example
This <script> element shown in this example defines a function that computes the greatest common
factor of two integers.
<script>
function gcd(a, b)
{
var t;
if (a < 1 || b < 1)
return -1;
do
{
t =
a =
b =
} while (b
a % b;
b;
t;
> 1);
return (b == 0) ? a : b;
}
</script>
4.3 <accept>
The execution of the <accept> element causes the underlying platform to signal the telephony system to
connect the specified connection to the CCXML platform.
4.3.1 Attributes
Name
Required
Description
Connectionid
FALSE
SJ; Reviewed:
SPOC 3/11/2008
14 of 32
CCXML_App
Hints
FALSE
4.3.2 Example
This example shows the operation of accepting an incoming call. The connection id of the incoming call is
retrieved from the event object.
<!-- Accept an incoming call -->
<var name="in_connectionid" />
<transition event="connection.alerting" state="incomingcall">
<assign name="in_connectionid" expr="event$.connectionid" />
<accept connectionid="in_connectionid" />
</transition>
4.4 <redirect>
When a CCXML document executes a <redirect> element within the <transition> block, it causes
the underlying platform to signal the telephony system to send the call to a specified destination. The use
of <redirect> is only valid when a call is in the ALERTING and CONNECTED states.
Note: The <redirect> element is supported only for SIP phones in Avaya Voice Portal 4.1 or later.
4.4.1 Attributes
Name
Required
Description
Connectionid
FALSE
Dest
TRUE
Reason
FALSE
Hints
FALSE
SJ; Reviewed:
SPOC 3/11/2008
15 of 32
CCXML_App
4.4.2 Example
This example shows the redirection of an incoming call to extension 4700.
<!-- Redirect any incoming call -->
<var name="in_connectionid"/>
<transition event="connection.alerting" state="incomingcall">
<assign name="in_connectionid" expr="event$.connectionid"/>
<redirect connectionid="in_connectionid" dest="'4700'"/>
</transition>
4.5 <reject>
The execution of the <reject> element causes the underlying platform to signal the telephony system to
reject the incoming connection from the platform.
Note: The <reject> element is supported only for SIP phones in Avaya Voice Portal 4.1 or later.
4.5.1 Attributes
Name
Required
Description
Connectionid
FALSE
Reason
FALSE
Hints
FALSE
4.5.2 Example
This example shows the rejection of an incoming call.
<!-- Reject any incoming call -->
<var name="in_connectionid" />
<transition event="connection.alerting" state="incomingcall">
<assign name="in_connectionid" expr="event$.connectionid" />
<reject connectionid="in_connectionid"/>
</transition>
SJ; Reviewed:
SPOC 3/11/2008
16 of 32
CCXML_App
4.6 <createcall>
A CCXML document is able to instruct the platform to attempt to place an outgoing call with
<createcall> element. This element instructs the platform to allocate a connection and attempts to
place an outgoing call to a specified address. The CCXML interpreter receives an asynchronous event
when the call attempt is completed. An <eventprocessor> <transition> block can handle this
event and perform further call control, such as conferencing. If the call is successfully placed, the
transition block can also initiate a dialog interaction with the called party.
The execution of <createcall> element results in the generation of one or more
connection.progressing events (depending on platform support for call progress) followed by a
connection.connected event on success, or zero or more connection.progressing events
followed by a connection.failed event on failure.
4.6.1 Attributes
Name
Required
Description
Dest
TRUE
Connectionid
FALSE
Aai
FALSE
An ECMAScript expression which returns a string of application-toapplication information to be passed to the destination endpoint when
establishing the connection.
Note: Even if an implementation platform accepts the aai data, certain
protocols and network elements may prevent the transmission to the
target endpoint. If the platform does not support the transmission of aai
data it must raise a connection.progressing event and indicate that the
use of aai is not supported.
Callerid
FALSE
Hints
FALSE
Timeout
SJ; Reviewed:
SPOC 3/11/2008
FALSE
17 of 32
CCXML_App
FALSE
joindirection
FALSE
4.6.2 Example
In this example, the <createcall> element is used to call the phone number 4700.
<var name="out_connectionid" />
<transition>
<createcall dest="'4700'" connectionid="out_connectionid"
timeout="10000" callerid="session.connections[event$.connectionid].remote" />
</transition>
4.7 <disconnect>
A CCXML document is able to instruct the platform to disconnect a connection by using <disconnect>.
The underlying platform sends the appropriate protocol messages to perform the disconnect, and send an
asynchronous event to the CCXML document when the disconnect operation completes. A CCXML
document may use <disconnect> to abandon an outbound connection created using <createcall>
which has not yet entered the CONNECTED state. If <disconnect> is used to abandon an outbound
call, it results in the generation of a connection.failed event.
SJ; Reviewed:
SPOC 3/11/2008
18 of 32
CCXML_App
4.7.1 Attributes
Name
Required
Description
connectionid
FALSE
Reason
FALSE
Hints
FALSE
4.7.2 Example
In this example, the call with connectionid=out_connectionid is disconnected.
<var name="out_connectionid" />
<!-- Assign out_connectionid to a valid connection -->
...
<transition>
<disconnect connectionid="out_connectionid"/>
</transition>
4.8 <dialogstart>
<dialogstart> is used to start a dialog (for example, VXML) and associate the dialog with a
connection or conference. The element includes either a URI reference to the initial document for the
dialog or the identity of a previously prepared dialog. The dialog executes on a separate logical execution
thread and does not block the processing of further events by the CCXML session.
4.8.1
Attributes
Name
Required
Description
Src
FALSE
prepareddialogid
FALSE
Type
FALSE
SJ; Reviewed:
SPOC 3/11/2008
19 of 32
CCXML_App
FALSE
parameters
FALSE
dialogid
FALSE
connectionid
FALSE
conferenceid
FALSE
SJ; Reviewed:
SPOC 3/11/2008
20 of 32
CCXML_App
FALSE
FALSE
Hints
4.8.2
Example
This example starts the VXML dialog fail.vxml which will be executed for the call having connectionid
= hostconn.
String locationLocal = "http://" + host + ":" + port + "/ClickToCall";
<dialogstart connectionid = "hostconn"
dialogid="holddialogid"
type="'application/voicexml+xml'"
src="'<%=locationLocal%>/vxml/fail.vxml'"
parameters="partname"
namelist="partname" />
4.9 <send>
<send> is used to send messages containing events or other information directly to another CCXML
Interpreter or other external systems using an Event I/O Processor.
SJ; Reviewed:
SPOC 3/11/2008
21 of 32
CCXML_App
The event target of <send> is specified using the target and targettype attributes. These attributes
control how the platform should dispatch the event to its final destination.
The target attribute specifies the unique identifier of the event target that the Event I/O Processor
should send the event to. This can be the value of a CCXML Session ID or a Dialog ID if an event needs
to be sent to one of these respective targets.
The targettype attribute controls what Event I/O Processor the event should be sent to. The default
value of this attribute is 'ccxml'.
4.9.1
Attributes
Name
Required
Description
Target
TRUE
targettype
FALSE
Sendid
FALSE
Delay
FALSE
Name
FALSE
SJ; Reviewed:
SPOC 3/11/2008
22 of 32
CCXML_App
namelist
FALSE
Hints
FALSE
4.9.2
Example
In this example, the start.dialog event is called using the <send> element.
<transition event="connection.connected">
<send targettype="'ccxml'" name="'start.dialog'" target="session.id" delay="'0s'"/>
</transition>
The next chapter describes a sample CCXML application named OutboundCall that uses the CCXML
elements <var>, <assign>, <accept> and <createcall>.
4.10 <fetch>
<fetch> is used to asynchronously fetch the content identified by its attributes. The fetched content may
either be a CCXML document, or script content. Content that has been acquired using <fetch> is
accessible through other elements defined by CCXML. Execution returns from the element immediately,
and the CCXML application can continue on while the platform works to fetch the identified resource.
When the fetch request has been completed, an event is generated against the session that initiated the
fetch. The event is one of fetch.done, which indicates that the identified content was fetched
successfully, or error.fetch, indicative of a failure to fetch the requested content. Even if content is
successfully fetched, errors in processing fetched content (for instance, a CCXML document with a syntax
error) may result in an error.fetch being thrown.
The fetch request is local to the session that initiated the <fetch>, and is referenced through a unique
identifier generated by the CCXML platform. The application may obtain the unique identifier for a fetch
request by providing an ECMA script left-hand-side expression in the fetchid attribute when the fetch is
performed. The fetch identifier can also be obtained as a property of the fetch.done event. The
application uses the fetch identifier in any CCXML elements (for example, <goto> and <script>) that
reference fetched content. Fetched content has a lifetime that is limited to that of the document in which it
is fetched.
4.10.1 Attributes
Name
Required
Description
next
TRUE
type
FALSE
SJ; Reviewed:
SPOC 3/11/2008
23 of 32
CCXML_App
document.
text/ecmascript
This specifies that the fetched content must be ECMA Script.
namelist
method
FALSE
FALSE
text/javascript
This specifies that the fetched content must be JAVA Script.
A list of zero or more whitespace separated CCXML variable names. These
variables must be submitted to the web server, with the same qualification
as used in the namelist. When an ECMA script variable is submitted to the
web server, its value must be first converted into a string before being
submitted.
If the variable is an ECMA script Object, the mechanism by which it must be
submitted is not currently defined. Instead of submitting ECMA script
Objects directly, the application developer may explicitly submit the
properties of an Object. e.g. "date.month date.year".
An ECMA script expression which returns a character string that indicates
the HTTP method to use. Values defined by the specification are:
get
This indicates that the "GET" method must be used to fetch the
URL.
post
fetchid
FALSE
timeout
FALSE
maxage
FALSE
maxstale
FALSE
enctype
FALSE
SJ; Reviewed:
SPOC 3/11/2008
24 of 32
CCXML_App
application/x-www-form-urlencoded
This indicates that the ccxml variables specified in the namelist
must be URL encoded.
4.10.2 Example
In this example, the <fetch> element fetches a ccxml document docToFetch.ccxml.
<transition state="initial" event="connection.connected">
<log expr="'*** CALL CONNECTED, STARTING FETCH ***'"/>
<fetch next="'http://192.100.100.1:8080/TestCCXMLelements/ccxml/docToFetch.ccxml'"
fetchid="myFetchID" type="'application/ccxml+xml'" />
</transition>
<transition event="fetch.done">
<goto fetchid="event$.fetchid"/>
</transition>
<transition event="error.fetch">
<log expr="'*** AN ERROR OCCURRED DURING THE FETCH ***'"/>
</transition>
SJ; Reviewed:
SPOC 3/11/2008
25 of 32
CCXML_App
OutboundCall
Application
(CCXML)
Caller
Called
Party
Caller calls
Connection accepted
Connection established
The above Sequence diagram shows a basic call flow scenario of OutboundCall application.
1.
2.
3.
4.
5.
The Caller calls the phone number registered for OutboundCall CCXML application.
The call is accepted by OutboundCall application.
The OutboundCall application calls a pre-defined phone number.
The Connection gets established when the called party picks up the call.
Join the caller and the called party.
The next chapter describes the basic code blocks needed to develop a CCXML application.
SJ; Reviewed:
SPOC 3/11/2008
26 of 32
CCXML_App
2. The ECMA script code can be added as shown below, and it converts the event data into a string
format to be printed in the logs. This is helpful for debugging purposes.
SJ; Reviewed:
SPOC 3/11/2008
27 of 32
CCXML_App
3. The variables are declared and initialized as shown below. The state variable is used to assign the
current state of the application.
4. The next block is the eventprocessor block which handles the call events. The
connection.alerting event is received when the caller calls the Avaya Voice Portal extension
registered for this application. When this event is received, the in_connectionid variable is assigned
the connection id of an incoming call.
5. The connection.connected event is received when the call gets connected. Here the call
classification is enabled using variable hints. An outbound call is created using the <createcall>
element as shown below.
SJ; Reviewed:
SPOC 3/11/2008
28 of 32
CCXML_App
6. When the call gets connected, a connection.connected event is received. The OutboundCall
application assigns connected to state variable and incoming and outgoing calls are joined using the
<join> element as shown below.
7. Since the call classification is enabled in this application, a connection.signal event is received.
The application checks the called party response. If the called party speaks after picking up the call,
the event$.info.callprogress gets assigned with the value live_voice.
8. If the call fails, a connection.failed event is received. If the call gets disconnected, a
connection.disconnected event is received as shown below. The application exits using the
<exit> element.
SJ; Reviewed:
SPOC 3/11/2008
29 of 32
CCXML_App
9. The OutboundCall application also captures some additional events that can help in debugging the
application. The ccxml.exit event is received when the application exits, normally by calling the
<exit> element. The ccxml.kill event is received when the platform forces the application to exit
due to an error or when it is not possible to recover normally from an error.
For deploying the OutboundCall CCXML application on the Avaya Voice Portal, refer to [5].
SJ; Reviewed:
SPOC 3/11/2008
30 of 32
CCXML_App
References
[1] Avaya Voice Portal 4.1 Documentation Library downloadable from the Avaya DevConnect web
site http://www.avaya.com/devconnect.
[2] Getting started with Dialog Designer. This information is available at:
- Dialog Designer 4.1 CD-ROM (which includes the Dialog Designer software).
- Dialog Designer 4.1 as a CD-ROM image downloadable from the Avaya DevConnect
web site http://www.avaya.com/devconnect.
[3] Avaya Dialog Designer Developers Guide
This comes bundled with the Dialog Designer software. To access this guide, in Eclipse, click
Help (menu) > Help Contents > Dialog Designer documentation.
[4] Call Control XML (CCXML) specification published by World Wide Web Consortium (W3C) at
http://www.w3.org/TR/ccxml/.
[5] Tutorial for deploying Speech and Call Control applications on Avaya Voice Portal and
Avaya Interactive Response - available at the Avaya DevConnect web site
http://www.avaya.com/devconnect.
SJ; Reviewed:
SPOC 3/11/2008
31 of 32
CCXML_App
SJ; Reviewed:
SPOC 3/11/2008
32 of 32
CCXML_App