From c017d4744054ae9a7231664d206c0d65de98ba1e Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Tue, 14 Apr 2020 13:35:50 +0200 Subject: [PATCH 1/9] openvidu.io/docs/ to docs.openvidu.io/en/stable/ --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- openvidu-server/README.md | 4 ++-- openvidu-server/docker/openvidu-docker-compose/.env | 2 +- openvidu-server/docker/openvidu-docker-compose/readme.md | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 5e950306..221764ef 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -36,7 +36,7 @@ This is an EXTREMELY IMPORTANT STEP. If we are able to replicate the error in an **OpenVidu deployment info** How is your OpenVidu Server instance deployed when you get the bug. A couple of possible examples are listed below: - Docker container as explained in OpenVidu tutorials, run with command `docker run ...` on macOS Catalina 10.15.1 -- AWS deployment as explained in OpenVidu Docs (https://openvidu.io/docs/deployment/deploying-aws/) +- AWS deployment as explained in OpenVidu Docs (https://docs.openvidu.io/en/stable/deployment/deploying-aws/) > **IMPORTANT NOTE**: please, if you think the bug might be related to OpenVidu Server side, specify here if you are also getting the error by using OpenVidu Server Demos instance. This instance is publicly available (use it only for this test, because it is not secure!!!): **URL**: `https://demos.openvidu.io:4443`, **SECRET**: `MY_SECRET` diff --git a/openvidu-server/README.md b/openvidu-server/README.md index bff814e0..511f34e8 100644 --- a/openvidu-server/README.md +++ b/openvidu-server/README.md @@ -10,8 +10,8 @@ openvidu-server - **Description**: OpenVidu server side. It receives the remote procedure calls from openvidu-browser and manage all the media streams operations. You don't have to make direct use of it. Just to run it. -- **Docs**: [REST API](https://openvidu.io/docs/reference-docs/REST-API/) +- **Docs**: [REST API](https://docs.openvidu.io/en/stable/reference-docs/REST-API/) -- **Release**: [OpenVidu Artifacts](https://openvidu.io/docs/releases/) +- **Release**: [OpenVidu Artifacts](https://docs.openvidu.io/en/stable/releases/) [OpenViduLogo]: https://secure.gravatar.com/avatar/5daba1d43042f2e4e85849733c8e5702?s=120 diff --git a/openvidu-server/docker/openvidu-docker-compose/.env b/openvidu-server/docker/openvidu-docker-compose/.env index ce7c8632..c673d072 100644 --- a/openvidu-server/docker/openvidu-docker-compose/.env +++ b/openvidu-server/docker/openvidu-docker-compose/.env @@ -1,6 +1,6 @@ # OpenVidu configuration # ---------------------- -# Documentation: https://openvidu.io/docs/reference-docs/openvidu-server-params/ +# Documentation: https://docs.openvidu.io/en/stable/reference-docs/openvidu-server-params/ # NOTE: This file doesn't need to quote assignment values, like most shells do. # All values are stored as-is, even if they contain spaces, so don't quote them. diff --git a/openvidu-server/docker/openvidu-docker-compose/readme.md b/openvidu-server/docker/openvidu-docker-compose/readme.md index 52287051..ac8f3c9a 100644 --- a/openvidu-server/docker/openvidu-docker-compose/readme.md +++ b/openvidu-server/docker/openvidu-docker-compose/readme.md @@ -76,7 +76,7 @@ The `.env` file looks like this: ``` # OpenVidu configuration # ---------------------- -# Documentation: https://openvidu.io/docs/reference-docs/openvidu-server-params/ +# Documentation: https://docs.openvidu.io/en/stable/reference-docs/openvidu-server-params/ # NOTE: This file doesn't need to quote assignment values, like most shells do. # All values are stored as-is, even if they contain spaces, so don't quote them. @@ -112,7 +112,7 @@ LETSENCRYPT_EMAIL=user@example.com ### Videoconference application -By default, the [OpenVidu Call application](https://openvidu.io/docs/demos/openvidu-call/) is deployed alongside OpenVide Platform. It is accesible in the URL: +By default, the [OpenVidu Call application](https://docs.openvidu.io/en/stable/demos/openvidu-call/) is deployed alongside OpenVide Platform. It is accesible in the URL: ``` https://openvidu_domain_or_public_ip/ From 46b8ebb1ea3e1f224fa6fad24d2692d5b579f98e Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Tue, 14 Apr 2020 14:05:01 +0200 Subject: [PATCH 2/9] Docker config files unnecessary new line removed --- openvidu-server/docker/openvidu-docker-compose/.env | 3 +-- openvidu-server/docker/openvidu-docker-compose/readme.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/openvidu-server/docker/openvidu-docker-compose/.env b/openvidu-server/docker/openvidu-docker-compose/.env index c673d072..9bcc8f5c 100644 --- a/openvidu-server/docker/openvidu-docker-compose/.env +++ b/openvidu-server/docker/openvidu-docker-compose/.env @@ -23,8 +23,7 @@ OPENVIDU_SECRET= # variable. CERTIFICATE_TYPE=selfsigned -# If CERTIFICATE_TYPE=letsencrypt, you need to configure a valid email for -# notifications +# If CERTIFICATE_TYPE=letsencrypt, you need to configure a valid email for notifications LETSENCRYPT_EMAIL=user@example.com # Parameter "openvidu.recording.path" diff --git a/openvidu-server/docker/openvidu-docker-compose/readme.md b/openvidu-server/docker/openvidu-docker-compose/readme.md index ac8f3c9a..a3f25f4d 100644 --- a/openvidu-server/docker/openvidu-docker-compose/readme.md +++ b/openvidu-server/docker/openvidu-docker-compose/readme.md @@ -99,8 +99,7 @@ OPENVIDU_SECRET= # variable. CERTIFICATE_TYPE=selfsigned -# If CERTIFICATE_TYPE=letsencrypt, you need to configure a valid email for -# notifications +# If CERTIFICATE_TYPE=letsencrypt, you need to configure a valid email for notifications LETSENCRYPT_EMAIL=user@example.com ... From c6dc889e4d586682152695efdd32240da53ea7d9 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Tue, 14 Apr 2020 14:21:18 +0200 Subject: [PATCH 3/9] Typo fixed --- .../docker/openvidu-docker-compose/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvidu-server/docker/openvidu-docker-compose/docker-compose.yml b/openvidu-server/docker/openvidu-docker-compose/docker-compose.yml index 5d7b164d..02ae7312 100644 --- a/openvidu-server/docker/openvidu-docker-compose/docker-compose.yml +++ b/openvidu-server/docker/openvidu-docker-compose/docker-compose.yml @@ -7,7 +7,7 @@ # Application based on OpenVidu should be specified in # docker-compose.override.yml file # -# This docker-compose file coordinates all services of OpenVidu CE Plarform. +# This docker-compose file coordinates all services of OpenVidu CE Platform. # # This file will be overridden when update OpenVidu Platform # From 60a414c7913c012f864bccff1765b5a2dbaab5ab Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Tue, 14 Apr 2020 14:27:36 +0200 Subject: [PATCH 4/9] Docker owncert files location updated --- openvidu-server/docker/openvidu-docker-compose/.env | 4 ++-- openvidu-server/docker/openvidu-docker-compose/readme.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openvidu-server/docker/openvidu-docker-compose/.env b/openvidu-server/docker/openvidu-docker-compose/.env index 9bcc8f5c..64aa80bd 100644 --- a/openvidu-server/docker/openvidu-docker-compose/.env +++ b/openvidu-server/docker/openvidu-docker-compose/.env @@ -16,8 +16,8 @@ OPENVIDU_SECRET= # - selfsigned: Self signed certificate. Not recommended for production use. # Users will see an ERROR when connected to web page. # - owncert: Valid certificate purchased in a Internet services company. -# Please put the certificates in same folder as docker-compose.yml -# file with names certificate.key and certificate.cert. +# Please put the certificates files inside folder ./owncert +# with names certificate.key and certificate.cert # - letsencrypt: Generate a new certificate using letsencrypt. Please set the # required contact email for Let's Encrypt in LETSENCRYPT_EMAIL # variable. diff --git a/openvidu-server/docker/openvidu-docker-compose/readme.md b/openvidu-server/docker/openvidu-docker-compose/readme.md index a3f25f4d..3817c4de 100644 --- a/openvidu-server/docker/openvidu-docker-compose/readme.md +++ b/openvidu-server/docker/openvidu-docker-compose/readme.md @@ -92,8 +92,8 @@ OPENVIDU_SECRET= # - selfsigned: Self signed certificate. Not recommended for production use. # Users will see an ERROR when connected to web page. # - owncert: Valid certificate purchased in a Internet services company. -# Please put the certificates in same folder as docker-compose.yml -# file with names certificate.key and certificate.cert. +# Please put the certificates files inside folder ./owncert +# with names certificate.key and certificate.cert # - letsencrypt: Generate a new certificate using letsencrypt. Please set the # required contact email for Let's Encrypt in LETSENCRYPT_EMAIL # variable. From 4c50f84b7ddfca56555fe5f5685a4a4ffca1e176 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Tue, 14 Apr 2020 21:30:21 +0200 Subject: [PATCH 5/9] openvidu-server: get remote SDP of MediaEndpoint inside try-catch --- .../server/kurento/endpoint/MediaEndpoint.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openvidu-server/src/main/java/io/openvidu/server/kurento/endpoint/MediaEndpoint.java b/openvidu-server/src/main/java/io/openvidu/server/kurento/endpoint/MediaEndpoint.java index 7ccceb2e..eab45ca5 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/kurento/endpoint/MediaEndpoint.java +++ b/openvidu-server/src/main/java/io/openvidu/server/kurento/endpoint/MediaEndpoint.java @@ -38,11 +38,13 @@ import org.kurento.client.PlayerEndpoint; import org.kurento.client.RtpEndpoint; import org.kurento.client.SdpEndpoint; import org.kurento.client.WebRtcEndpoint; +import org.kurento.client.internal.server.KurentoServerException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; import io.openvidu.client.OpenViduException; @@ -536,7 +538,13 @@ public abstract class MediaEndpoint { json.addProperty("createdAt", this.createdAt); json.addProperty("webrtcEndpointName", this.getEndpointName()); if (!this.isPlayerEndpoint()) { - json.addProperty("remoteSdp", ((SdpEndpoint) this.getEndpoint()).getRemoteSessionDescriptor()); + try { + json.addProperty("remoteSdp", ((SdpEndpoint) this.getEndpoint()).getRemoteSessionDescriptor()); + } catch (KurentoServerException e) { + log.error("Error retrieving remote SDP for endpoint {} of stream {}: {}", this.endpointName, + this.streamId, e.getMessage()); + json.add("remoteSdp", JsonNull.INSTANCE); + } json.addProperty("localSdp", ((SdpEndpoint) this.getEndpoint()).getLocalSessionDescriptor()); } json.add("receivedCandidates", new GsonBuilder().create().toJsonTree(this.receivedCandidateList)); From 74e7943e2636302764bf1daca67287146a5a6f4f Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Tue, 14 Apr 2020 21:33:17 +0200 Subject: [PATCH 6/9] openvidu-server: ParticipantSummary protection against lack of participantLeft event --- .../server/summary/ParticipantSummary.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/openvidu-server/src/main/java/io/openvidu/server/summary/ParticipantSummary.java b/openvidu-server/src/main/java/io/openvidu/server/summary/ParticipantSummary.java index f4627a78..2fa00963 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/summary/ParticipantSummary.java +++ b/openvidu-server/src/main/java/io/openvidu/server/summary/ParticipantSummary.java @@ -20,6 +20,9 @@ package io.openvidu.server.summary; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.google.gson.JsonArray; import com.google.gson.JsonObject; @@ -29,6 +32,8 @@ import io.openvidu.server.core.Participant; public class ParticipantSummary { + private static final Logger log = LoggerFactory.getLogger(ParticipantSummary.class); + private CDREventParticipant eventParticipantEnd; private Map publishers = new ConcurrentHashMap<>(); private Map subscribers = new ConcurrentHashMap<>(); @@ -53,20 +58,26 @@ public class ParticipantSummary { public JsonObject toJson() { JsonObject json = new JsonObject(); + Participant p = this.eventParticipantEnd.getParticipant(); - json.addProperty("createdAt", this.eventParticipantEnd.getStartTime()); + Long START_TIME = this.eventParticipantEnd.getStartTime(); + if (START_TIME == null) { + log.error("Participant {} startTime is not defined", p.getParticipantPublicId()); + log.error("Setting startTime to (endTime-1)", p.getParticipantPublicId()); + START_TIME = this.eventParticipantEnd.getTimestamp() - 1; + } + json.addProperty("createdAt", START_TIME); json.addProperty("destroyedAt", this.eventParticipantEnd.getTimestamp()); - Participant p = this.eventParticipantEnd.getParticipant(); json.addProperty("connectionId", p.getParticipantPublicId()); json.addProperty("clientData", p.getClientMetadata()); json.addProperty("serverData", p.getServerMetadata()); - long duration = (this.eventParticipantEnd.getTimestamp() - this.eventParticipantEnd.getStartTime()) / 1000; + long duration = (this.eventParticipantEnd.getTimestamp() - START_TIME) / 1000; json.addProperty("duration", duration); json.addProperty("reason", - this.eventParticipantEnd.getReason().name() != null ? this.eventParticipantEnd.getReason().name() : ""); + this.eventParticipantEnd.getReason() != null ? this.eventParticipantEnd.getReason().name() : "NULL"); // Publishers summary JsonObject publishersJson = new JsonObject(); From 2fe2cbf9c46ad2ceb19a72eea422dceeb3ba78b1 Mon Sep 17 00:00:00 2001 From: Rafael Renan Pacheco Date: Tue, 14 Apr 2020 16:34:34 -0300 Subject: [PATCH 7/9] Add generic OpenVidu exception --- .gitignore | 2 ++ openvidu-java-client/pom.xml | 2 +- .../java/client/OpenViduException.java | 33 +++++++++++++++++++ .../java/client/OpenViduHttpException.java | 2 +- .../client/OpenViduJavaClientException.java | 2 +- .../client/OpenViduHttpExceptionTest.java | 11 +++++++ .../OpenViduJavaClientExceptionTest.java | 11 +++++++ 7 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduException.java create mode 100644 openvidu-java-client/src/test/java/io/openvidu/java/client/OpenViduHttpExceptionTest.java create mode 100644 openvidu-java-client/src/test/java/io/openvidu/java/client/OpenViduJavaClientExceptionTest.java diff --git a/.gitignore b/.gitignore index ef7a2314..965d733d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,10 @@ /target .classpath +.idea .project .settings +*.iml *orig .springBeans *tmp/ diff --git a/openvidu-java-client/pom.xml b/openvidu-java-client/pom.xml index 84623107..20234606 100644 --- a/openvidu-java-client/pom.xml +++ b/openvidu-java-client/pom.xml @@ -10,7 +10,7 @@ openvidu-java-client - 2.12.1 + 2.13.0 jar OpenVidu Java Client diff --git a/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduException.java b/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduException.java new file mode 100644 index 00000000..2e828540 --- /dev/null +++ b/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduException.java @@ -0,0 +1,33 @@ +/* + * (C) Copyright 2017-2020 OpenVidu (https://openvidu.io) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package io.openvidu.java.client; + +/** + * Defines a generic OpenVidu exception + */ +public class OpenViduException extends Exception { + + protected OpenViduException(String message) { + super(message); + } + + protected OpenViduException(String message, Throwable cause) { + super(message, cause); + } + +} diff --git a/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduHttpException.java b/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduHttpException.java index bec440cd..31bb86fd 100644 --- a/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduHttpException.java +++ b/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduHttpException.java @@ -20,7 +20,7 @@ package io.openvidu.java.client; /** * Defines error responses from OpenVidu Server */ -public class OpenViduHttpException extends Exception { +public class OpenViduHttpException extends OpenViduException { private static final long serialVersionUID = 1L; private int status; diff --git a/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduJavaClientException.java b/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduJavaClientException.java index aa8307a2..7c3f8734 100644 --- a/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduJavaClientException.java +++ b/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduJavaClientException.java @@ -20,7 +20,7 @@ package io.openvidu.java.client; /** * Defines unexpected internal errors in OpenVidu Java Client */ -public class OpenViduJavaClientException extends Exception { +public class OpenViduJavaClientException extends OpenViduException { private static final long serialVersionUID = 1L; diff --git a/openvidu-java-client/src/test/java/io/openvidu/java/client/OpenViduHttpExceptionTest.java b/openvidu-java-client/src/test/java/io/openvidu/java/client/OpenViduHttpExceptionTest.java new file mode 100644 index 00000000..15c5d6a4 --- /dev/null +++ b/openvidu-java-client/src/test/java/io/openvidu/java/client/OpenViduHttpExceptionTest.java @@ -0,0 +1,11 @@ +package io.openvidu.java.client; + +import org.junit.Test; + +public class OpenViduHttpExceptionTest { + + @Test(expected = OpenViduException.class) + public void shouldThrowGenericOpenViduException() throws OpenViduHttpException { + throw new OpenViduHttpException(401); + } +} diff --git a/openvidu-java-client/src/test/java/io/openvidu/java/client/OpenViduJavaClientExceptionTest.java b/openvidu-java-client/src/test/java/io/openvidu/java/client/OpenViduJavaClientExceptionTest.java new file mode 100644 index 00000000..23ce0c10 --- /dev/null +++ b/openvidu-java-client/src/test/java/io/openvidu/java/client/OpenViduJavaClientExceptionTest.java @@ -0,0 +1,11 @@ +package io.openvidu.java.client; + +import org.junit.Test; + +public class OpenViduJavaClientExceptionTest { + + @Test(expected = OpenViduException.class) + public void shouldThrowGenericOpenViduException() throws OpenViduJavaClientException { + throw new OpenViduJavaClientException("message"); + } +} From f299c9a77bf469be9d54a1c190679c8e762f087c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Fuente=20P=C3=A9rez?= Date: Wed, 15 Apr 2020 11:04:59 +0200 Subject: [PATCH 8/9] Update pom.xml --- openvidu-java-client/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvidu-java-client/pom.xml b/openvidu-java-client/pom.xml index 20234606..84623107 100644 --- a/openvidu-java-client/pom.xml +++ b/openvidu-java-client/pom.xml @@ -10,7 +10,7 @@ openvidu-java-client - 2.13.0 + 2.12.1 jar OpenVidu Java Client From ffe0b49a38f00e38e77149587263347d8509a1fd Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Wed, 15 Apr 2020 11:31:34 +0200 Subject: [PATCH 9/9] openvidu-java-client: add default serial ID to OpenViduException --- .../main/java/io/openvidu/java/client/OpenViduException.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduException.java b/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduException.java index 2e828540..b4bd1cdb 100644 --- a/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduException.java +++ b/openvidu-java-client/src/main/java/io/openvidu/java/client/OpenViduException.java @@ -22,6 +22,8 @@ package io.openvidu.java.client; */ public class OpenViduException extends Exception { + private static final long serialVersionUID = 1L; + protected OpenViduException(String message) { super(message); }