CCXML Blind/Consult Transfers

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

A blind transfer immediately drops the calls from Blueworx Voice Response and lets the caller handle the transfer. If the transfer fails then effectively the call has ended.

A consult transfer asks the caller to do the transfer but keeps the connection and notifies CCXML with a failure/success when it finishes the transfer attempt.

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>