newCommEvent

This is the action user needs to publish when there's a ring received scenario.

For example, when a user is trying to call an agent, the Fusion application application should show a notification with Accept or Decline Button. To enable this the MCA integrated CTI should publish a newCommEvent request.

Note: This API is called to try for a call connection, based on agents accept or decline actions, call will be established or completely declined with StartCommEvent and CloseCommEvent respectively.

Here's a Typescript example calling the newCommEvent 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') as IPhoneContext;
    const request: IMcaNewCommEventActionRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('newCommEvent') as IMcaNewCommEventActionRequest;
    request.setAppClassification('appClassfication'); // You should set correct appClassification here. eg: ORA_SERVICE for Service App
    request.setEventId('1'); // Set the event ID here
    // request.setInputData(_inboundData); _inboundData of type - IMcaNewCommInData
    const inData: IMcaInDataRequest = request.getInData();
    request.getInData().setCallStatus('INCOMING'); // optional for incoming calls
    request.getInData().setInDataValueByAttribute('SVCMCA_ANI', '+12345678');
    phoneContext.publish(request).then((res: IOperationResponse) => {
        const response: IMcaNewComActionResponse = res as IMcaNewComActionResponse;
        const mcaNewComActionData: IMcaNewComActionData = response.getResponseData();
        const mcaOutData: IMcaOutData = mcaNewComActionData.getOutData(); // This outData should be passed as inData to startCommEvent or closeCommEvent based on the scenario about call connection
    }).catch(() => {
    })         

Here's a JavaScript example calling the newCommEvent 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('newCommEvent');
// 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 - IMcaNewCommInData
const inData = request.getInData();
request.getInData().setCallStatus('INCOMING'); // optional for incoming calls
 
request.getInData().setInDataValueByAttribute('SVCMCA_ANI', '+12345678');
phoneContext.publish(request).then((res) => {
  const mcaNewComActionData = res.getResponseData();
  const mcaOutData = mcaNewComActionData.getOutData(); // This outData should be passed as inData to startCommEvent or closeCommEvent based on the scenario about call connection
}).catch(() => {
 
})