Fix treating the local session as a remote session when the HPB is used

When processing the participants in a room the signaling sessions of the
participants were compared against the Nextcloud session of the local
participant to find out which were the remote sessions. However, when
the HPB is used the signaling session is not the same as the Nextcloud
session, so the signaling session of the local participant never matched
her Nextcloud session, so it was always seen as a remote participant.

This caused the call state to be changed to "in conversation" (which,
for example, stopped the calling sound), when only the local participant
was in the call.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2021-04-09 13:56:57 +02:00 committed by Marcel Hibbe
parent 004c7b296a
commit 9687a9453d
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -1657,8 +1657,14 @@ public class CallController extends BaseController {
hasMCU = hasExternalSignalingServer && webSocketClient != null && webSocketClient.hasMCU(); hasMCU = hasExternalSignalingServer && webSocketClient != null && webSocketClient.hasMCU();
// The signaling session is the same as the Nextcloud session only when the MCU is not used.
String currentSessiondId = callSession;
if (hasMCU) {
currentSessiondId = webSocketClient.getSessionId();
}
for (HashMap<String, Object> participant : users) { for (HashMap<String, Object> participant : users) {
if (!participant.get("sessionId").equals(callSession)) { if (!participant.get("sessionId").equals(currentSessiondId)) {
Object inCallObject = participant.get("inCall"); Object inCallObject = participant.get("inCall");
boolean isNewSession; boolean isNewSession;
if (inCallObject instanceof Boolean) { if (inCallObject instanceof Boolean) {
@ -1695,6 +1701,11 @@ public class CallController extends BaseController {
getPeersForCall(); getPeersForCall();
} }
if (hasMCU) {
// Ensure that own publishing peer is set up.
getPeerConnectionWrapperForSessionIdAndType(webSocketClient.getSessionId(), "video", true);
}
for (String sessionId : newSessions) { for (String sessionId : newSessions) {
getPeerConnectionWrapperForSessionIdAndType(sessionId, "video", hasMCU && sessionId.equals(webSocketClient.getSessionId())); getPeerConnectionWrapperForSessionIdAndType(sessionId, "video", hasMCU && sessionId.equals(webSocketClient.getSessionId()));
} }