closeCommEvent

For this action the user must publish when there's a call-decline scenario.

For instance, when an agent clicks Decline on a call notification, CTI integration code base would get notification for onAgentInteractionCommand Event with command as 'decline', if it has a subscription added for the same (Please see the onAgentInteractionCommand example for the same).

Now, once it gets a notification for the call decline command, the CTI integration should publish a closeCommEvent operation, which disconnects the entire call For outgoing event also, when the CTI gets an event notification for onOutgoingEvent and if it wants to reject that call, it needs to call the closeCommEvent publish API.

Note: The inData parameter that needs to be passed for closeCommEvent operation request should be matching with the outData response we get in the newCommEvent operation response. The setReason API in closeComm inData request will enable user to set the reason for the closeCommEvent operation. (for example, reason as MISSED, REJECT, WRAPUP and so on.

Here's a Typescript example calling the closeCommEvent operation.

/// <reference path="uiEventsFramework.d.ts"/>     
const uiEventsFrameworkInstance: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
    const multiChannelAdaptorContext: IMultiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
    const phoneContext: IPhoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
    const request: IMcaCloseCommEventActionRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('closeCommEvent') as IMcaCloseCommEventActionRequest;
    // You should set correct appClassification here. eg: ORA_SERVICE for Service App
	// Refer https://docs.oracle.com/en/cloud/saas/fusion-service/fairs/application-classification-code.html#s20059918 for the list of supported app classifications
    request.setAppClassification('appClassfication');
    request.setEventId('1'); // Set the event ID here
    // request.setInputData(_inboundData);// _inboundData of type - IMcaStartCommInData
    request.setReason('WRAPUP'); // Specify the reason
    const inData = request.getInData();
    phoneContext.publish(request).then((res: IOperationResponse) => {
        const response = res as IMcaCloseComActionResponse
    }).catch(() => {
    })     

Here's a JavaScript example calling the closeCommEvent operation.

const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
const request = uiEventsFrameworkInstance.requestHelper.createPublishRequest('closeCommEvent');
// You should set correct appClassification here. eg: ORA_SERVICE for Service App
// Refer https://docs.oracle.com/en/cloud/saas/fusion-service/fairs/application-classification-code.html#s20059918 for the list of supported app classifications
request.setAppClassification('appClassfication');
request.setEventId('1'); // Set the event ID here
// request.setInputData(_inboundData);// _inboundData of type - IMcaStartCommInData
request.setReason('WRAPUP'); // Specify the reason
const inData = request.getInData();
phoneContext.publish(request).then((res) => {
}).catch(() => {
})