fix: VoIP calls one-way audio issues #35420
Draft
+25
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes (including videos or screenshots)
For now this is just a PoC fix: it solves the problem, but it's not the best solution.
Issue(s)
Steps to test or reproduce
Further comments
To prevent react from destroying the audio element that is playing a call's audio, a workaround was made to pass this element as reference to the voip client, but in some situations the element was not passed at all and the voipclient had nothing to play the audio on.
For now I'm just passing this reference to the client after a successful SIP registration - this ensures the element will always be there. For safeguard I'm also passing it when a call is fully established.
The old code was already passing it on when the call is established, but only for the user who's receiving the call. This is why the problem happened a lot more often for the caller than the callee. What's even more strange, is that PR #33404 inverted this behavior. It used to be only the caller, now it's only the callee.
Going even further, I noticed that the omnichannel team has run into the exact same problem years ago with their own voip solution. And they left a long comment in the code talking about it. The solution they came up with is also not that great, so we might go ahead and fix it properly in both places now.