アウトバウンド・コールの処理
このシナリオは4つの状態に分けることができます。
- アウトバウンド・コールの開始
- 顧客が受理したコール
- エージェントまたは顧客から切断された通話
- 顧客による通話拒否
アウトバウンド・コールの開始
エージェントがFusionアプリケーションから電話番号をクリックし、コール状態がリング中です。

- エージェントは、電話番号をクリックしてonOutgoingEventイベントを起動することにより、Fusionアプリケーションからアウトバウンド・コールを開始します。
パートナ・アプリケーションから次のコードを実行して、onOutgoingEventイベントをサブスクライブできます:
// 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('onOutgoingEvent') as IMcaEventRequest; requestObject.setAppClassification('ORA_SERVICE'); // Step 3: Invoke the API phoneContext.subscribe(requestObject, async (eventResponse: IMcaonOutgoingEventResponse) => { // Use the event response to get the phone number and invoke the initiate call api of CTI vendor }); - 次に、このイベントをリスニングするパートナ・アプリケーションが、コールを開始するようにCTIサプライヤに通知します。
- パートナ・アプリケーションは、newCommEventアクションを公開して、Fusionアプリケーションへのコール開始を通知します。
パートナ・アプリケーションから次のコードを実行して、newCommEventアクションを起動できます:
// 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_OUTBOUND"); requestObject.setAppClassification('ORA_SERVICE'); // Step 3: Invoke the API phoneContext.publish(requestObject).then((operationResponse: IMcaNewComActionResponse) => { // Handle the custom logic for UI updates here }).catch(() => { }) - Fusionアプリケーションからのアクション・レスポンスには、パートナ・アプリケーションがUIをレンダリングするために使用できる担当者詳細があります。
顧客が受理したコール

- 顧客が着信コールを受け入れ、CTIサプライヤがパートナ・アプリケーションに通知します。 パートナ・アプリケーションは、startCommEventアクションを公開して、Fusionアプリケーションに通知します。
パートナ・アプリケーションから次のコードを実行して、startCommEventアクションを起動できます:
// 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(() => { }); - startCommEventを完了すると、パートナ・アプリケーションは必要に応じてUIを更新して、進行中のコールを表示できます。
エージェントまたは顧客から切断された通話

- エージェントはFusionアプリケーションからのコールを終了し、コマンドをdisconnectとしてonToolbarInteractionCommandイベントを起動
パートナ・アプリケーションから次のコードを実行して、onToolbarInteractionCommandイベントをサブスクライブできます:
// 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 (In this use-case your logic should be here) break; case "reject": // Notify CTI Vendor to reject the call break; } }).catch(() => { }) - このイベントをリスニングするパートナ・アプリケーションは、CTIサプライヤに通話の切断を通知することで、イベントを処理します。
- コールが切断されると、パートナ・アプリケーションは、ラップ・アップとして理由付きでcloseCommEventをFusionアプリケーションに公開します。
パートナ・アプリケーションから次のコードを実行して、closeCommEventアクションを起動できます:
// 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 Wrapup requestObject.setReason("WRAPUP"); // Step 3: Invoke the API phoneContext.publish(requestObject).then((operationResponse: IMcaCloseComActionResponse) => { console.log('closeCommEvent fired', operationResponse); }).catch(() => { }) - Fusionアプリケーションは、ラップ・アップ・フローを実行し、ノートを表示します。
- CloseCommEventレスポンスで、パートナ・アプリケーションは必要に応じてUIを更新します。
顧客による通話拒否

- 顧客が着信コールを拒否し、CTIサプライヤがパートナ・アプリケーションに通知します。
- パートナ・アプリケーションは、UIを更新し、closeCommEventをFusionアプリケーションに公開します。
パートナ・アプリケーションから次のコードを実行して、closeCommEventアクションを起動できます:
// 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(() => { }) - パートナ・アプリケーションがUIを更新して、エージェントが使用可能であることを示します。