Skip to content

Commit 93acfbe

Browse files
authored
fix: Incoming VoIP calls playing "dial" sound when answered (#36225)
1 parent 689f6df commit 93acfbe

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/strong-trains-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@rocket.chat/ui-voip": patch
3+
---
4+
5+
Fixes incoming VoIP calls playing "dial" sound when answered

packages/ui-voip/src/providers/VoipProvider.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ const VoipProvider = ({ children }: { children: ReactNode }) => {
6969
};
7070

7171
const onOutgoingCallRinging = (): void => {
72-
voipSounds.playDialer();
72+
// VoipClient 'outgoingcall' event is emitted when the call is establishing
73+
// and that event is also emitted when the call is accepted
74+
// to avoid disrupting the VoipClient flow, we check if the call is outgoing here.
75+
if (voipClient.isOutgoing()) {
76+
voipSounds.playDialer();
77+
}
7378
};
7479

7580
const onIncomingCallRinging = (): void => {

0 commit comments

Comments
 (0)