Merge branch 'master' of github.com:OpenVidu/openvidu

pull/437/head
OscarSotoSanchez 2020-04-15 13:42:25 +02:00
commit 67b4ff9da1
13 changed files with 98 additions and 22 deletions

View File

@ -36,7 +36,7 @@ This is an EXTREMELY IMPORTANT STEP. If we are able to replicate the error in an
**OpenVidu deployment info** **OpenVidu deployment info**
How is your OpenVidu Server instance deployed when you get the bug. A couple of possible examples are listed below: 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 - 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` > **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`

2
.gitignore vendored
View File

@ -4,8 +4,10 @@
/target /target
.classpath .classpath
.idea
.project .project
.settings .settings
*.iml
*orig *orig
.springBeans .springBeans
*tmp/ *tmp/

View File

@ -0,0 +1,35 @@
/*
* (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 {
private static final long serialVersionUID = 1L;
protected OpenViduException(String message) {
super(message);
}
protected OpenViduException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -20,7 +20,7 @@ package io.openvidu.java.client;
/** /**
* Defines error responses from OpenVidu Server * Defines error responses from OpenVidu Server
*/ */
public class OpenViduHttpException extends Exception { public class OpenViduHttpException extends OpenViduException {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private int status; private int status;

View File

@ -20,7 +20,7 @@ package io.openvidu.java.client;
/** /**
* Defines unexpected internal errors in 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; private static final long serialVersionUID = 1L;

View File

@ -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);
}
}

View File

@ -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");
}
}

View File

@ -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. - **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 [OpenViduLogo]: https://secure.gravatar.com/avatar/5daba1d43042f2e4e85849733c8e5702?s=120

View File

@ -1,6 +1,6 @@
# OpenVidu configuration # 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. # 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. # All values are stored as-is, even if they contain spaces, so don't quote them.
@ -16,15 +16,14 @@ OPENVIDU_SECRET=
# - selfsigned: Self signed certificate. Not recommended for production use. # - selfsigned: Self signed certificate. Not recommended for production use.
# Users will see an ERROR when connected to web page. # Users will see an ERROR when connected to web page.
# - owncert: Valid certificate purchased in a Internet services company. # - owncert: Valid certificate purchased in a Internet services company.
# Please put the certificates in same folder as docker-compose.yml # Please put the certificates files inside folder ./owncert
# file with names certificate.key and certificate.cert. # with names certificate.key and certificate.cert
# - letsencrypt: Generate a new certificate using letsencrypt. Please set the # - letsencrypt: Generate a new certificate using letsencrypt. Please set the
# required contact email for Let's Encrypt in LETSENCRYPT_EMAIL # required contact email for Let's Encrypt in LETSENCRYPT_EMAIL
# variable. # variable.
CERTIFICATE_TYPE=selfsigned CERTIFICATE_TYPE=selfsigned
# If CERTIFICATE_TYPE=letsencrypt, you need to configure a valid email for # If CERTIFICATE_TYPE=letsencrypt, you need to configure a valid email for notifications
# notifications
LETSENCRYPT_EMAIL=user@example.com LETSENCRYPT_EMAIL=user@example.com
# Parameter "openvidu.recording.path" # Parameter "openvidu.recording.path"

View File

@ -7,7 +7,7 @@
# Application based on OpenVidu should be specified in # Application based on OpenVidu should be specified in
# docker-compose.override.yml file # 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 # This file will be overridden when update OpenVidu Platform
# #

View File

@ -76,7 +76,7 @@ The `.env` file looks like this:
``` ```
# OpenVidu configuration # 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. # 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. # All values are stored as-is, even if they contain spaces, so don't quote them.
@ -92,15 +92,14 @@ OPENVIDU_SECRET=
# - selfsigned: Self signed certificate. Not recommended for production use. # - selfsigned: Self signed certificate. Not recommended for production use.
# Users will see an ERROR when connected to web page. # Users will see an ERROR when connected to web page.
# - owncert: Valid certificate purchased in a Internet services company. # - owncert: Valid certificate purchased in a Internet services company.
# Please put the certificates in same folder as docker-compose.yml # Please put the certificates files inside folder ./owncert
# file with names certificate.key and certificate.cert. # with names certificate.key and certificate.cert
# - letsencrypt: Generate a new certificate using letsencrypt. Please set the # - letsencrypt: Generate a new certificate using letsencrypt. Please set the
# required contact email for Let's Encrypt in LETSENCRYPT_EMAIL # required contact email for Let's Encrypt in LETSENCRYPT_EMAIL
# variable. # variable.
CERTIFICATE_TYPE=selfsigned CERTIFICATE_TYPE=selfsigned
# If CERTIFICATE_TYPE=letsencrypt, you need to configure a valid email for # If CERTIFICATE_TYPE=letsencrypt, you need to configure a valid email for notifications
# notifications
LETSENCRYPT_EMAIL=user@example.com LETSENCRYPT_EMAIL=user@example.com
... ...
@ -112,7 +111,7 @@ LETSENCRYPT_EMAIL=user@example.com
### Videoconference application ### 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/ https://openvidu_domain_or_public_ip/

View File

@ -38,11 +38,13 @@ import org.kurento.client.PlayerEndpoint;
import org.kurento.client.RtpEndpoint; import org.kurento.client.RtpEndpoint;
import org.kurento.client.SdpEndpoint; import org.kurento.client.SdpEndpoint;
import org.kurento.client.WebRtcEndpoint; import org.kurento.client.WebRtcEndpoint;
import org.kurento.client.internal.server.KurentoServerException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonNull;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import io.openvidu.client.OpenViduException; import io.openvidu.client.OpenViduException;
@ -536,7 +538,13 @@ public abstract class MediaEndpoint {
json.addProperty("createdAt", this.createdAt); json.addProperty("createdAt", this.createdAt);
json.addProperty("webrtcEndpointName", this.getEndpointName()); json.addProperty("webrtcEndpointName", this.getEndpointName());
if (!this.isPlayerEndpoint()) { if (!this.isPlayerEndpoint()) {
try {
json.addProperty("remoteSdp", ((SdpEndpoint) this.getEndpoint()).getRemoteSessionDescriptor()); 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.addProperty("localSdp", ((SdpEndpoint) this.getEndpoint()).getLocalSessionDescriptor());
} }
json.add("receivedCandidates", new GsonBuilder().create().toJsonTree(this.receivedCandidateList)); json.add("receivedCandidates", new GsonBuilder().create().toJsonTree(this.receivedCandidateList));

View File

@ -20,6 +20,9 @@ package io.openvidu.server.summary;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
@ -29,6 +32,8 @@ import io.openvidu.server.core.Participant;
public class ParticipantSummary { public class ParticipantSummary {
private static final Logger log = LoggerFactory.getLogger(ParticipantSummary.class);
private CDREventParticipant eventParticipantEnd; private CDREventParticipant eventParticipantEnd;
private Map<String, CDREventWebrtcConnection> publishers = new ConcurrentHashMap<>(); private Map<String, CDREventWebrtcConnection> publishers = new ConcurrentHashMap<>();
private Map<String, CDREventWebrtcConnection> subscribers = new ConcurrentHashMap<>(); private Map<String, CDREventWebrtcConnection> subscribers = new ConcurrentHashMap<>();
@ -53,20 +58,26 @@ public class ParticipantSummary {
public JsonObject toJson() { public JsonObject toJson() {
JsonObject json = new JsonObject(); 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()); json.addProperty("destroyedAt", this.eventParticipantEnd.getTimestamp());
Participant p = this.eventParticipantEnd.getParticipant();
json.addProperty("connectionId", p.getParticipantPublicId()); json.addProperty("connectionId", p.getParticipantPublicId());
json.addProperty("clientData", p.getClientMetadata()); json.addProperty("clientData", p.getClientMetadata());
json.addProperty("serverData", p.getServerMetadata()); 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("duration", duration);
json.addProperty("reason", json.addProperty("reason",
this.eventParticipantEnd.getReason().name() != null ? this.eventParticipantEnd.getReason().name() : ""); this.eventParticipantEnd.getReason() != null ? this.eventParticipantEnd.getReason().name() : "NULL");
// Publishers summary // Publishers summary
JsonObject publishersJson = new JsonObject(); JsonObject publishersJson = new JsonObject();