outboundCommError

The toolbar can publish this API to notify the fusion application that an error occurred during initiation of the outbound call. The error occurs if the identifier of the event, such as phone number, or email can't be used to establish a connection. In this case user needs to call outboundCommError API with event id as same as the outbound call, to reject it.

Here's a Typescript example calling the outboundCommError 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: IMcaOutboundCommErrorActionRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('outboundCommError') as IMcaOutboundCommErrorActionRequest;
    request.setCommUuid('eventId'); // set the event id here
    request.setErrorCode('INVALID_NUMBER');
    request.setErrorMsg('{"phoneLineId":phoneLineIdString}');
    phoneContext.publish(request).then((operationResponse: IOperationResponse) => {
        console.log('outboundCommError', operationResponse);
        const mcaOutBoundCommErrorResponsePayload: IMCAOutBoundCommErrorResponsePayload = (operationResponse as IMcaOutBoundCommErrorActionResponse).getResponseData().getData()
    }).catch((error: IErrorData) => {
        // console.log(error);
    });

Here's a JavaScript example calling the outboundCommError 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('outboundCommError');
request.setCommUuid('eventId'); // set the event id here
request.setErrorCode('INVALID_NUMBER');
request.setErrorMsg('{"phoneLineId":phoneLineIdString}');
phoneContext.publish(request).then((operationResponse) => {
    const mcaOutBoundCommErrorResponsePayload = (operationResponse).getResponseData().getData()
}).catch((error) => {
    // console.log(error);
});