Handle incoming calls
This scenario can divided into four states.
- Call received
- Call accepted from Fusion
- Call rejected from Fusion
- Call disconnected from Fusion
Call received
During this state, a customer is calling a service center number and phone line is ringing.
- The call is first received by the CTI supplier which notifies the partner application that there's an incoming call.
- The partner application notifies the Fusion application of the incoming call
by firing the
newCommEvent
action.The following code can be executed from the partner application to fire a
newCommEvent
action:// Step 1: Get the proper context const multiChannelAdaptorContext: IMultiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext(); const phoneContext: IPhoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE') as IPhoneContext; // Step 2: Create the request object const requestObject: IMcaNewCommEventActionRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('newCommEvent') as IMcaNewCommEventActionRequest; // Set request object properties requestObject.setEventId('1'); requestObject.getInData().setInDataValueByAttribute('SVCMCA_ANI', phoneNumber); requestObject.getInData().setInDataValueByAttribute("SVCMCA_COMMUNICATION_DIRECTION", "ORA_SVC_INBOUND"); requestObject.setAppClassification('ORA_SERVICE'); // Step 3: Invoke the API phoneContext.publish(requestObject).then((operationResponse: IMcaNewComActionResponse) => { // Custom logic for handling the partner application UI }).catch(() => { })
- Once the Fusion application identifies this action, it performs the contact number lookup and return the contact details in the action response.
- Finally the Fusion application notifies the agent about the incoming call through a dialog box.
- At this point, the agent can either answer or decline the call.
Call accepted from Fusion
In this scenario the agent clicks the Answer button, accepting the call.
- When the agent clicks the Answer button in the Fusion application, the
onToolbarInteractionCommand
event is fired with the command as accept.Here's the code to listen to the
onToolbarInteractionCommand
event. This code can be executed from the partner application to subscribe toonToolbarInteractionCommand
event:// Step 1: Get the proper context const multiChannelAdaptorContext: IMultiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext(); const phoneContext: IPhoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE') as IPhoneContext; // Step 2: Create the request object const requestObject: IMcaEventRequest = uiEventsFrameworkInstance.requestHelper.createSubscriptionRequest('onToolbarInteractionCommand') as IMcaEventRequest; // Step 3: Invoke the API phoneContext.subscribe(requestObject, (eventResponse: IMcaOnToolbarInteractionCommandEventResponse) => { const eventResponseDetails: IMcaOnToolbarInteractionCommandDataResponse = eventResponse.getResponseData(); const command: string = eventResponseDetails.getCommand(); switch (command) { case "accept": // Notify CTI Vendor to accept the call break; case "disconnect": // Notify CTI Vendor to disconnect the call break; case "reject": // Notify CTI Vendor to disconnect the call break; } }).catch(() => { })
- The partner application receives this event and if the event is to accept a call, the partner application notifies the CTI supplier to accept the call.
- Once the CTI supplier notifies the partner application that the call is
accepted, the partner application can fire the
startCommEvent
action.The following code can be executed from the partner application to fire a
startCommEvent
action:// Step 1: Get the proper context const multiChannelAdaptorContext: IMultiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext(); const phoneContext: IPhoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE') as IPhoneContext; // Step 2: Create the request object const request: IMcaStartCommEventActionRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('startCommEvent') as IMcaStartCommEventActionRequest; request.setAppClassification('ORA_SERVICE'); request.setEventId('1'); // Step 3: Invoke the API phoneContext.publish(request).then((operationResponse: IMcaStartComActionResponse) => { // Extract the required data from response and use for updating the partner app const contactName: string = operationResponse.getResponseData().getData()['SVCMCA_CONTACT_NAME']; // sample for getting the contact name }).catch(() => { });
- Once the Fusion application identifies this action, the matched contact and an engagement panel will be opened based on the rules configured in the Fusion configuration management for the screen pop.
Call rejected from Fusion
In this scenario, the agent clicks the Decline button to reject the call.

- When the agent clicks the Answer button in the Fusion application, the
onToolbarInteractionCommand
event is fired with command as reject.The following code can be executed from the partner application to subscribe to theonToolbarInteractionCommand
event:// Step 1: Get the proper context const multiChannelAdaptorContext: IMultiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext(); const phoneContext: IPhoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE') as IPhoneContext; // Step 2: Create the request object const requestObject: IMcaEventRequest = uiEventsFrameworkInstance.requestHelper.createSubscriptionRequest('onToolbarInteractionCommand') as IMcaEventRequest; // Step 3: Invoke the API phoneContext.subscribe(requestObject, (eventResponse: IMcaOnToolbarInteractionCommandEventResponse) => { const eventResponseDetails: IMcaOnToolbarInteractionCommandDataResponse = eventResponse.getResponseData(); const command: string = eventResponseDetails.getCommand(); switch (command) { case "accept": // Notify CTI Vendor to accept the call break; case "disconnect": // Notify CTI Vendor to disconnect the call break; case "reject": // Notify CTI Vendor to disconnect the call break; } }).catch(() => { })
- The partner application receives this event and if the event is to reject a call, the partner application notifies the CTI supplier to reject the call.
- Once the CTI supplier notifies the partner application that the call is
rejected, the partner application can fire the
closeCommEvent
action with reason as REJECT.The following code can be executed from the partner application to fire a
closeCommEvent
action:// Step 1: Get the proper context const multiChannelAdaptorContext: IMultiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext(); const phoneContext: IPhoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE') as IPhoneContext; // Step 2: Create the request object const requestObject: IMcaNewCommEventActionRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('closeCommEvent') as IMcaCloseCommEventActionRequest; // Set request object properties, in this scenario we need to set the reason as reject requestObject.setReason("REJECT"); // Step 3: Invoke the API phoneContext.publish(requestObject).then((operationResponse: IMcaCloseComActionResponse) => { console.log('closeCommEvent fired', operationResponse); }).catch(() => { })
- Once the fusion application identifies this action, the call dialog box will be discarded from the UI.
Call disconnected from Fusion
In this scenario, the agent clicks the End Call button in Fusion when the conversation is complete.
-
When the agent clicks the End Call button in the Fusion application, the
onToolbarInteractionCommand
event is fired with the disconnect command.The following code can be executed from the partner application to subscribe to the
onToolbarInteractionCommand
event:// Step 1: Get the proper context const multiChannelAdaptorContext: IMultiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext(); const phoneContext: IPhoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE') as IPhoneContext; // Step 2: Create the request object const requestObject: IMcaEventRequest = uiEventsFrameworkInstance.requestHelper.createSubscriptionRequest('onToolbarInteractionCommand') as IMcaEventRequest; // Step 3: Invoke the API phoneContext.subscribe(requestObject, (eventResponse: IMcaOnToolbarInteractionCommandEventResponse) => { const eventResponseDetails: IMcaOnToolbarInteractionCommandDataResponse = eventResponse.getResponseData(); const command: string = eventResponseDetails.getCommand(); switch (command) { case "accept": // Notify CTI Vendor to accept the call break; case "disconnect": // Notify CTI Vendor to disconnect the call break; case "reject": // Notify CTI Vendor to disconnect the call break; } }).catch(() => { })
- The partner application receives this event and if the event is to disconnect a call, the partner application notifies the CTI supplier to disconnect the call.
- Once the CTI supplier notifies the partner application that the call is
disconnected, the partner application can fire the
closeCommEvent
action.// Step 1: Get the proper context const multiChannelAdaptorContext: IMultiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext(); const phoneContext: IPhoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE') as IPhoneContext; // Step 2: Create the request object const requestObject: IMcaNewCommEventActionRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('closeCommEvent') as IMcaCloseCommEventActionRequest; // Set request object properties requestObject.setReason("WRAPUP"); // Step 3: Invoke the API phoneContext.publish(requestObject).then((operationResponse: IMcaCloseComActionResponse) => { console.log('closeCommEvent fired', operationResponse); }).catch(() => { })
- Once the Fusion application identifies this action, it renders the wrap up window in the UI.