From dbfe6ca0559896d945d06aaf66b9df7644b5345e Mon Sep 17 00:00:00 2001 From: liza-pohranichna Date: Fri, 10 Jan 2025 19:23:41 +0200 Subject: [PATCH 1/2] feature: changed HANDLE_RINGING_ACTION and remove offline and manual calls from isIncomingRinging calls [WTEL-5867](https://webitel.atlassian.net/browse/WTEL-5867) --- src/features/modules/call/client-handlers.js | 4 ++-- .../modules/call/scripts/isIncomingRinging.js | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/features/modules/call/client-handlers.js b/src/features/modules/call/client-handlers.js index d2d452e2..ada7d975 100644 --- a/src/features/modules/call/client-handlers.js +++ b/src/features/modules/call/client-handlers.js @@ -32,17 +32,17 @@ const actions = { }, HANDLE_RINGING_ACTION: async (context, call) => { + await context.dispatch('ADD_CALL', call); if (call.direction === CallDirection.Outbound || context.rootGetters['workspace/IS_EMPTY_WORKSPACE']) { await context.dispatch('SET_WORKSPACE', call); } - // have to check is call not manual or not from offline queue before send notification and play sound https://webitel.atlassian.net/browse/WTEL-4502 + https://webitel.atlassian.net/browse/WTEL-5030 + // have to check is call not manual or not from offline queue before send notification https://webitel.atlassian.net/browse/WTEL-4502 + https://webitel.atlassian.net/browse/WTEL-5030 if (call.allowAnswer && !context.getters.IS_OFFLINE_CALL && !call.queue?.manual_distribution) { const callId = call.id; - await context.dispatch('ADD_CALL', call); await context.dispatch('features/notifications/HANDLE_INBOUND_CALL_RINGING', { displayName: call.displayName, displayNumber: call.displayNumber, diff --git a/src/features/modules/call/scripts/isIncomingRinging.js b/src/features/modules/call/scripts/isIncomingRinging.js index aa187233..cc899970 100644 --- a/src/features/modules/call/scripts/isIncomingRinging.js +++ b/src/features/modules/call/scripts/isIncomingRinging.js @@ -21,9 +21,20 @@ const isInboundRinging = (call) => ( call.direction === CallDirection.Inbound ); +const isNotManualCall = (call) => ( + !call.queue?.manual_distribution +); + +const isNotOfflineCall = (call) => ( + call.queue?.queue_type !== 'offline' +); + const isIncomingRinging = (call) => { - return isRinging(call) && [ - isInboundRinging(call), + return isRinging(call) + && isNotManualCall(call) + && isNotOfflineCall(call) + && [ + isInboundRinging(call), isOutboundPreviewDialer(call), isOutboundCallWithDisableAutoAnswer(call), ].some((condition) => !!condition); From f1562e017dd91bed7b4095a11515d108186ab7fe Mon Sep 17 00:00:00 2001 From: liza-pohranichna Date: Fri, 10 Jan 2025 19:26:41 +0200 Subject: [PATCH 2/2] fix: changed comment in HANDLE_RINGING_ACTION [WTEL-5867](https://webitel.atlassian.net/browse/WTEL-5867) --- src/features/modules/call/client-handlers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/modules/call/client-handlers.js b/src/features/modules/call/client-handlers.js index ada7d975..31eb1e81 100644 --- a/src/features/modules/call/client-handlers.js +++ b/src/features/modules/call/client-handlers.js @@ -39,7 +39,7 @@ const actions = { await context.dispatch('SET_WORKSPACE', call); } - // have to check is call not manual or not from offline queue before send notification https://webitel.atlassian.net/browse/WTEL-4502 + https://webitel.atlassian.net/browse/WTEL-5030 + // have to check is call not manual or not from offline queue before send notification https://webitel.atlassian.net/browse/WTEL-4502 if (call.allowAnswer && !context.getters.IS_OFFLINE_CALL && !call.queue?.manual_distribution) { const callId = call.id;