openvidu-server: get remote SDP of MediaEndpoint inside try-catch

pull/437/head
pabloFuente 2020-04-14 21:30:21 +02:00
parent 60a414c791
commit 4c50f84b7d
1 changed files with 9 additions and 1 deletions

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