CCXML and SIP Outgoing Header Access

SIP headers can be set and sent on the following outbound SIP messages.

The headers are sent by creating objects within an object that is passed as the hints object on the CCXML tag that initiates the SIP message (createcall or send when sending ibmwvr.transfer). For example:

<ccxml version="1.0">
<script>function makeOutboundHeader(value){
                 var ret = new Object();
                 ret.value = value;
                 return ret;         }
</script>
   <eventprocessor>
 ...
         <transition event="ccxml.loaded" name="evt">
            <log expr="'[' +  testID + ' ccxml.loaded] document loaded on fetch with sessionid ' + session.id"/>
            <log expr="'[' +  testID + ' Expected Result]: ' + expectResult "/>
            <log expr="'[' +  testID + ' Expected Result]: ' + expectResult1 "/>
            <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="'[' +  testID + ' ccxml.loaded]  Outbound header x-user-to-user set as ' + outbound['x-user-to-user'].value"/>
            <log expr="'[' +  testID + ' ccxml.loaded]  Outbound header x-checksum set as ' + outbound['x-checksum'].value"/>
            <var name="target" expr="'sip:1234@siphost.blueworx.com'"/>
            <createcall dest="target" connectionid="myConnectionID" hints="outbound"/>

        </transition>
 .....


      <transition event="dialog.transfer">
       <var name="target" expr="event$.URI"/>
       <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="'Outbound header x-user-to-user set as ' + outbound['x-user-to-user'].value"/>
       <send target="event$.connectionid" targettype="'connection'"
             name="'ibmwvr.transfer'" namelist="target" hints="outbound"/>
      </transition>
  ...
   </eventprocessor>
</ccxml>

For the example to work

must have been configured for processing in the headers_to_capture option of SIP Configuration Options.