diff --git a/openvidu-server/src/main/java/io/openvidu/server/cdr/CDREventParticipant.java b/openvidu-server/src/main/java/io/openvidu/server/cdr/CDREventParticipant.java index 6af6545c..c76062d7 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/cdr/CDREventParticipant.java +++ b/openvidu-server/src/main/java/io/openvidu/server/cdr/CDREventParticipant.java @@ -46,8 +46,8 @@ public class CDREventParticipant extends CDREventEnd { // TODO: remove deprecated "participantId" when possible json.addProperty("participantId", this.participant.getParticipantPublicId()); json.addProperty("connectionId", this.participant.getParticipantPublicId()); - json.addProperty("location", - this.participant.getLocation() != null ? this.participant.getLocation().toString() : "unknown"); + json.addProperty("location", this.participant.getLocation().toString()); + json.addProperty("ip", this.participant.getLocation().getIp()); json.addProperty("platform", this.participant.getPlatform()); json.addProperty("clientData", this.participant.getClientMetadata()); json.addProperty("serverData", this.participant.getServerMetadata()); diff --git a/openvidu-server/src/main/java/io/openvidu/server/core/FinalUser.java b/openvidu-server/src/main/java/io/openvidu/server/core/FinalUser.java index 3abc93e5..50f246d7 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/core/FinalUser.java +++ b/openvidu-server/src/main/java/io/openvidu/server/core/FinalUser.java @@ -70,8 +70,8 @@ public class FinalUser { public JsonObject toJson() { JsonObject json = new JsonObject(); json.addProperty("id", id); - json.addProperty("ip", this.location.getIp()); json.addProperty("location", this.location.toString()); + json.addProperty("ip", this.location.getIp()); json.addProperty("platform", platform); JsonObject connectionsJson = new JsonObject(); diff --git a/openvidu-server/src/main/java/io/openvidu/server/core/Participant.java b/openvidu-server/src/main/java/io/openvidu/server/core/Participant.java index 42eac477..b060b0f7 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/core/Participant.java +++ b/openvidu-server/src/main/java/io/openvidu/server/core/Participant.java @@ -314,7 +314,8 @@ public class Participant { json.addProperty("sessionId", this.sessionId); json.addProperty("createdAt", this.token.getCreatedAt()); json.addProperty("activeAt", this.activeAt); - json.addProperty("location", this.location != null ? this.location.toString() : "unknown"); + json.addProperty("location", his.location.toString()); + json.addProperty("ip", this.location.getIp()); json.addProperty("platform", this.platform); if (this.token.getToken() != null) { json.addProperty("token", this.token.getToken()); diff --git a/openvidu-server/src/main/java/io/openvidu/server/core/Token.java b/openvidu-server/src/main/java/io/openvidu/server/core/Token.java index 4c892f56..7e1af315 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/core/Token.java +++ b/openvidu-server/src/main/java/io/openvidu/server/core/Token.java @@ -152,6 +152,7 @@ public class Token { json.addProperty("token", this.getToken()); json.add("activeAt", null); json.add("location", null); + json.add("ip", null); json.add("platform", null); json.add("clientData", null); json.add("publishers", null); diff --git a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java index 1da51f1f..7d489d8d 100644 --- a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java +++ b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java @@ -3061,9 +3061,9 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest { false, true, "{'id':'STR','object':'STR','sessionId':'STR','createdAt':0,'mediaMode':'STR','recordingMode':'STR','defaultRecordingProperties':{'hasVideo':true,'frameRate':25," + "'hasAudio':true,'shmSize':536870912,'name':'','outputMode':'COMPOSED','resolution':'1280x720','recordingLayout':'BEST_FIT'},'customSessionId':'STR','connections':{'numberOfElements':2,'content'" - + ":[{'connectionId':'STR','createdAt':0,'location':'STR','platform':'STR','token':'STR','role':'STR','serverData':'STR','clientData':'STR','publishers':[" + + ":[{'connectionId':'STR','createdAt':0,'location':'STR','ip':'STR','platform':'STR','token':'STR','role':'STR','serverData':'STR','clientData':'STR','publishers':[" + "{'createdAt':0,'streamId':'STR','mediaOptions':{'hasAudio':false,'audioActive':false,'hasVideo':false,'videoActive':false,'typeOfVideo':'STR','frameRate':0," - + "'videoDimensions':'STR','filter':{}}}],'subscribers':[{'createdAt':0,'streamId':'STR','publisher':'STR'}]},{'connectionId':'STR','createdAt':0,'location':'STR'," + + "'videoDimensions':'STR','filter':{}}}],'subscribers':[{'createdAt':0,'streamId':'STR','publisher':'STR'}]},{'connectionId':'STR','createdAt':0,'location':'STR','ip':'STR'," + "'platform':'STR','token':'STR','role':'STR','serverData':'STR','clientData':'STR','publishers':[{'createdAt':0,'streamId':'STR','mediaOptions':{'hasAudio':false," + "'audioActive':false,'hasVideo':false,'videoActive':false,'typeOfVideo':'STR','frameRate':0,'videoDimensions':'STR','filter':{}}}],'subscribers':[{'createdAt':0,'streamId':'STR','publisher':'STR'}]}]}," + "'recording':false,'forcedVideoCodec':'STR','allowTranscoding':false}"); @@ -3949,6 +3949,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest { connectionJson.get("createdAt").getAsLong() > timestamp); Assert.assertTrue("Wrong activeAt Connection property", connectionJson.get("activeAt").isJsonNull()); Assert.assertTrue("Wrong location Connection property", connectionJson.get("location").isJsonNull()); + Assert.assertTrue("Wrong ip Connection property", connectionJson.get("ip").isJsonNull()); Assert.assertTrue("Wrong platform Connection property", connectionJson.get("platform").isJsonNull()); Assert.assertTrue("Wrong clientData Connection property", connectionJson.get("clientData").isJsonNull()); Assert.assertTrue("Wrong publishers Connection property",