January 17, 2021
Hot Topics:

Introduction to CCXML, Part III

  • By Jonathan Eisenzopf
  • Send Email »
  • More Articles »

Placing outbound calls

With the <createcall> CCXML element, we can easily place outbound calls that initiate VoiceXML dialogs. Instead of setting up an inbound handler for connection.CONNECTION_ALERTING, we want to set up a handler for the ccxml.loaded event, which is triggered as soon as the CCXML has started up and is ready to process the program (lines 6-8). 

On line 7, we place the outbound call with <createcall>. The dest attribute specifies the phone number to dial.

If the call goes through and is connected, a connection.CONNECTION_CONNECTION event will be triggered. If the call could not be connected for whatever reason, the connection.CONNECTION_FAILED event will be triggered.

1  <?xml version="1.0" encoding="UTF-8"?>
2  <ccxml version="1.0">
4    <eventhandler>
6      <transition event="ccxml.loaded">           
7        <createcall dest="'7035551212'"/>
8      </transition>
10      <transition 
11        <dialogstart src="'example2.vxml'"/>
12      </transition>
14      <transition 
15        <log expr="'Failed making outbound call'"/>
16        <exit/>
17      </transition>
19      <transition event="dialog.exit">
20        <log expr="'Thats all for now folks.'"/>
21        <exit/>
22      </transition>
24      <transition event="call.CALL_INVALID" name="evt">
25        <exit/>
26      </transition>
28      <transition event="error.*" name="evt">
29 <log expr="'an error has occurred 
(' + evt.error + ')'"/>
30        <exit/>
31      </transition>
33    </eventhandler>    
34  </ccxml>

On lines 10-12, we handle the connection.CONNECTION_CONNECTED event by starting the example2.vxml dialog. The connection.CONNECTION_FAILED event is handled on lines 14-17 by logging the error and then calling <exit>.

I've also added a third event handler that catches and logs any and all errors on lines 28-31.


So, now we've had a bit of experience handling inbound calls with CCXML as well as placing outbound calls. In the next article, we will learn how to use CCXML to conference calls.

About Jonathan Eisenzopf

Jonathan is a member of the Ferrum Group, LLC  which specializes in Voice Web consulting and training. Feel free to send an email to eisen@ferrumgroup.com regarding questions or comments about this or any article.

Page 2 of 2

This article was originally published on November 7, 2002

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date