openvidu-server: prepare mediaNodeId property in Session entity

pull/609/head
pabloFuente 2021-02-02 18:44:20 +01:00
parent 5d21baff89
commit 7691bccdfb
2 changed files with 15 additions and 0 deletions

View File

@ -31,6 +31,8 @@ import org.kurento.client.MediaPipeline;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.google.gson.JsonObject;
import io.openvidu.client.OpenViduException; 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;
@ -334,4 +336,13 @@ public class KurentoSession extends Session {
}); });
} }
@Override
public JsonObject toJson(boolean withPendingConnections, boolean withWebrtcStats) {
JsonObject json = super.toJson(withPendingConnections, withWebrtcStats);
if (this.kms != null && this.kurentoSessionHandler.addMediaNodeInfoToSessionEntity()) {
json.addProperty("mediaNodeId", kms.getId());
}
return json;
}
} }

View File

@ -56,4 +56,8 @@ public class KurentoSessionEventsHandler extends SessionEventsHandler {
rpcNotificationService.sendNotification(connectionId, ProtocolElements.MEDIAERROR_METHOD, notifParams); rpcNotificationService.sendNotification(connectionId, ProtocolElements.MEDIAERROR_METHOD, notifParams);
} }
public boolean addMediaNodeInfoToSessionEntity() {
return false;
}
} }