terminate with application failure when failing to apply ICE restart

This is fairly unlikely to happen in practice
This commit is contained in:
Daniel Gultsch 2021-11-15 17:18:43 +01:00
parent 3f402b132b
commit 0a3947b8e3
1 changed files with 11 additions and 8 deletions

View File

@ -319,14 +319,17 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
respondWithTieBreak(jinglePacket);
return true;
}
} catch (Exception e) {
Log.d(Config.LOGTAG, "failure to apply ICE restart. sending error", e);
//TODO respond OK and then terminate session
} catch (final Exception exception) {
respondOk(jinglePacket);
final Throwable rootCause = Throwables.getRootCause(exception);
Log.d(Config.LOGTAG, "failure to apply ICE restart", rootCause);
webRTCWrapper.close();
sendSessionTerminate(Reason.ofThrowable(rootCause), rootCause.getMessage());
return true;
}
}
private boolean applyIceRestart(final JinglePacket jinglePacket, final RtpContentMap restartContentMap, final boolean isOffer) throws ExecutionException, InterruptedException {
private boolean applyIceRestart(final JinglePacket jinglePacket, final RtpContentMap restartContentMap, final boolean isOffer) throws ExecutionException, InterruptedException {
final SessionDescription sessionDescription = SessionDescription.of(restartContentMap);
final org.webrtc.SessionDescription.Type type = isOffer ? org.webrtc.SessionDescription.Type.OFFER : org.webrtc.SessionDescription.Type.ANSWER;
org.webrtc.SessionDescription sdp = new org.webrtc.SessionDescription(type, sessionDescription.toString());
@ -574,7 +577,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
} catch (final Exception e) {
Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": unable to set remote description after receiving session-accept", Throwables.getRootCause(e));
webRTCWrapper.close();
sendSessionTerminate(Reason.FAILED_APPLICATION);
sendSessionTerminate(Reason.FAILED_APPLICATION, Throwables.getRootCause(e).getMessage());
return;
}
processCandidates(contentMap.contents.entrySet());
@ -624,7 +627,6 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
org.webrtc.SessionDescription webRTCSessionDescription = this.webRTCWrapper.setLocalDescription().get();
prepareSessionAccept(webRTCSessionDescription);
} catch (final Exception e) {
//TODO sending the error text is worthwhile as well. Especially for FailureToSet exceptions
failureToAcceptSession(e);
}
}
@ -633,9 +635,10 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
if (isTerminated()) {
return;
}
Log.d(Config.LOGTAG, "unable to send session accept", Throwables.getRootCause(throwable));
final Throwable rootCause = Throwables.getRootCause(throwable);
Log.d(Config.LOGTAG, "unable to send session accept", rootCause);
webRTCWrapper.close();
sendSessionTerminate(Reason.ofThrowable(throwable));
sendSessionTerminate(Reason.ofThrowable(rootCause), rootCause.getMessage());
}
private void addIceCandidatesFromBlackLog() {