openvidu-server: environmentId on mediaServerCrashed

pull/581/head
pabloFuente 2020-12-23 12:27:20 +01:00
parent c98276a196
commit b55072b394
3 changed files with 10 additions and 4 deletions

View File

@ -7,16 +7,22 @@ import io.openvidu.server.kurento.kms.Kms;
public class CDREventMediaServerCrashed extends CDREvent {
private Kms kms;
private String environmentId;
public CDREventMediaServerCrashed(CDREventName eventName, String sessionId, Long timeStamp, Kms kms) {
public CDREventMediaServerCrashed(CDREventName eventName, String sessionId, Long timeStamp, Kms kms,
String environmentId) {
super(eventName, sessionId, timeStamp);
this.kms = kms;
this.environmentId = environmentId;
}
@Override
public JsonObject toJson() {
JsonObject json = super.toJson();
json.addProperty("id", this.kms.getId());
if (this.environmentId != null) {
json.addProperty("environmentId", this.environmentId);
}
json.addProperty("ip", this.kms.getIp());
json.addProperty("uri", this.kms.getUri());
return json;

View File

@ -217,9 +217,9 @@ public class CallDetailRecord {
});
}
public void recordMediaServerCrashed(Kms kms, long timeOfKurentoDisconnection) {
public void recordMediaServerCrashed(Kms kms, String environmentId, long timeOfKurentoDisconnection) {
CDREvent e = new CDREventMediaServerCrashed(CDREventName.mediaServerCrashed, null, timeOfKurentoDisconnection,
kms);
kms, environmentId);
this.log(e);
}

View File

@ -608,7 +608,7 @@ public class SessionEventsHandler {
}
public void onMediaServerCrashed(Kms kms, long timeOfKurentoDisconnection) {
CDR.recordMediaServerCrashed(kms, timeOfKurentoDisconnection);
CDR.recordMediaServerCrashed(kms, null, timeOfKurentoDisconnection);
}
protected Set<Participant> filterParticipantsByRole(OpenViduRole[] roles, Set<Participant> participants) {