vani-meeting-server 2.8.9 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,7 +8,9 @@ class BaseSFUWebsocket {
|
|
|
8
8
|
async redisBroadcastMessageToTopic(topic, data) {
|
|
9
9
|
const stringifyData = JSON.stringify(data);
|
|
10
10
|
RedisHandler_1.RedisHandler.getInstance().redisPublisher.publish(topic, stringifyData);
|
|
11
|
-
|
|
11
|
+
if (data.interfaceName !== 'MultiSystemEventsBody') {
|
|
12
|
+
EventEmitterHandler_1.EventEmitterHandler.getInstance().vaniEventEmitter.emit(topic, stringifyData);
|
|
13
|
+
}
|
|
12
14
|
}
|
|
13
15
|
//Utilility function
|
|
14
16
|
prepareMutilSystemEvents(multiSystemEvent, roomId, data) {
|
|
@@ -49,7 +49,7 @@ class SFUEachRoomMutliServerHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket
|
|
|
49
49
|
ServerHandler_1.ServerHandler.getInstance().serverStartRequest && ServerHandler_1.ServerHandler.getInstance().serverStartRequest.logLevel !== WebSocketServerStartRequest_1.LogLevel.None && console.log("onMutiRoomMessage", message);
|
|
50
50
|
if (message.type === EachSocketConnectionHandler_1.MultiSystemEvents.OnNewServerJoinedForRoom) {
|
|
51
51
|
const pipeTransportAndPort = await this.createPipeTransport(message.data.ip);
|
|
52
|
-
if (pipeTransportAndPort) {
|
|
52
|
+
if (pipeTransportAndPort && await Constant_1.default.getPublicIp() !== message.data.ip) {
|
|
53
53
|
if (!pipeTransportAndPort.transport.tuple.remoteIp) {
|
|
54
54
|
await pipeTransportAndPort.transport?.connect({ ip: message.data.ip, port: message.data.port });
|
|
55
55
|
this.redisBroadcastMessageToTopic(Utility_1.Utility.getTopicForRoomIdAndIp(message.roomId, message.data.ip), this.prepareMutilSystemEvents(EachSocketConnectionHandler_1.MultiSystemEvents.OnConnectPipe, message.roomId, { ip: await Constant_1.default.getPublicIp(), port: pipeTransportAndPort.port }));
|
|
@@ -58,7 +58,7 @@ class SFUEachRoomMutliServerHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket
|
|
|
58
58
|
}
|
|
59
59
|
else if (message.type === EachSocketConnectionHandler_1.MultiSystemEvents.OnConnectPipe) {
|
|
60
60
|
const ip = message.data.ip;
|
|
61
|
-
if (this.pipeTransports[ip]) {
|
|
61
|
+
if (this.pipeTransports[ip] && await Constant_1.default.getPublicIp() !== ip) {
|
|
62
62
|
if (!this.pipeTransports[ip].transport.tuple.remoteIp) {
|
|
63
63
|
await this.pipeTransports[ip].transport.connect({ ip: ip, port: message.data.port });
|
|
64
64
|
this.redisBroadcastMessageToTopic(Utility_1.Utility.getTopicForRoomIdAndIp(message.roomId, message.data.ip), this.prepareMutilSystemEvents(EachSocketConnectionHandler_1.MultiSystemEvents.OnPipeConnected, message.roomId, { ip: await Constant_1.default.getPublicIp() }));
|
|
@@ -70,7 +70,7 @@ class SFUEachRoomMutliServerHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket
|
|
|
70
70
|
}
|
|
71
71
|
else if (message.type === EachSocketConnectionHandler_1.MultiSystemEvents.OnPipeConnected) {
|
|
72
72
|
const ip = message.data.ip;
|
|
73
|
-
if (this.pipeTransports[ip]) {
|
|
73
|
+
if (this.pipeTransports[ip] && await Constant_1.default.getPublicIp() !== ip) {
|
|
74
74
|
this.roomHandlerDataSource.getAllProducerForRoom().forEach(async (eachRoomProducer) => {
|
|
75
75
|
await this.consumeProductAndInfrom(this.pipeTransports[ip].transport, ip, eachRoomProducer);
|
|
76
76
|
});
|
|
@@ -78,7 +78,7 @@ class SFUEachRoomMutliServerHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket
|
|
|
78
78
|
}
|
|
79
79
|
else if (message.type === EachSocketConnectionHandler_1.MultiSystemEvents.OnConsumerData) {
|
|
80
80
|
const ip = message.data.ip;
|
|
81
|
-
if (this.pipeTransports[ip]) {
|
|
81
|
+
if (this.pipeTransports[ip] && await Constant_1.default.getPublicIp() !== ip) {
|
|
82
82
|
const producer = await this.pipeTransports[ip].transport.produce({ rtpParameters: message.data.rtpParameters, kind: message.data.kind, appData: message.data.appData });
|
|
83
83
|
producer.appData.consumerId = message.data.consumerId;
|
|
84
84
|
this.onNewRemoteProducer(producer);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vani-meeting-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Vani Meeting Server SDK",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"dotenv": "^16.0.2",
|
|
32
32
|
"express": "^4.18.1",
|
|
33
33
|
"helmet": "^6.0.0",
|
|
34
|
-
"mediasoup": "3.19.
|
|
34
|
+
"mediasoup": "3.19.14",
|
|
35
35
|
"public-ip": "4.0.3",
|
|
36
36
|
"typescript": "^5.6.2",
|
|
37
37
|
"uuid": "^9.0.0",
|
|
38
|
-
"ws": "^8.
|
|
38
|
+
"ws": "^8.19.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/uuid": "^8.3.4",
|