openvidu-server: every add(get)Tag("name") to set(get)Name()

pull/154/head
pabloFuente 2018-11-13 17:14:04 +01:00
parent c06d5d3e2a
commit 0f9aa35299
5 changed files with 40 additions and 55 deletions

View File

@ -109,7 +109,7 @@ public class KurentoParticipant extends Participant {
String publisherStreamId = this.getParticipantPublicId() + "_" String publisherStreamId = this.getParticipantPublicId() + "_"
+ (mediaOptions.hasVideo() ? mediaOptions.getTypeOfVideo() : "MICRO") + "_" + (mediaOptions.hasVideo() ? mediaOptions.getTypeOfVideo() : "MICRO") + "_"
+ RandomStringUtils.random(5, true, false).toUpperCase(); + RandomStringUtils.random(5, true, false).toUpperCase();
this.publisher.getEndpoint().addTag("name", publisherStreamId); this.publisher.getEndpoint().setName(publisherStreamId);
addEndpointListeners(this.publisher); addEndpointListeners(this.publisher);
// Remove streamId from publisher's map // Remove streamId from publisher's map
@ -299,7 +299,7 @@ public class KurentoParticipant extends Participant {
String subscriberStreamId = this.getParticipantPublicId() + "_" + kSender.getPublisherStreamId(); String subscriberStreamId = this.getParticipantPublicId() + "_" + kSender.getPublisherStreamId();
subscriber.getEndpoint().addTag("name", subscriberStreamId); subscriber.getEndpoint().setName(subscriberStreamId);
addEndpointListeners(subscriber); addEndpointListeners(subscriber);
@ -383,8 +383,7 @@ public class KurentoParticipant extends Participant {
* Returns a {@link SubscriberEndpoint} for the given participant public id. The * Returns a {@link SubscriberEndpoint} for the given participant public id. The
* endpoint is created if not found. * endpoint is created if not found.
* *
* @param remotePublicId * @param remotePublicId id of another user
* id of another user
* @return the endpoint instance * @return the endpoint instance
*/ */
public SubscriberEndpoint getNewOrExistingSubscriber(String senderPublicId) { public SubscriberEndpoint getNewOrExistingSubscriber(String senderPublicId) {
@ -486,7 +485,7 @@ public class KurentoParticipant extends Participant {
/* /*
* endpoint.getWebEndpoint().addElementConnectedListener((element) -> { String * endpoint.getWebEndpoint().addElementConnectedListener((element) -> { String
* msg = " Element connected (" + * msg = " Element connected (" +
* endpoint.getEndpoint().getTag("name") + ") -> " + "SINK: " + * endpoint.getEndpoint().getName() + ") -> " + "SINK: " +
* element.getSink().getName() + " | SOURCE: " + element.getSource().getName() + * element.getSink().getName() + " | SOURCE: " + element.getSource().getName() +
* " | MEDIATYPE: " + element.getMediaType(); System.out.println(msg); * " | MEDIATYPE: " + element.getMediaType(); System.out.println(msg);
* this.infoHandler.sendInfo(msg); }); * this.infoHandler.sendInfo(msg); });
@ -495,7 +494,7 @@ public class KurentoParticipant extends Participant {
/* /*
* endpoint.getWebEndpoint().addElementDisconnectedListener((event) -> { String * endpoint.getWebEndpoint().addElementDisconnectedListener((event) -> { String
* msg = " Element disconnected (" + * msg = " Element disconnected (" +
* endpoint.getEndpoint().getTag("name") + ") -> " + "SINK: " + * endpoint.getEndpoint().getName() + ") -> " + "SINK: " +
* event.getSinkMediaDescription() + " | SOURCE: " + * event.getSinkMediaDescription() + " | SOURCE: " +
* event.getSourceMediaDescription() + " | MEDIATYPE: " + event.getMediaType(); * event.getSourceMediaDescription() + " | MEDIATYPE: " + event.getMediaType();
* System.out.println(msg); this.infoHandler.sendInfo(msg); }); * System.out.println(msg); this.infoHandler.sendInfo(msg); });
@ -510,7 +509,7 @@ public class KurentoParticipant extends Participant {
* *
* endpoint.getWebEndpoint().addMediaFlowInStateChangeListener((event) -> { * endpoint.getWebEndpoint().addMediaFlowInStateChangeListener((event) -> {
* String msg1 = " Media flow in state change (" + * String msg1 = " Media flow in state change (" +
* endpoint.getEndpoint().getTag("name") + ") -> " + "STATE: " + * endpoint.getEndpoint().getName() + ") -> " + "STATE: " +
* event.getState() + " | SOURCE: " + event.getSource().getName() + " | PAD: " + * event.getState() + " | SOURCE: " + event.getSource().getName() + " | PAD: " +
* event.getPadName() + " | MEDIATYPE: " + event.getMediaType() + * event.getPadName() + " | MEDIATYPE: " + event.getMediaType() +
* " | TIMESTAMP: " + System.currentTimeMillis(); * " | TIMESTAMP: " + System.currentTimeMillis();
@ -522,10 +521,10 @@ public class KurentoParticipant extends Participant {
* *
* if (endpoint.flowInMedia.values().size() != 2) { msg2 = * if (endpoint.flowInMedia.values().size() != 2) { msg2 =
* " THERE ARE LESS FLOW IN MEDIA'S THAN EXPECTED IN " + * " THERE ARE LESS FLOW IN MEDIA'S THAN EXPECTED IN " +
* endpoint.getEndpoint().getTag("name") + " (" + * endpoint.getEndpoint().getName() + " (" +
* endpoint.flowInMedia.values().size() + ")"; } else { msg2 = * endpoint.flowInMedia.values().size() + ")"; } else { msg2 =
* " NUMBER OF FLOW IN MEDIA'S IS NOW CORRECT IN " + * " NUMBER OF FLOW IN MEDIA'S IS NOW CORRECT IN " +
* endpoint.getEndpoint().getTag("name") + " (" + * endpoint.getEndpoint().getName() + " (" +
* endpoint.flowInMedia.values().size() + ")"; } * endpoint.flowInMedia.values().size() + ")"; }
* *
* log.debug(msg1); log.debug(msg2); this.infoHandler.sendInfo(msg1); * log.debug(msg1); log.debug(msg2); this.infoHandler.sendInfo(msg1);
@ -533,7 +532,7 @@ public class KurentoParticipant extends Participant {
* *
* endpoint.getWebEndpoint().addMediaFlowOutStateChangeListener((event) -> { * endpoint.getWebEndpoint().addMediaFlowOutStateChangeListener((event) -> {
* String msg1 = " Media flow out state change (" + * String msg1 = " Media flow out state change (" +
* endpoint.getEndpoint().getTag("name") + ") -> " + "STATE: " + * endpoint.getEndpoint().getName() + ") -> " + "STATE: " +
* event.getState() + " | SOURCE: " + event.getSource().getName() + " | PAD: " + * event.getState() + " | SOURCE: " + event.getSource().getName() + " | PAD: " +
* event.getPadName() + " | MEDIATYPE: " + event.getMediaType() + * event.getPadName() + " | MEDIATYPE: " + event.getMediaType() +
* " | TIMESTAMP: " + System.currentTimeMillis(); * " | TIMESTAMP: " + System.currentTimeMillis();
@ -546,10 +545,10 @@ public class KurentoParticipant extends Participant {
* *
* if (endpoint.flowOutMedia.values().size() != 2) { msg2 = * if (endpoint.flowOutMedia.values().size() != 2) { msg2 =
* " THERE ARE LESS FLOW OUT MEDIA'S THAN EXPECTED IN " + * " THERE ARE LESS FLOW OUT MEDIA'S THAN EXPECTED IN " +
* endpoint.getEndpoint().getTag("name") + " (" + * endpoint.getEndpoint().getName() + " (" +
* endpoint.flowOutMedia.values().size() + ")"; } else { msg2 = * endpoint.flowOutMedia.values().size() + ")"; } else { msg2 =
* " NUMBER OF FLOW OUT MEDIA'S IS NOW CORRECT IN " + * " NUMBER OF FLOW OUT MEDIA'S IS NOW CORRECT IN " +
* endpoint.getEndpoint().getTag("name") + " (" + * endpoint.getEndpoint().getName() + " (" +
* endpoint.flowOutMedia.values().size() + ")"; } * endpoint.flowOutMedia.values().size() + ")"; }
* *
* log.debug(msg1); log.debug(msg2); this.infoHandler.sendInfo(msg1); * log.debug(msg1); log.debug(msg2); this.infoHandler.sendInfo(msg1);
@ -557,51 +556,51 @@ public class KurentoParticipant extends Participant {
* *
* endpoint.getWebEndpoint().addMediaSessionStartedListener((event) -> { String * endpoint.getWebEndpoint().addMediaSessionStartedListener((event) -> { String
* msg = " Media session started (" + * msg = " Media session started (" +
* endpoint.getEndpoint().getTag("name") + ") | TIMESTAMP: " + * endpoint.getEndpoint().getName() + ") | TIMESTAMP: " +
* System.currentTimeMillis(); log.debug(msg); this.infoHandler.sendInfo(msg); * System.currentTimeMillis(); log.debug(msg); this.infoHandler.sendInfo(msg);
* }); * });
* *
* endpoint.getWebEndpoint().addMediaSessionTerminatedListener((event) -> { * endpoint.getWebEndpoint().addMediaSessionTerminatedListener((event) -> {
* String msg = " Media session terminated (" + * String msg = " Media session terminated (" +
* endpoint.getEndpoint().getTag("name") + ") | TIMESTAMP: " + * endpoint.getEndpoint().getName() + ") | TIMESTAMP: " +
* System.currentTimeMillis(); log.debug(msg); this.infoHandler.sendInfo(msg); * System.currentTimeMillis(); log.debug(msg); this.infoHandler.sendInfo(msg);
* }); * });
* *
* endpoint.getWebEndpoint().addMediaStateChangedListener((event) -> { String * endpoint.getWebEndpoint().addMediaStateChangedListener((event) -> { String
* msg = " Media state changed (" + * msg = " Media state changed (" +
* endpoint.getEndpoint().getTag("name") + ") from " + event.getOldState() + * endpoint.getEndpoint().getName() + ") from " + event.getOldState() +
* " to " + event.getNewState(); log.debug(msg); this.infoHandler.sendInfo(msg); * " to " + event.getNewState(); log.debug(msg); this.infoHandler.sendInfo(msg);
* }); * });
* *
* endpoint.getWebEndpoint().addConnectionStateChangedListener((event) -> { * endpoint.getWebEndpoint().addConnectionStateChangedListener((event) -> {
* String msg = " Connection state changed (" + * String msg = " Connection state changed (" +
* endpoint.getEndpoint().getTag("name") + ") from " + event.getOldState() + * endpoint.getEndpoint().getName() + ") from " + event.getOldState() +
* " to " + event.getNewState() + " | TIMESTAMP: " + System.currentTimeMillis(); * " to " + event.getNewState() + " | TIMESTAMP: " + System.currentTimeMillis();
* log.debug(msg); this.infoHandler.sendInfo(msg); }); * log.debug(msg); this.infoHandler.sendInfo(msg); });
* *
* endpoint.getWebEndpoint().addIceCandidateFoundListener((event) -> { String * endpoint.getWebEndpoint().addIceCandidateFoundListener((event) -> { String
* msg = " ICE CANDIDATE FOUND (" + * msg = " ICE CANDIDATE FOUND (" +
* endpoint.getEndpoint().getTag("name") + "): CANDIDATE: " + * endpoint.getEndpoint().getName() + "): CANDIDATE: " +
* event.getCandidate().getCandidate() + " | TIMESTAMP: " + * event.getCandidate().getCandidate() + " | TIMESTAMP: " +
* System.currentTimeMillis(); log.debug(msg); this.infoHandler.sendInfo(msg); * System.currentTimeMillis(); log.debug(msg); this.infoHandler.sendInfo(msg);
* }); * });
* *
* endpoint.getWebEndpoint().addIceComponentStateChangeListener((event) -> { * endpoint.getWebEndpoint().addIceComponentStateChangeListener((event) -> {
* String msg = " ICE COMPONENT STATE CHANGE (" + * String msg = " ICE COMPONENT STATE CHANGE (" +
* endpoint.getEndpoint().getTag("name") + "): for component " + * endpoint.getEndpoint().getName() + "): for component " +
* event.getComponentId() + " - STATE: " + event.getState() + " | TIMESTAMP: " + * event.getComponentId() + " - STATE: " + event.getState() + " | TIMESTAMP: " +
* System.currentTimeMillis(); log.debug(msg); this.infoHandler.sendInfo(msg); * System.currentTimeMillis(); log.debug(msg); this.infoHandler.sendInfo(msg);
* }); * });
* *
* endpoint.getWebEndpoint().addIceGatheringDoneListener((event) -> { String msg * endpoint.getWebEndpoint().addIceGatheringDoneListener((event) -> { String msg
* = " ICE GATHERING DONE! (" + * = " ICE GATHERING DONE! (" +
* endpoint.getEndpoint().getTag("name") + ")" + " | TIMESTAMP: " + * endpoint.getEndpoint().getName() + ")" + " | TIMESTAMP: " +
* System.currentTimeMillis(); log.debug(msg); this.infoHandler.sendInfo(msg); * System.currentTimeMillis(); log.debug(msg); this.infoHandler.sendInfo(msg);
* }); * });
*/ */
endpoint.getWebEndpoint().addMediaFlowInStateChangeListener(event -> { endpoint.getWebEndpoint().addMediaFlowInStateChangeListener(event -> {
String msg1 = "Media flow in state change (" + endpoint.getEndpoint().getTag("name") + ") -> " + "STATE: " String msg1 = "Media flow in state change (" + endpoint.getEndpoint().getName() + ") -> " + "STATE: "
+ event.getState() + " | SOURCE: " + event.getSource().getName() + " | PAD: " + event.getPadName() + event.getState() + " | SOURCE: " + event.getSource().getName() + " | PAD: " + event.getPadName()
+ " | MEDIATYPE: " + event.getMediaType() + " | TIMESTAMP: " + System.currentTimeMillis(); + " | MEDIATYPE: " + event.getMediaType() + " | TIMESTAMP: " + System.currentTimeMillis();
@ -622,7 +621,7 @@ public class KurentoParticipant extends Participant {
}); });
endpoint.getWebEndpoint().addMediaFlowOutStateChangeListener(event -> { endpoint.getWebEndpoint().addMediaFlowOutStateChangeListener(event -> {
String msg1 = "Media flow out state change (" + endpoint.getEndpoint().getTag("name") + ") -> " + "STATE: " String msg1 = "Media flow out state change (" + endpoint.getEndpoint().getName() + ") -> " + "STATE: "
+ event.getState() + " | SOURCE: " + event.getSource().getName() + " | PAD: " + event.getPadName() + event.getState() + " | SOURCE: " + event.getSource().getName() + " | PAD: " + event.getPadName()
+ " | MEDIATYPE: " + event.getMediaType() + " | TIMESTAMP: " + System.currentTimeMillis(); + " | MEDIATYPE: " + event.getMediaType() + " | TIMESTAMP: " + System.currentTimeMillis();
@ -654,7 +653,7 @@ public class KurentoParticipant extends Participant {
endpoint.selectedLocalIceCandidate = event.getCandidatePair().getLocalCandidate(); endpoint.selectedLocalIceCandidate = event.getCandidatePair().getLocalCandidate();
endpoint.selectedRemoteIceCandidate = event.getCandidatePair().getRemoteCandidate(); endpoint.selectedRemoteIceCandidate = event.getCandidatePair().getRemoteCandidate();
endpoint.kmsEvents.add(new KmsEvent(event, endpoint.createdAt())); endpoint.kmsEvents.add(new KmsEvent(event, endpoint.createdAt()));
String msg = "ICE CANDIDATE SELECTED (" + endpoint.getEndpoint().getTag("name") + "): LOCAL CANDIDATE: " String msg = "ICE CANDIDATE SELECTED (" + endpoint.getEndpoint().getName() + "): LOCAL CANDIDATE: "
+ endpoint.selectedLocalIceCandidate + " | REMOTE CANDIDATE: " + endpoint.selectedRemoteIceCandidate + endpoint.selectedLocalIceCandidate + " | REMOTE CANDIDATE: " + endpoint.selectedRemoteIceCandidate
+ " | TIMESTAMP: " + System.currentTimeMillis(); + " | TIMESTAMP: " + System.currentTimeMillis();
log.warn(msg); log.warn(msg);
@ -678,7 +677,7 @@ public class KurentoParticipant extends Participant {
@Override @Override
public String getPublisherStreamId() { public String getPublisherStreamId() {
return this.publisher.getEndpoint().getTag("name"); return this.publisher.getEndpoint().getName();
} }
@Override @Override

View File

@ -11,7 +11,7 @@ public class KmsEvent {
public KmsEvent(MediaEvent event, long createdAt) { public KmsEvent(MediaEvent event, long createdAt) {
this.event = event; this.event = event;
this.endpoint = event.getSource().getTag("name"); this.endpoint = event.getSource().getName();
this.event.setSource(null); this.event.setSource(null);
this.timestamp = System.currentTimeMillis(); this.timestamp = System.currentTimeMillis();
this.msSinceCreation = this.timestamp - createdAt; this.msSinceCreation = this.timestamp - createdAt;

View File

@ -31,14 +31,12 @@ import org.kurento.client.EventListener;
import org.kurento.client.IceCandidate; import org.kurento.client.IceCandidate;
import org.kurento.client.ListenerSubscription; import org.kurento.client.ListenerSubscription;
import org.kurento.client.MediaElement; import org.kurento.client.MediaElement;
import org.kurento.client.MediaEvent;
import org.kurento.client.MediaPipeline; import org.kurento.client.MediaPipeline;
import org.kurento.client.MediaType; import org.kurento.client.MediaType;
import org.kurento.client.OnIceCandidateEvent; import org.kurento.client.OnIceCandidateEvent;
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.kurento.jsonrpc.JsonUtils; import org.kurento.jsonrpc.JsonUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -179,9 +177,8 @@ public abstract class MediaEndpoint {
* actions are taken. It also registers an error listener for the endpoint and * actions are taken. It also registers an error listener for the endpoint and
* for any additional media elements. * for any additional media elements.
* *
* @param endpointLatch * @param endpointLatch latch whose countdown is performed when the asynchronous
* latch whose countdown is performed when the asynchronous call to * call to build the {@link WebRtcEndpoint} returns
* build the {@link WebRtcEndpoint} returns
* *
* @return the existing endpoint, if any * @return the existing endpoint, if any
*/ */
@ -211,8 +208,7 @@ public abstract class MediaEndpoint {
* Sets the {@link MediaPipeline} used to create the internal * Sets the {@link MediaPipeline} used to create the internal
* {@link WebRtcEndpoint}. * {@link WebRtcEndpoint}.
* *
* @param pipeline * @param pipeline the {@link MediaPipeline}
* the {@link MediaPipeline}
*/ */
public void setMediaPipeline(MediaPipeline pipeline) { public void setMediaPipeline(MediaPipeline pipeline) {
this.pipeline = pipeline; this.pipeline = pipeline;
@ -228,8 +224,7 @@ public abstract class MediaEndpoint {
/** /**
* Sets the endpoint's name (as indicated by the browser). * Sets the endpoint's name (as indicated by the browser).
* *
* @param endpointName * @param endpointName the name
* the name
*/ */
public void setEndpointName(String endpointName) { public void setEndpointName(String endpointName) {
this.endpointName = endpointName; this.endpointName = endpointName;
@ -299,8 +294,7 @@ public abstract class MediaEndpoint {
* Add a new {@link IceCandidate} received gathered by the remote peer of this * Add a new {@link IceCandidate} received gathered by the remote peer of this
* {@link WebRtcEndpoint}. * {@link WebRtcEndpoint}.
* *
* @param candidate * @param candidate the remote candidate
* the remote candidate
*/ */
public synchronized void addIceCandidate(IceCandidate candidate) throws OpenViduException { public synchronized void addIceCandidate(IceCandidate candidate) throws OpenViduException {
if (!this.isWeb()) { if (!this.isWeb()) {
@ -317,8 +311,7 @@ public abstract class MediaEndpoint {
* Registers a listener for when the {@link MediaElement} triggers an * Registers a listener for when the {@link MediaElement} triggers an
* {@link ErrorEvent}. Notifies the owner with the error. * {@link ErrorEvent}. Notifies the owner with the error.
* *
* @param element * @param element the {@link MediaElement}
* the {@link MediaElement}
* @return {@link ListenerSubscription} that can be used to deregister the * @return {@link ListenerSubscription} that can be used to deregister the
* listener * listener
*/ */
@ -335,10 +328,8 @@ public abstract class MediaEndpoint {
* Unregisters the error listener from the media element using the provided * Unregisters the error listener from the media element using the provided
* subscription. * subscription.
* *
* @param element * @param element the {@link MediaElement}
* the {@link MediaElement} * @param subscription the associated {@link ListenerSubscription}
* @param subscription
* the associated {@link ListenerSubscription}
*/ */
protected void unregisterElementErrListener(MediaElement element, final ListenerSubscription subscription) { protected void unregisterElementErrListener(MediaElement element, final ListenerSubscription subscription) {
if (element == null || subscription == null) { if (element == null || subscription == null) {
@ -352,8 +343,7 @@ public abstract class MediaEndpoint {
* to process the offer String. * to process the offer String.
* *
* @see SdpEndpoint#processOffer(String) * @see SdpEndpoint#processOffer(String)
* @param offer * @param offer String with the Sdp offer
* String with the Sdp offer
* @return the Sdp answer * @return the Sdp answer
*/ */
protected String processOffer(String offer) throws OpenViduException { protected String processOffer(String offer) throws OpenViduException {
@ -400,8 +390,7 @@ public abstract class MediaEndpoint {
* to process the answer String. * to process the answer String.
* *
* @see SdpEndpoint#processAnswer(String) * @see SdpEndpoint#processAnswer(String)
* @param answer * @param answer String with the Sdp answer from remote
* String with the Sdp answer from remote
* @return the updated Sdp offer, based on the received answer * @return the updated Sdp offer, based on the received answer
*/ */
protected String processAnswer(String answer) throws OpenViduException { protected String processAnswer(String answer) throws OpenViduException {
@ -428,8 +417,7 @@ public abstract class MediaEndpoint {
* *
* @see WebRtcEndpoint#addOnIceCandidateListener(org.kurento.client.EventListener) * @see WebRtcEndpoint#addOnIceCandidateListener(org.kurento.client.EventListener)
* @see Participant#sendIceCandidate(String, IceCandidate) * @see Participant#sendIceCandidate(String, IceCandidate)
* @throws OpenViduException * @throws OpenViduException if thrown, unable to register the listener
* if thrown, unable to register the listener
*/ */
protected void registerOnIceCandidateEventListener() throws OpenViduException { protected void registerOnIceCandidateEventListener() throws OpenViduException {
if (!this.isWeb()) { if (!this.isWeb()) {
@ -502,11 +490,9 @@ public abstract class MediaEndpoint {
public JsonObject withStatsToJson() { public JsonObject withStatsToJson() {
JsonObject json = new JsonObject(); JsonObject json = new JsonObject();
json.addProperty("createdAt", this.createdAt); json.addProperty("createdAt", this.createdAt);
try { json.addProperty("webrtcEndpointName", this.getEndpoint().getName());
json.addProperty("webrtcTagName", this.getEndpoint().getTag("name")); json.addProperty("remoteSdp", this.getEndpoint().getRemoteSessionDescriptor());
} catch (KurentoServerException ex) { json.addProperty("localSdp", this.getEndpoint().getLocalSessionDescriptor());
json.addProperty("webrtcTagName", "NOT_FOUND");
}
json.add("receivedCandidates", new GsonBuilder().create().toJsonTree(this.receivedCandidateList)); json.add("receivedCandidates", new GsonBuilder().create().toJsonTree(this.receivedCandidateList));
json.addProperty("localCandidate", this.selectedLocalIceCandidate); json.addProperty("localCandidate", this.selectedLocalIceCandidate);
json.addProperty("remoteCandidate", this.selectedRemoteIceCandidate); json.addProperty("remoteCandidate", this.selectedRemoteIceCandidate);

View File

@ -136,7 +136,7 @@ public class PublisherEndpoint extends MediaEndpoint {
public boolean removeParticipantAsListenerOfFilterEvent(String eventType, String participantPublicId) { public boolean removeParticipantAsListenerOfFilterEvent(String eventType, String participantPublicId) {
if (!this.subscribersToFilterEvents.containsKey(eventType)) { if (!this.subscribersToFilterEvents.containsKey(eventType)) {
String streamId = this.getEndpoint().getTag("name"); String streamId = this.getEndpoint().getName();
log.error("Request to removeFilterEventListener to stream {} gone wrong: Filter {} has no listener added", log.error("Request to removeFilterEventListener to stream {} gone wrong: Filter {} has no listener added",
streamId, eventType); streamId, eventType);
throw new OpenViduException(Code.FILTER_EVENT_LISTENER_NOT_FOUND, throw new OpenViduException(Code.FILTER_EVENT_LISTENER_NOT_FOUND,
@ -565,7 +565,7 @@ public class PublisherEndpoint extends MediaEndpoint {
@Override @Override
public JsonObject toJson() { public JsonObject toJson() {
JsonObject json = super.toJson(); JsonObject json = super.toJson();
json.addProperty("streamId", this.getEndpoint().getTag("name")); json.addProperty("streamId", this.getEndpoint().getName());
json.add("mediaOptions", this.mediaOptions.toJson()); json.add("mediaOptions", this.mediaOptions.toJson());
return json; return json;
} }

View File

@ -78,7 +78,7 @@ public class SubscriberEndpoint extends MediaEndpoint {
public JsonObject toJson() { public JsonObject toJson() {
JsonObject json = super.toJson(); JsonObject json = super.toJson();
try { try {
json.addProperty("streamId", this.publisher.getEndpoint().getTag("name")); json.addProperty("streamId", this.publisher.getEndpoint().getName());
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
json.addProperty("streamId", "NOT_FOUND"); json.addProperty("streamId", "NOT_FOUND");
} }