Transporting events to and from external components

Blueworx Voice Response supports a basichttp event I/O processor that uses HTTP (as described in RFC2616) to transport events between a CCXML implementation and external components.

For full details, refer to Appendix K of the version of the Voice Browser Call Control: CCXML Version 1.0 specification, published by W3C and available at:
http://www.w3.org/TR/ccxml/#basichttpio

Configuration

Additional VRNode configuration parameters are required in file default.cff to enable the transport of events to and from external components:

CCXHTTPServer
Switches external component event processing on (value of yes) or off (value of no). The default is no.
CCXHTTPServerPort
The port number that optionally overrides the default listener port number (1971) for external component event processing. If you override the default port number, the port number used must be included in the URI.

Sending an event to a CCXML session

An external component sends to a predefined CCXML basichttp event processor URI, a HTTP request that includes the following parameters:

sessionid
The CCXML session ID to which the event is to be sent. Mandatory
name
The event name, which can include alpha numeric characters and the dot character (.). Mandatory
eventsource
Optional URI to which events can be sent (typically, the value of the <send> element target attribute).
With a predefined event processor URI of http://www.mywvr.com/ccxml/basichttp for example, an external component can send a HTTP request that refers to a URI defined in the eventsource parameter:
http://www.mywvr.com/ccxml/basichttp?sessionid=myccxmlsession&name=basichttp.ccxml.loaded
            &eventsource=http://www.myexternalapp.org/ccxmlex&other=somevalue
Note that a valid CCXML sessionid needs to be known by the external component before it can send the HTTP request. Any other parameters and values passed in the HTTP request must also be valid otherwise a HTTP error code is returned to the external component. If they are valid, a 204 response code is returned, and the event can be handled by a transition:
<transition state="'dialogActive'" event="basichttp.EventDialer" name="evnt">
    <log expr="'[basichttp.EventDialer] external event'"/>
    <log expr="'[basichttp.EventDialer] name' + evnt.name"/>
    <log expr="'[basichttp.EventDialer] sourcetype' + evnt.eventsourcetype"/>
    <log expr="'[basichttp.EventDialer] eventsource' + evnt.eventsource"/>
    <log expr="'[basichttp.EventDialer] other' + evnt.other"/>
</transition>
In the above example:
Parameter
Value
evnt.name
basichttp.ccxml.loaded
evnt.eventsourcetype
basichttp
evnt.eventsource
http://www.myexternalapp.org/ccxmlex
evnt.other
somevalue

Sending an event from a CCXML session

To send an event, from a CCXML session to an external component, the required information is first sent to a predefined CCXML basichttp event processor URI using a <send> transition element, for example:

<transition event="ccxml.loaded" name="evt">
     <log expr="'[ccxml.loaded] start start.ccxml'"/>
     <var name="hostname" expr="'machine1'"/>
     <send target="'http://www.example.org/ccxmlex'"
         targettype="'basichttp'"
         name="'basichttp.dialler.available'"
         namelist="hostname"/>
</transition>
Note: URIs that include numeric IPv6 format addresses, must have the numeric part within [ ] brackets, for example:
http://[2002:914:fc12:195:0000:8a2e:0370:7334]/ccxmlex
This applies to all protocols.

In response, the CXML basichttp event processor sends a HTTP POST request that includes the following parameters:

sessionid
The CCXML session ID from which the event is to be sent. Mandatory
name
The event name, which can include alpha numeric characters and the dot character (.). Mandatory

Any other parameters and values passed in the HTTP request must also be valid otherwise a HTTP error code is mapped to the error.send.failed CCXML event. If they are valid, a 204 response code is mapped to the send.successful CCXML event.