From 17856a47dbecfba77c02b78d5d7e2e7c2b70b0a0 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 2 Oct 2023 13:54:36 +0200 Subject: [PATCH] hold back candidates until after content-add --- .../siacs/conversations/xmpp/jingle/JingleRtpConnection.java | 3 ++- .../java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java index 87bf4bf98..8aea0da9e 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java @@ -729,6 +729,7 @@ public class JingleRtpConnection extends AbstractJingleConnection + ContentAddition.summary(contentAcceptMap)); modifyLocalContentMap(rtpContentMap); sendContentAccept(contentAcceptMap); + this.webRTCWrapper.setIsReadyToReceiveIceCandidates(true); } catch (final Exception e) { Log.d(Config.LOGTAG, "unable to accept content add", Throwables.getRootCause(e)); webRTCWrapper.close(); @@ -862,7 +863,6 @@ public class JingleRtpConnection extends AbstractJingleConnection webRTCWrapper.setRemoteDescription(sdp).get(); setRemoteContentMap(restartContentMap); if (isOffer) { - webRTCWrapper.setIsReadyToReceiveIceCandidates(false); final SessionDescription localSessionDescription = setLocalSessionDescription(); setLocalContentMap(RtpContentMap.of(localSessionDescription, isInitiator())); // We need to respond OK before sending any candidates @@ -2473,6 +2473,7 @@ public class JingleRtpConnection extends AbstractJingleConnection handleIqTimeoutResponse(response); } }); + this.webRTCWrapper.setIsReadyToReceiveIceCandidates(true); } private void setLocalContentMap(final RtpContentMap rtpContentMap) { diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java index c30b1d58f..8c5d266a5 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java @@ -561,6 +561,7 @@ public class WebRTCWrapper { } synchronized ListenableFuture setLocalDescription() { + this.setIsReadyToReceiveIceCandidates(false); return Futures.transformAsync( getPeerConnectionFuture(), peerConnection -> {