openvidu-server: WebRtcDebug event

pull/609/head
pabloFuente 2021-02-18 12:56:31 +01:00
parent 396b620e04
commit d91721c11d
1 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,42 @@
package io.openvidu.server.cdr;
import com.google.gson.JsonObject;
import io.openvidu.server.core.Participant;
public class WebrtcDebugEvent {
private Participant participant;
private String endpoint;
private String issuer; // [client, server]
private String operation; // [publish, subscribe, reconnectPublisher, reconnectSubscriber]
private String type; // [sdpOffer, mungedSdpOffer, sdpAnswer]
private String content;
private Long timestamp;
public WebrtcDebugEvent(Participant participant, String endpoint, String issuer, String operation, String type,
String content) {
this.participant = participant;
this.endpoint = endpoint;
this.issuer = issuer;
this.operation = operation;
this.type = type;
this.content = content;
this.timestamp = System.currentTimeMillis();
}
public JsonObject toJson() {
JsonObject json = new JsonObject();
json.addProperty("sessionId", participant.getSessionId());
json.addProperty("user", participant.getFinalUserId());
json.addProperty("connectionId", participant.getParticipantPublicId());
json.addProperty("endpoint", this.endpoint);
json.addProperty("issuer", this.issuer);
json.addProperty("operation", this.operation);
json.addProperty("type", this.type);
json.addProperty("content", this.content);
json.addProperty("timestamp", this.timestamp);
return json;
}
}