diff --git a/.changeset/strong-trains-serve.md b/.changeset/strong-trains-serve.md new file mode 100644 index 00000000000..508be883d06 --- /dev/null +++ b/.changeset/strong-trains-serve.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/ui-voip": patch +--- + +Fixes incoming VoIP calls playing "dial" sound when answered diff --git a/packages/ui-voip/src/providers/VoipProvider.tsx b/packages/ui-voip/src/providers/VoipProvider.tsx index 902c9a8d4cb..a7914467d46 100644 --- a/packages/ui-voip/src/providers/VoipProvider.tsx +++ b/packages/ui-voip/src/providers/VoipProvider.tsx @@ -69,7 +69,12 @@ const VoipProvider = ({ children }: { children: ReactNode }) => { }; const onOutgoingCallRinging = (): void => { - voipSounds.playDialer(); + // VoipClient 'outgoingcall' event is emitted when the call is establishing + // and that event is also emitted when the call is accepted + // to avoid disrupting the VoipClient flow, we check if the call is outgoing here. + if (voipClient.isOutgoing()) { + voipSounds.playDialer(); + } }; const onIncomingCallRinging = (): void => {