newCommEvent Method

This method is called by the toolbar to inform Fusion Service that a new communication event has started.

This is the first API call that the toolbar makes for a communication event. This method must provide through the eventId parameter, either a unique identifier or the media event identifier to be used for the communication event. For both inbound and outbound calls, it's important to specify the direction of the interaction. The newCommEvent must contain the following inData token to indicate the direction of the call: "SVCMCA_COMMUNICATION_DIRECTION". Valid values are: "ORA_SVC_INBOUND" and "ORA_SVC_OUTBOUND". This method call is mandatory.

For inbound calls, the primary purpose of the call is to identify customers by using reverse lookup functionality and to trigger the incoming call notification. The toolbar uses tokens to pass all the information from the Interactive Voice Response systems. All customer information retrieved is sent back to the toolbar using system tokens.

Here's a list of the newCommEvent parameters.

Parameter

Description

channel

Name of the channel for which the method is called. For more information on what channels are available, see Channel Type Data.

appClassification

Name of the application classification defined for the current toolbar. If this parameter is passed as null, it's assumed that there's no application classification. For a list of preconfigured values, see Application Classification Code.

eventId

A toolbar-generated media event identifier. The same parameter value must be used for all method invocations for a communication. This parameter is stored with the internal interaction record.

inData

An object containing information about incoming events for customer identifiable data, along with attributes containing the names of system or user-defined defined tokens.

To specify a timeout value for an incoming call notification, add the following pair to this parameter:SVCMCA_OFFER_TIMEOUT_SEC, #OFSECOND

Replace the #OFSECONDS value with the actual number of seconds where you want to start the timer. When the timer expires the onDataUpdated() method is invoked with the updateType parameter set to OFFER_TIMEOUT. The toolbar then invokes the closeCommEvent() method to end the interaction.

callback

Returns results to the caller toolbar.

lookupObject

A business object used to run the reverse lookup. Use this optional parameter to get customer information. The default value of Contact. For more information about the list of system lookup objects, see System Business Objects.

channelType

The type of channel for which the method is being called. Note that if, for example, the channel is PHONE but the channelType isn't provided, the default value is set to ORA_SVC_PHONE. For more information, see Channel Type Data.

Here's a list of member attributes of the response object. The object has no return value.

Member Attribute

Description

result

The server side running status. Result values are success or error.

outData

Represents an object containing possible identified data from Fusion Service for the contact or for the organization. This attribute contains the names of system tokens.

error

Contains error message if the result value is an error. If not, then the value is undefined. For more information about error message codes, see Error Messages.

Note: The newCommEvent method triggers the creation of an interaction object. This object contains information related to communication, and objects that are related to communication. The identifier for the interaction is passed back with the callback response as the value for the SVCMCA_INTERACTION_ID token. Subsequent invocations of the method must send this token and its value, along with other IVR data to Fusion Service.

When the newCommEvent method is invoked for a transfer, the toolbar uses the SVCMCA_PARENT_INTERACTION_ID token to send IVR data and the originating communication interaction ID to Fusion Service which associates the communication events. In addition, you must also specify the SVCMCA_2NDARY_CALL_TYPE token to indicate whether this call is a Transfer, a Consultation, or a Conference.

Here's an example of code used to call this method.

<html>
<head>
<script type="text/javascript" src="http://domain:port/ora_support/js/mcaInteractionV1.js"> 
</script>
<script type="text/javascript">
function inboundCallNotification() {
      var inData = {};
      inData.SVCMCA_ANI = '5551234';
      inData.SVCMCA_CONTACT_ID = '1234567890';
      svcMca.tlb.api.newCommEvent('PHONE', 'ORA_SERVICE', '12345-1234-67890', inData, null, function (response) {
        if (response.result == 'success') {
          console.log('Customer: '+response.outData.SVCMCA_CONTACT_NAME +' ('+response.outData.SVCMCA_CONTACT_ID +')');
          console.log('Account: '+response.outData.SVCMCA_ORG_NAME +' ('+response.outData.SVCMCA_ORG_ID +')');
          alert('Success! Results available in log.');
        } else {
          alert('Operation finished with error: ' + response.error);
        }
      },'ORA_SVC_PHONE');
    }</script>
</head>
<body>
<input type="button" value="Get customer data" onclick="inboundCallNotification()"/>
</body>
</html>