mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: Kms#fetchMediaServerType performed in single point
parent
9d975d3a17
commit
6f417a001f
|
@ -56,12 +56,11 @@ public class FixedOneKmsManager extends KmsManager {
|
||||||
|
|
||||||
// TODO: This should be done in KurentoClient connected event
|
// TODO: This should be done in KurentoClient connected event
|
||||||
kms.setKurentoClientConnected(true);
|
kms.setKurentoClientConnected(true);
|
||||||
MediaServer mediaServer = kms.fetchMediaServerType();
|
|
||||||
|
|
||||||
this.addKms(kms);
|
this.addKms(kms);
|
||||||
|
|
||||||
// Set Media Server in OpenVidu configuration
|
// Set Media Server in OpenVidu configuration
|
||||||
this.openviduConfig.setMediaServer(mediaServer);
|
this.openviduConfig.setMediaServer(kms.getMediaServer());
|
||||||
|
|
||||||
} catch (KurentoException e) {
|
} catch (KurentoException e) {
|
||||||
log.error("KMS in {} is not reachable by OpenVidu Server", firstProps.getUri());
|
log.error("KMS in {} is not reachable by OpenVidu Server", firstProps.getUri());
|
||||||
|
|
|
@ -147,6 +147,9 @@ public class Kms {
|
||||||
if (isConnected) {
|
if (isConnected) {
|
||||||
this.setTimeOfKurentoClientConnection(timestamp);
|
this.setTimeOfKurentoClientConnection(timestamp);
|
||||||
this.mediaNodeManager.mediaNodeUsageRegistration(this, timestamp);
|
this.mediaNodeManager.mediaNodeUsageRegistration(this, timestamp);
|
||||||
|
if (this.mediaServer == null) {
|
||||||
|
this.fetchMediaServerType();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.setTimeOfKurentoClientDisconnection(timestamp);
|
this.setTimeOfKurentoClientDisconnection(timestamp);
|
||||||
this.mediaNodeManager.mediaNodeUsageDeregistration(this, timestamp);
|
this.mediaNodeManager.mediaNodeUsageDeregistration(this, timestamp);
|
||||||
|
@ -298,6 +301,13 @@ public class Kms {
|
||||||
return this.activeComposedRecordings.intValue();
|
return this.activeComposedRecordings.intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MediaServer getMediaServer() {
|
||||||
|
if (this.mediaServer == null) {
|
||||||
|
this.fetchMediaServerType();
|
||||||
|
}
|
||||||
|
return this.mediaServer;
|
||||||
|
}
|
||||||
|
|
||||||
public MediaServer fetchMediaServerType() {
|
public MediaServer fetchMediaServerType() {
|
||||||
ServerInfo serverInfo = this.client.getServerManager().getInfo();
|
ServerInfo serverInfo = this.client.getServerManager().getInfo();
|
||||||
if (serverInfo.getVersion().startsWith("openvidu/mediasoup-controller")) {
|
if (serverInfo.getVersion().startsWith("openvidu/mediasoup-controller")) {
|
||||||
|
|
|
@ -62,7 +62,6 @@ public class IntegrationTestConfiguration {
|
||||||
|
|
||||||
kms.setKurentoClient(kClient);
|
kms.setKurentoClient(kClient);
|
||||||
kms.setKurentoClientConnected(true);
|
kms.setKurentoClientConnected(true);
|
||||||
kms.fetchMediaServerType();
|
|
||||||
|
|
||||||
spy.addKms(kms);
|
spy.addKms(kms);
|
||||||
successfullyConnectedKmss.add(kms);
|
successfullyConnectedKmss.add(kms);
|
||||||
|
|
Loading…
Reference in New Issue