closeCommEvent

The toolbar calls this method when communication ends. The parameter reason is used to indicate how the communication ended and provide additional information. Value reason values are shown in the following list:

  • ABANDONED: The communication attempt timed out.

  • ENDCOMMUNICATION: Indicates that the communication ended and if Fusion Service is in wrap-up mode it then must close the wrap-up page.

  • MISSED: The communication attempt couldn't be established for another reason.

  • REJECT: When an agent rejects a communication.

  • TIMEOUT: The communication attempt timed out.

  • WRAPUP: Displays the Wrap Up window to indicate to the agent that the communication must come to a close.

Here's the parameters for this method:

Parameter

Description

channel

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

appClassification

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

eventId

Toolbar generated media event identifier. The same parameter value must be used for all method invocations for a communication. This parameter is stored with 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.

reason

ABANDONED, ENDCOMMUNICATION, MISSED, REJECT, TIMEOUT, OR WRAPUP.

callback

Returns results to the caller toolbar.

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 the 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 the 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.

Here's sample code for this method:

<html>
<head>
<script type="text/javascript" src="http://domain:port/ora_support/js/mcaInteractionV1.js"> 
</script>
<script type="text/javascript">
function closeCommEvent() {
      var inData = {};
      inData.SVCMCA_ANI = '5551234';
      inData.SVCMCA_CONTACT_ID = '1234567890';
      inData.SVCMCA_CONTACT_NAME = 'John Smith';
      svcMca.tlb.api.closeCommEvent('PHONE', 'ORA_SERVICE', '12345-1234-67890', inData, 'WRAPUP', function (response) {
        if (response.result == 'success') {
          alert('Success! Call ended.');
        } else {
          alert('Operation finished with error: ' + response.error);
        }
      },'ORA_SVC_PHONE');
    }</script>
</head>
<body>
<input type="button" value="End call" onclick="closeCommEvent()"/>
</body>
</html>