Skip to content

Commit

Permalink
feature: changed HANDLE_RINGING_ACTION and remove offline and manual …
Browse files Browse the repository at this point in the history
…calls from isIncomingRinging calls [WTEL-5867](https://webitel.atlassian.net/browse/WTEL-5867)
  • Loading branch information
liza-pohranichna committed Jan 10, 2025
1 parent b58f90b commit dbfe6ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/features/modules/call/client-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
15 changes: 13 additions & 2 deletions src/features/modules/call/scripts/isIncomingRinging.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dbfe6ca

Please sign in to comment.