エージェントが顧客との通話終了後、シフトの交代やミーティングなどで離席したいと考えている場合、アフターコールワーク後に一度受付可能状態に遷移してしまうと、その短い時間にキューで待っていた顧客からの着信が入ってしまうことがあります。
Amazon Connect では Next Agent Status 機能により、通話中に次のステータスを指定しておくことで、エージェントが受付可能状態を経由せず、直ちに別のステータスへ遷移することができます。ここでは、4-2 で作成したカスタム CCP の機能追加例として、アフターコールワーク後にステータスをオフラインに指定可能なボタンを追加します。
<tbody>
<tr>
<td>
<button type="button" id="setReady" value="SetReady">Set Ready</button>
</td>
<td>
<button type="button" id="setOffline" value="SetOffline">Set Offline</button>
</td>
<td>
<button type="button" id="nextOffline" value="nextOffline">Next Offline</button>
</td>
</tr>
</tbody>
var nextofflineButton = document.getElementById("nextOffline");
$("#nextOffline").click(() => {
gonextOffline();
});
nextofflineButton.style.backgroundColor = '#FFFFFF';
nextofflineButton.style.color = '#000000';
nextofflineButton.disabled = true;
nextofflineButton.style.backgroundColor = '#FF0000';
nextofflineButton.style.color = '#FFFFFF';
nextofflineButton.disabled = false;
enqueueNextState
により Next Status であることを指定しています。function gonextOffline() {
var offlineState = window.myCPP.agent.getAgentStates().filter(function (state) {
return state.type === connect.AgentStateType.OFFLINE;
})[0];
window.myCPP.agent.setState(offlineState, {
success: function () {
console.log('Succesfully set agent next status to Offline via Streams');
},
failure: function () {
console.log('Failed to set agent next status to Offline via Streams');
}
},{enqueueNextState : true});
}
このラボで更新したファイルのサンプルはこちらです。