着信コールの処理
このシナリオは4つの状態に分けることができます。
- コールを受信しました
- Fusionからコールが受け入れられました
- Fusionからコールが拒否されました
- Fusionから切断されたコール
コールを受信しました
この状態では、顧客がサービス・センター番号をコールしており、電話回線が鳴っています。

このシナリオは次のようになります:
- コールが最初に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_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(() => { }) - Fusionアプリケーションは、このアクションを識別すると、担当者番号の検索を実行し、アクション・レスポンスの担当者詳細を返します。
- 最後に、Fusionアプリケーションは、ダイアログ・ボックスを介した着信コールについてエージェントに通知します。
- この時点で、エージェントはコールに応答するか拒否できます。
Fusionからコールが受け入れられました
このシナリオでは、エージェントは「回答」ボタンをクリックして、コールを受け入れます。
- エージェントがFusionアプリケーションの「回答」ボタンをクリックすると、
onToolbarInteractionCommandイベントがコマンドにacceptとして起動されます。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 break; case "reject": // Notify CTI Vendor to disconnect the call break; } }).catch(() => { }) - パートナ・アプリケーションは、このイベントを受信し、イベントがコールを受理する場合、パートナ・アプリケーションは、CTIサプライヤにコールを受理するように通知します。
- CTIサプライヤがパートナ・アプリケーションにコールの受入れを通知すると、パートナ・アプリケーションは
startCommEventアクションを起動できます。パートナ・アプリケーションから次のコードを実行して、
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(() => { }); - Fusionアプリケーションでこのアクションが識別されると、一致した担当者とエンゲージメント・パネルは、スクリーン・ポップのFusion構成管理で構成されたルールに基づいて開きます。
Fusionからコールが拒否されました
このシナリオでは、エージェントは「拒否」ボタンをクリックしてコールを拒否します。

- エージェントがFusionアプリケーションの「回答」ボタンをクリックすると、
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 break; case "reject": // Notify CTI Vendor to disconnect the call break; } }).catch(() => { }) - パートナ・アプリケーションは、このイベントを受信し、イベントがコールを拒否する場合、パートナ・アプリケーションは、CTIサプライヤにコールを拒否するように通知します。
- CTIサプライヤがパートナ・アプリケーションにコールが拒否されたことを通知すると、パートナ・アプリケーションは
closeCommEventアクションをREJECTとして起動できます。パートナ・アプリケーションから次のコードを実行して、
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(() => { }) - Fusionアプリケーションがこのアクションを識別すると、コール・ダイアログ・ボックスはUIから破棄されます。
Fusionから切断されたコール
このシナリオでは、会話が完了すると、エージェントはFusionの「コールの終了」ボタンをクリックします。

-
エージェントがFusionアプリケーションの「コールの終了」ボタンをクリックすると、
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 break; case "reject": // Notify CTI Vendor to disconnect the call break; } }).catch(() => { }) - パートナ・アプリケーションは、このイベントを受信し、イベントがコールを切断する場合、パートナ・アプリケーションは、CTIサプライヤにコールの切断を通知します。
- CTIサプライヤがパートナ・アプリケーションにコールが切断されたことを通知すると、パートナ・アプリケーションは
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 requestObject.setReason("WRAPUP"); // Step 3: Invoke the API phoneContext.publish(requestObject).then((operationResponse: IMcaCloseComActionResponse) => { console.log('closeCommEvent fired', operationResponse); }).catch(() => { }) - Fusionアプリケーションは、このアクションを識別すると、UIにラップ・アップ・ウィンドウをレンダリングします。