mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: fix lack of media_node_id to ELK summaries
parent
773bb11e1b
commit
f503d5006b
|
@ -32,10 +32,10 @@ public class CDREventSession extends CDREventEnd {
|
||||||
}
|
}
|
||||||
|
|
||||||
// sessionDestroyed
|
// sessionDestroyed
|
||||||
public CDREventSession(CDREventSession event, EndReason reason, Long timestamp) {
|
public CDREventSession(CDREventSession event, Session session, EndReason reason, Long timestamp) {
|
||||||
super(CDREventName.sessionDestroyed, event.getSessionId(), event.getUniqueSessionId(), event.getTimestamp(),
|
super(CDREventName.sessionDestroyed, event.getSessionId(), event.getUniqueSessionId(), event.getTimestamp(),
|
||||||
reason, timestamp);
|
reason, timestamp);
|
||||||
this.session = event.session;
|
this.session = session;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Session getSession() {
|
public Session getSession() {
|
||||||
|
|
|
@ -74,10 +74,11 @@ public class CallDetailRecord {
|
||||||
this.log(e);
|
this.log(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void recordSessionDestroyed(String sessionId, EndReason reason) {
|
public void recordSessionDestroyed(Session session, EndReason reason) {
|
||||||
|
String sessionId = session.getSessionId();
|
||||||
CDREventSession e = this.sessions.remove(sessionId);
|
CDREventSession e = this.sessions.remove(sessionId);
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
CDREventSession eventSessionEnd = new CDREventSession(e, RecordingManager.finalReason(reason),
|
CDREventSession eventSessionEnd = new CDREventSession(e, session, RecordingManager.finalReason(reason),
|
||||||
System.currentTimeMillis());
|
System.currentTimeMillis());
|
||||||
this.log(eventSessionEnd);
|
this.log(eventSessionEnd);
|
||||||
|
|
||||||
|
|
|
@ -71,8 +71,8 @@ public class SessionEventsHandler {
|
||||||
CDR.recordSessionCreated(session);
|
CDR.recordSessionCreated(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSessionClosed(String sessionId, EndReason reason) {
|
public void onSessionClosed(Session session, EndReason reason) {
|
||||||
CDR.recordSessionDestroyed(sessionId, reason);
|
CDR.recordSessionDestroyed(session, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onParticipantJoined(Participant participant, String sessionId, Set<Participant> existingParticipants,
|
public void onParticipantJoined(Participant participant, String sessionId, Set<Participant> existingParticipants,
|
||||||
|
|
|
@ -19,8 +19,8 @@ package io.openvidu.server.core;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -48,11 +48,11 @@ import io.openvidu.client.OpenViduException;
|
||||||
import io.openvidu.client.OpenViduException.Code;
|
import io.openvidu.client.OpenViduException.Code;
|
||||||
import io.openvidu.client.internal.ProtocolElements;
|
import io.openvidu.client.internal.ProtocolElements;
|
||||||
import io.openvidu.java.client.ConnectionProperties;
|
import io.openvidu.java.client.ConnectionProperties;
|
||||||
|
import io.openvidu.java.client.IceServerProperties;
|
||||||
import io.openvidu.java.client.KurentoOptions;
|
import io.openvidu.java.client.KurentoOptions;
|
||||||
import io.openvidu.java.client.OpenViduRole;
|
import io.openvidu.java.client.OpenViduRole;
|
||||||
import io.openvidu.java.client.Recording;
|
import io.openvidu.java.client.Recording;
|
||||||
import io.openvidu.java.client.SessionProperties;
|
import io.openvidu.java.client.SessionProperties;
|
||||||
import io.openvidu.java.client.IceServerProperties;
|
|
||||||
import io.openvidu.server.cdr.CDREventRecordingStatusChanged;
|
import io.openvidu.server.cdr.CDREventRecordingStatusChanged;
|
||||||
import io.openvidu.server.config.OpenviduConfig;
|
import io.openvidu.server.config.OpenviduConfig;
|
||||||
import io.openvidu.server.coturn.CoturnCredentialsService;
|
import io.openvidu.server.coturn.CoturnCredentialsService;
|
||||||
|
@ -344,7 +344,8 @@ public abstract class SessionManager {
|
||||||
try {
|
try {
|
||||||
JsonObject serverMetadataJson = JsonParser.parseString(serverMetadata).getAsJsonObject();
|
JsonObject serverMetadataJson = JsonParser.parseString(serverMetadata).getAsJsonObject();
|
||||||
String customConnectionId = serverMetadataJson.get("openviduCustomConnectionId").getAsString();
|
String customConnectionId = serverMetadataJson.get("openviduCustomConnectionId").getAsString();
|
||||||
customConnectionId = customConnectionId.replaceAll("\\W", ""); // Remove all non-word characters: [^A-Za-z0-9_]
|
// Remove all non-word characters: [^A-Za-z0-9_]
|
||||||
|
customConnectionId = customConnectionId.replaceAll("\\W", "");
|
||||||
customConnectionId = customConnectionId.replaceAll(IdentifierPrefixes.PARTICIPANT_PUBLIC_ID, "");
|
customConnectionId = customConnectionId.replaceAll(IdentifierPrefixes.PARTICIPANT_PUBLIC_ID, "");
|
||||||
tokenObj.setConnectionId(IdentifierPrefixes.PARTICIPANT_PUBLIC_ID + customConnectionId);
|
tokenObj.setConnectionId(IdentifierPrefixes.PARTICIPANT_PUBLIC_ID + customConnectionId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -634,7 +635,7 @@ public abstract class SessionManager {
|
||||||
|
|
||||||
if (session.close(reason)) {
|
if (session.close(reason)) {
|
||||||
try {
|
try {
|
||||||
sessionEventsHandler.onSessionClosed(session.getSessionId(), reason);
|
sessionEventsHandler.onSessionClosed(session, reason);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Error recording 'sessionDestroyed' event for session {}: {} - {}", session.getSessionId(),
|
log.error("Error recording 'sessionDestroyed' event for session {}: {} - {}", session.getSessionId(),
|
||||||
e.getClass().getName(), e.getMessage());
|
e.getClass().getName(), e.getMessage());
|
||||||
|
|
Loading…
Reference in New Issue