From b31b612954d00e298f1627c6e75184b9e849cdb3 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Mon, 10 Oct 2022 14:37:35 +0200 Subject: [PATCH] openvidu-server: differentiate onSubscribe handler --- .../openvidu/server/core/SessionEventsHandler.java | 9 ++++----- .../server/kurento/core/KurentoSessionManager.java | 12 +++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/openvidu-server/src/main/java/io/openvidu/server/core/SessionEventsHandler.java b/openvidu-server/src/main/java/io/openvidu/server/core/SessionEventsHandler.java index bbcde615..60bfb45b 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/core/SessionEventsHandler.java +++ b/openvidu-server/src/main/java/io/openvidu/server/core/SessionEventsHandler.java @@ -355,9 +355,8 @@ public class SessionEventsHandler { rpcNotificationService.sendResponse(participant.getParticipantPrivateId(), transactionId, result); } - // TODO: REMOVE ON 2.18.0 - public void onSubscribe(Participant participant, Session session, String sdpAnswer, Integer transactionId, - OpenViduException error) { + public void onSubscribeClientInitiatedNegotiation(Participant participant, Session session, String sdpAnswer, + Integer transactionId, OpenViduException error) { if (error != null) { rpcNotificationService.sendErrorResponse(participant.getParticipantPrivateId(), transactionId, null, error); return; @@ -373,9 +372,9 @@ public class SessionEventsHandler { }); } } - // END TODO - public void onSubscribe(Participant participant, Session session, Integer transactionId, OpenViduException error) { + public void onSubscribeServerInitiatedNegotiation(Participant participant, Session session, Integer transactionId, + OpenViduException error) { if (error != null) { rpcNotificationService.sendErrorResponse(participant.getParticipantPrivateId(), transactionId, null, error); return; diff --git a/openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java b/openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java index e2566f30..3ad1a0c9 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java +++ b/openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java @@ -654,7 +654,7 @@ public class KurentoSessionManager extends SessionManager { WebrtcDebugEventOperation.subscribe, WebrtcDebugEventType.sdpAnswer, sdpString)); kParticipant.receiveMedia(senderParticipant, sdpString, false, true); - sessionEventsHandler.onSubscribe(participant, session, transactionId, null); + sessionEventsHandler.onSubscribeServerInitiatedNegotiation(participant, session, transactionId, null); } else { @@ -682,12 +682,13 @@ public class KurentoSessionManager extends SessionManager { CDR.log(new WebrtcDebugEvent(participant, subscriberEndpointName, WebrtcDebugEventIssuer.server, WebrtcDebugEventOperation.subscribe, WebrtcDebugEventType.sdpAnswer, sdpAnswer)); - sessionEventsHandler.onSubscribe(participant, session, sdpAnswer, transactionId, null); + sessionEventsHandler.onSubscribeClientInitiatedNegotiation(participant, session, sdpAnswer, + transactionId, null); } } catch (OpenViduException e) { log.error("PARTICIPANT {}: Error subscribing to {}", participant.getParticipantPublicId(), senderName, e); - sessionEventsHandler.onSubscribe(participant, session, null, transactionId, e); + sessionEventsHandler.onSubscribeServerInitiatedNegotiation(participant, session, transactionId, e); } } @@ -1275,7 +1276,7 @@ public class KurentoSessionManager extends SessionManager { log.debug("SDP Answer for subscribing reconnection PARTICIPANT {}: {}", kParticipant.getParticipantPublicId(), sdpAnswer); - sessionEventsHandler.onSubscribe(kParticipant, kSession, sdpAnswer, transactionId, null); + sessionEventsHandler.onSubscribeServerInitiatedNegotiation(kParticipant, kSession, transactionId, null); } else { @@ -1306,7 +1307,8 @@ public class KurentoSessionManager extends SessionManager { CDR.log(new WebrtcDebugEvent(kParticipant, subscriberEndpointName, WebrtcDebugEventIssuer.server, operation, WebrtcDebugEventType.sdpAnswer, sdpAnswer)); - sessionEventsHandler.onSubscribe(kParticipant, kSession, sdpAnswer, transactionId, null); + sessionEventsHandler.onSubscribeClientInitiatedNegotiation(kParticipant, kSession, sdpAnswer, + transactionId, null); }