Sample CCXML document

start.ccxml

This simple CCXML document example shows how an incoming call can be routed to a VoiceXML application.

<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0">
 <!-- Global variable to store the number of calls to 1001 -->
    <var name="count" expr="0"/>

   <eventprocessor>
	 <!-- Accepts an incoming call -->
      <transition event="connection.alerting" name="evt">
          <accept connectionid="evt.connectionid"/>
      </transition>
	
 	<!-- Starts VXML dialog on a separate thread -->
	<!-- Counts the number of times 1001 was dialed -->
	 <!-- Logs the dialed number -->
      <transition event="connection.connected" name="evt">
          <dialogstart src="'/var/dirTalk/DTBE/samples2/Sample2.vxml'" type="'application/xml+vxml'"/>
          <if cond="evt.connection.local=='1001'">
              <assign name="count" expr="count+1"/>
              <log expr="'Call number ' + count + ' to 1001'"/>
              <else/>
              <log expr="'Dialled number ' + evt.connection.local"/>
          </if>
      </transition>
	
      <transition event="dialog.started"/>
	
	<!-- Disconnects the call when dialog finishes -->	
      <transition event="dialog.exit" name="evt">
            <disconnect connectionid="evt.connectionid"/>
      </transition>
	
      <transition event="connection.disconnected"/>
	
	<!-- Catches any errors -->	
      <transition event="error.*" name="evt">
          <log expr="evt.name + ' occurred, with error condition ' + evt.reason"/>
      </transition>
	
	<!-- Catches any missed events -->	
      <transition event="*" name="evt">
          <log expr="evt.name + ' event was caught'"/>
      </transition>
   </eventprocessor>
</ccxml>