avoid double termination after failed connection

This commit is contained in:
Daniel Gultsch 2020-04-21 22:59:54 +02:00
parent e0cb127005
commit 876b1149d5
1 changed files with 7 additions and 1 deletions

View File

@ -958,7 +958,13 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
private void closeWebRTCSessionAfterFailedConnection() {
this.webRTCWrapper.close();
sendSessionTerminate(Reason.CONNECTIVITY_ERROR);
synchronized (this) {
if (TERMINATED.contains(state)) {
Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": no need to send session-terminate after failed connection. Other party already did");
return;
}
sendSessionTerminate(Reason.CONNECTIVITY_ERROR);
}
}
public AppRTCAudioManager getAudioManager() {