jingle: do not send session-terminate after failed regneg when session already was

This commit is contained in:
Daniel Gultsch 2023-10-31 13:16:17 +01:00
parent 438a228fc3
commit 0898ea77ff
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -2007,7 +2007,6 @@ public class JingleRtpConnection extends AbstractJingleConnection
final JinglePacket jinglePacket =
new JinglePacket(JinglePacket.Action.SESSION_TERMINATE, id.sessionId);
jinglePacket.setReason(reason, text);
Log.d(Config.LOGTAG, jinglePacket.toString());
send(jinglePacket);
finish();
}
@ -2577,8 +2576,12 @@ public class JingleRtpConnection extends AbstractJingleConnection
sessionDescription = setLocalSessionDescription();
} catch (final Exception e) {
final Throwable cause = Throwables.getRootCause(e);
Log.d(Config.LOGTAG, "failed to renegotiate", cause);
webRTCWrapper.close();
if (isTerminated()) {
Log.d(Config.LOGTAG, "failed to renegotiate. session was already terminated", cause);
return;
}
Log.d(Config.LOGTAG, "failed to renegotiate. sending session-terminate", cause);
sendSessionTerminate(Reason.FAILED_APPLICATION, cause.getMessage());
return;
}