send retract when unable to setup webrtc as initiator. fixes #3717

Daniel Gultsch created

Change summary

src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java | 6 
1 file changed, 3 insertions(+), 3 deletions(-)

Detailed changes

src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java 🔗

@@ -654,8 +654,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
         } catch (final WebRTCWrapper.InitializationException e) {
             Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": unable to initialize WebRTC");
             webRTCWrapper.close();
-            //todo we haven’t actually initiated the session yet; so sending sessionTerminate makes no sense
-            //todo either we don’t ring ever at all or maybe we should send a retract or something
+            sendJingleMessage("retract", id.with.asBareJid());
             transitionOrThrow(State.TERMINATED_APPLICATION_FAILURE);
             this.finish();
             return;
@@ -672,6 +671,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
             if (isInState(targetState)) {
                 sendSessionTerminate(Reason.FAILED_APPLICATION);
             } else {
+                sendJingleMessage("retract", id.with.asBareJid());
                 transitionOrThrow(State.TERMINATED_APPLICATION_FAILURE);
                 this.finish();
             }
@@ -1150,7 +1150,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
                         }
                     }
                 }
-                List<PeerConnection.IceServer> iceServers = listBuilder.build();
+                final List<PeerConnection.IceServer> iceServers = listBuilder.build();
                 if (iceServers.size() == 0) {
                     Log.w(Config.LOGTAG, id.account.getJid().asBareJid() + ": no ICE server found " + response);
                 }