CCXML Call Transfer and Bridging

Blueworx Voice Response supports CCXML blind and consult call transfer operations using the messages and events in BVR Specific Messages and Events for Call Transfer

Blueworx Voice Response supports CCXML bridging of calls using the join and unjoin CCXML elements. Support of these elements and their attributes are defined in CCXML Elements

The following is an example of a CCXML application that can perform either a blind or consult transfer based on the testBlind variable setting.


<ccxml version="1.0">
    <script>function makeOutboundHeader(value){
         var ret = new Object();
         ret.value = value;
         return ret;         }
    </script>
    <var name="Host" expr="'siphost.blueworx.com'"/>
    <var name="myConnectionID"/>
    <var name="testBlind" expr="'false'"/>

    <eventprocessor>

        <transition event="ccxml.loaded" name="evt">
        </transition>

        <transition event="connection.alerting">
            <accept/>
        </transition>

        <transition event="connection.connected">
            <log expr="'[connection.connected] on connectionid ' + event$.connectionid"/>
            <var name="target" expr="'sip:1003@' + Host"/>
            <var name="outbound" expr="new Object()"/>
            <var name="outbound['x-user-to-user']" expr="makeOutboundHeader('Example header value')"/>
            <var name="outbound['x-checksum']" expr="makeOutboundHeader('1234567890')"/>
            <log expr="'[connection.connected] Transfer header x-user-to-user set as ' + outbound['x-user-to-user'].value"/>
            <log expr="'[connection.connected] Transfer header x-checksum set as ' + outbound['x-checksum'].value"/>
            <if cond="testBlind == 'true'">
                 <!-- Blind transfer -->
                 <send target="event$.connectionid" targettype="'connection'" name="'bvr.transfer'" namelist="target" hints="outbound"/>
            <else/>
                 <!-- Consult transfer -->
                 <var name="purpose" expr="'transfer'"/>
                 <var name="wait_for_answer" expr="'false'"/>
                 <send target="event$.connectionid" targettype="'connection'" name="'bvr.consult'" namelist="target purpose wait_for_answer" hints="outbound"/>
            </if>
        </transition>

        <transition event="connection.disconnected">
            <log expr="'[connection.disconnected] on connectionid ' + event$.connectionid"/>
            <exit/>
        </transition>

        <transition event="bvr.transfer.successful">
                <log expr="'[bvr.transfer.successful]'"/>
        </transition>

         <transition event="bvr.consult.successful">
                <log expr="'[bvr.consult.successful]'"/>
        </transition>

        <transition event="error.bvr.transfer">
                <log expr="'[error.bvr.transfer]'"/>
        </transition>

         <transition event="error.bvr.consult">
                <log expr="'[error.bvr.consult]'"/>
        </transition>

        <transition event="error.*">
            <log expr="'[error] event  = ' + event$.name + ',reason = ' + event$.reason"/>
        </transition>

        <transition event="send.successful">
        </transition>

        <transition event="*">
            <log expr="'Event = ' + event$.name + ' was not caught by any transitions in the CCXML document'"/>
        </transition>
    </eventprocessor>
</ccxml>

The following is an example of a CCXML application that accepts an incoming call and starts a dialog. Once the dialog completes it sets up an outgoing call and then bridges the incoming and outgoing calls using the join element.

<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0">
<var name="destination" expr="'sip:1234@siphost.blueworx.com'"/>
<var name="conn1" expr="''"/>
<var name="conn2" expr="''"/>
<eventprocessor>
        <transition event="ccxml.loaded">
                <log expr="'[ccxml.loaded] You have successfully invoked this join test application with session id ' + session.id"/>
        </transition>

        <transition event="connection.alerting">
                <log expr="'[' + event$.name + '] with connection ID ' + event$.connectionid"/>
                <assign name="conn1" expr="event$.connectionid"/>
                <accept/>
        </transition>

        <transition event="connection.connected" cond="conn2 == ''">
                <log expr="'[' + event$.name + '] with connection ID ' + event$.connectionid"/>
                <dialogstart src="'file:///opt/blueworx/ccxml/playwav.vxml'"/>
        </transition>

        <transition event="connection.connected">
                <log expr="'[' + event$.name + '] with connection ID ' + event$.connectionid"/>
                <join id1="conn1" id2="conn2"/>
        </transition>

        <transition event="connection.disconnected">
                <log expr="'[' + event$.name + '] with connection ID ' + event$.connectionid"/>
                <exit/>
        </transition>

         <transition event="connection.progressing">
                <log expr="'[' + event$.name + '] with connection ID ' + event$.connectionid"/>
        </transition>

        <transition event="conference.joined">
                <log expr="'[' + event$.name + '] with IDs ' + event$.id1 + ' and ' + event$.id2"/>
        </transition>

        <transition event="dialog.started">
                <log expr="'[dialog.started]'"/>
        </transition>

         <transition event="dialog.exit">
                <createcall dest="destination" connectionid="conn2"/>
        </transition>

        <transition event="conference.unjoined">
                <log expr="'[' + event$.name + '] with IDs ' + event$.id1 + ' and ' + event$.id2"/>
                <disconnect connectionid="conn1"/>
                <disconnect connectionid="conn2"/>
        </transition>


        <transition event="error.*">
                <log expr="'[' + event$.name + '] with connection ID ' + event$.connectionid + ' and reason ' + event$.reason"/>
                <exit/>
        </transition>

        <transition event="*">
                <log expr="'[' + event$.name + '] fell through to catchall '"/>
                <exit/>
        </transition>

</eventprocessor>
</ccxml>