mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: differentiate onSubscribe handler
parent
37073bd0ec
commit
b31b612954
|
@ -355,9 +355,8 @@ public class SessionEventsHandler {
|
||||||
rpcNotificationService.sendResponse(participant.getParticipantPrivateId(), transactionId, result);
|
rpcNotificationService.sendResponse(participant.getParticipantPrivateId(), transactionId, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: REMOVE ON 2.18.0
|
public void onSubscribeClientInitiatedNegotiation(Participant participant, Session session, String sdpAnswer,
|
||||||
public void onSubscribe(Participant participant, Session session, String sdpAnswer, Integer transactionId,
|
Integer transactionId, OpenViduException error) {
|
||||||
OpenViduException error) {
|
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
rpcNotificationService.sendErrorResponse(participant.getParticipantPrivateId(), transactionId, null, error);
|
rpcNotificationService.sendErrorResponse(participant.getParticipantPrivateId(), transactionId, null, error);
|
||||||
return;
|
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) {
|
if (error != null) {
|
||||||
rpcNotificationService.sendErrorResponse(participant.getParticipantPrivateId(), transactionId, null, error);
|
rpcNotificationService.sendErrorResponse(participant.getParticipantPrivateId(), transactionId, null, error);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -654,7 +654,7 @@ public class KurentoSessionManager extends SessionManager {
|
||||||
WebrtcDebugEventOperation.subscribe, WebrtcDebugEventType.sdpAnswer, sdpString));
|
WebrtcDebugEventOperation.subscribe, WebrtcDebugEventType.sdpAnswer, sdpString));
|
||||||
|
|
||||||
kParticipant.receiveMedia(senderParticipant, sdpString, false, true);
|
kParticipant.receiveMedia(senderParticipant, sdpString, false, true);
|
||||||
sessionEventsHandler.onSubscribe(participant, session, transactionId, null);
|
sessionEventsHandler.onSubscribeServerInitiatedNegotiation(participant, session, transactionId, null);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -682,12 +682,13 @@ public class KurentoSessionManager extends SessionManager {
|
||||||
|
|
||||||
CDR.log(new WebrtcDebugEvent(participant, subscriberEndpointName, WebrtcDebugEventIssuer.server,
|
CDR.log(new WebrtcDebugEvent(participant, subscriberEndpointName, WebrtcDebugEventIssuer.server,
|
||||||
WebrtcDebugEventOperation.subscribe, WebrtcDebugEventType.sdpAnswer, sdpAnswer));
|
WebrtcDebugEventOperation.subscribe, WebrtcDebugEventType.sdpAnswer, sdpAnswer));
|
||||||
sessionEventsHandler.onSubscribe(participant, session, sdpAnswer, transactionId, null);
|
sessionEventsHandler.onSubscribeClientInitiatedNegotiation(participant, session, sdpAnswer,
|
||||||
|
transactionId, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (OpenViduException e) {
|
} catch (OpenViduException e) {
|
||||||
log.error("PARTICIPANT {}: Error subscribing to {}", participant.getParticipantPublicId(), senderName, 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 {}: {}",
|
log.debug("SDP Answer for subscribing reconnection PARTICIPANT {}: {}",
|
||||||
kParticipant.getParticipantPublicId(), sdpAnswer);
|
kParticipant.getParticipantPublicId(), sdpAnswer);
|
||||||
|
|
||||||
sessionEventsHandler.onSubscribe(kParticipant, kSession, sdpAnswer, transactionId, null);
|
sessionEventsHandler.onSubscribeServerInitiatedNegotiation(kParticipant, kSession, transactionId, null);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -1306,7 +1307,8 @@ public class KurentoSessionManager extends SessionManager {
|
||||||
CDR.log(new WebrtcDebugEvent(kParticipant, subscriberEndpointName, WebrtcDebugEventIssuer.server,
|
CDR.log(new WebrtcDebugEvent(kParticipant, subscriberEndpointName, WebrtcDebugEventIssuer.server,
|
||||||
operation, WebrtcDebugEventType.sdpAnswer, sdpAnswer));
|
operation, WebrtcDebugEventType.sdpAnswer, sdpAnswer));
|
||||||
|
|
||||||
sessionEventsHandler.onSubscribe(kParticipant, kSession, sdpAnswer, transactionId, null);
|
sessionEventsHandler.onSubscribeClientInitiatedNegotiation(kParticipant, kSession, sdpAnswer,
|
||||||
|
transactionId, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue