vani-meeting-server 2.6.5 → 2.6.7
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.
- package/lib/lib/redis/RedisHandler.js +1 -1
- package/lib/models/Event.js +1 -1
- package/lib/models/Logs.js +1 -1
- package/lib/models/MessagePayload.js +2 -2
- package/lib/models/WebSocketServerStartRequest.js +2 -2
- package/lib/sfu/SFUEachRoomHandler.d.ts +3 -4
- package/lib/sfu/SFUEachRoomHandler.js +13 -1
- package/lib/sfu/SFUEachRoomUserHandler.d.ts +3 -3
- package/lib/utility/Constant.d.ts +1 -1
- package/lib/utility/Constant.js +4 -4
- package/lib/utility/VaniEventListener.d.ts +0 -1
- package/lib/websocket/EachSocketConnectionHandler.d.ts +2 -0
- package/lib/websocket/EachSocketConnectionHandler.js +6 -4
- package/package.json +2 -2
|
@@ -15,7 +15,7 @@ var RedisKeyType;
|
|
|
15
15
|
RedisKeyType["MeetingTime"] = "meetingTime";
|
|
16
16
|
RedisKeyType["Participants"] = "participants";
|
|
17
17
|
RedisKeyType["IpAddress"] = "ipAddress";
|
|
18
|
-
})(RedisKeyType
|
|
18
|
+
})(RedisKeyType || (exports.RedisKeyType = RedisKeyType = {}));
|
|
19
19
|
class RedisHandler {
|
|
20
20
|
static redisHandler = new RedisHandler();
|
|
21
21
|
redisClient;
|
package/lib/models/Event.js
CHANGED
|
@@ -15,4 +15,4 @@ var VaniEvent;
|
|
|
15
15
|
VaniEvent["OnLog"] = "OnLog";
|
|
16
16
|
VaniEvent["OnNewChatMessageReceived"] = "OnNewChatMessageReceived";
|
|
17
17
|
VaniEvent["OnClientPingRecieved"] = "OnClientPingRecieved";
|
|
18
|
-
})(VaniEvent
|
|
18
|
+
})(VaniEvent || (exports.VaniEvent = VaniEvent = {}));
|
package/lib/models/Logs.js
CHANGED
|
@@ -6,12 +6,12 @@ var ChatMessageType;
|
|
|
6
6
|
ChatMessageType["Chat"] = "chat";
|
|
7
7
|
ChatMessageType["File"] = "file";
|
|
8
8
|
ChatMessageType["Info"] = "info";
|
|
9
|
-
})(ChatMessageType
|
|
9
|
+
})(ChatMessageType || (exports.ChatMessageType = ChatMessageType = {}));
|
|
10
10
|
var ChatSendVia;
|
|
11
11
|
(function (ChatSendVia) {
|
|
12
12
|
ChatSendVia["WebSocket"] = "WebSocket";
|
|
13
13
|
ChatSendVia["DataChannel"] = "DataChannel";
|
|
14
|
-
})(ChatSendVia
|
|
14
|
+
})(ChatSendVia || (exports.ChatSendVia = ChatSendVia = {}));
|
|
15
15
|
class MessagePayload {
|
|
16
16
|
message;
|
|
17
17
|
to = "all";
|
|
@@ -5,7 +5,7 @@ var ConnectionProtocol;
|
|
|
5
5
|
(function (ConnectionProtocol) {
|
|
6
6
|
ConnectionProtocol["TCP"] = "TCP";
|
|
7
7
|
ConnectionProtocol["UDP"] = "UDP";
|
|
8
|
-
})(ConnectionProtocol
|
|
8
|
+
})(ConnectionProtocol || (exports.ConnectionProtocol = ConnectionProtocol = {}));
|
|
9
9
|
var LogLevel;
|
|
10
10
|
(function (LogLevel) {
|
|
11
11
|
LogLevel[LogLevel["None"] = 4] = "None";
|
|
@@ -13,7 +13,7 @@ var LogLevel;
|
|
|
13
13
|
LogLevel[LogLevel["Info"] = 2] = "Info";
|
|
14
14
|
LogLevel[LogLevel["Warn"] = 1] = "Warn";
|
|
15
15
|
LogLevel[LogLevel["Error"] = 0] = "Error";
|
|
16
|
-
})(LogLevel
|
|
16
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
17
17
|
class WebSocketServerStartRequest {
|
|
18
18
|
port = 4010;
|
|
19
19
|
redisUrl = "redis://127.0.0.1:6379";
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { Consumer } from "mediasoup/node/lib/Consumer";
|
|
2
|
-
import { Producer } from "mediasoup/node/lib/Producer";
|
|
3
|
-
import { Router } from "mediasoup/node/lib/Router";
|
|
4
|
-
import { Worker } from "mediasoup/node/lib/Worker";
|
|
5
1
|
import { BaseSFUWebsocket } from "../base/BaseSFUWebsocket";
|
|
6
2
|
import { Participant } from "../models/Participant";
|
|
7
3
|
import { ConnectionProtocol } from "../models/WebSocketServerStartRequest";
|
|
8
4
|
import { PlainTransportPayload } from "../ServerHandler";
|
|
9
5
|
import { MultiSystemEventsBody, SFUMessageType } from "../websocket/EachSocketConnectionHandler";
|
|
10
6
|
import { SFUEachRoomUserHandler } from "./SFUEachRoomUserHandler";
|
|
7
|
+
import { Consumer } from "mediasoup/node/lib/ConsumerTypes";
|
|
8
|
+
import { Producer, Router, Worker } from "mediasoup/node/lib/types";
|
|
11
9
|
export interface SFUEachRoomParticipantInterface {
|
|
12
10
|
participant: Participant;
|
|
13
11
|
}
|
|
@@ -56,6 +54,7 @@ export declare class SFUEachRoomHandler extends BaseSFUWebsocket implements SFUE
|
|
|
56
54
|
getConnectionProtocolType(): ConnectionProtocol;
|
|
57
55
|
onMutiRoomMessage: (message: MultiSystemEventsBody) => Promise<void>;
|
|
58
56
|
onNewMessage(payload: SFUMessageBody, participant: Participant): void;
|
|
57
|
+
private reloadSFU;
|
|
59
58
|
private getEachRoomUserFromParticipant;
|
|
60
59
|
private onGetRTPCapabilities;
|
|
61
60
|
private setUpForRoomId;
|
|
@@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.SFUEachRoomHandler = void 0;
|
|
27
|
+
// import { PlainTransport } from "mediasoup/node/lib/PlainTransport";
|
|
27
28
|
const BaseSFUWebsocket_1 = require("../base/BaseSFUWebsocket");
|
|
28
29
|
const RedisHandler_1 = require("../lib/redis/RedisHandler");
|
|
29
30
|
const Event_1 = require("../models/Event");
|
|
@@ -120,6 +121,9 @@ class SFUEachRoomHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
|
|
|
120
121
|
if (payload.type === EachSocketConnectionHandler_1.SFUMessageType.GetRouterRtpCapabilities) {
|
|
121
122
|
this.onGetRTPCapabilities(participant);
|
|
122
123
|
}
|
|
124
|
+
else if (payload.type === EachSocketConnectionHandler_1.SFUMessageType.ReloadSFU) {
|
|
125
|
+
this.reloadSFU(participant);
|
|
126
|
+
}
|
|
123
127
|
else {
|
|
124
128
|
if (this.isInitInProgress === true) {
|
|
125
129
|
ServerHandler_1.ServerHandler.getInstance().serverStartRequest && ServerHandler_1.ServerHandler.getInstance().serverStartRequest.logLevel !== WebSocketServerStartRequest_1.LogLevel.None && console.log("Init in Progess for RoomId:", this.roomId);
|
|
@@ -137,6 +141,14 @@ class SFUEachRoomHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
|
|
|
137
141
|
}
|
|
138
142
|
Utility_1.Utility.checkAndSendLogs({ logLevel: WebSocketServerStartRequest_1.LogLevel.Info, roomId: this.roomId, payload: payload, logType: Logs_1.LogType.LogTypeSFU });
|
|
139
143
|
}
|
|
144
|
+
reloadSFU = async (participant) => {
|
|
145
|
+
const sfuEachRoomUser = this.getEachRoomUserFromParticipant(participant);
|
|
146
|
+
if (sfuEachRoomUser) {
|
|
147
|
+
sfuEachRoomUser.cleanUp();
|
|
148
|
+
this.roomPaticipants.delete(participant.userId);
|
|
149
|
+
this.redisBroadcastMessageToTopic(participant.userId, this.preapreClientMessageBody(true, participant, this.preapreWebSocketMessageBody(EachSocketConnectionHandler_1.SFUMessageType.ReloadSFUCleanUpDone, {})));
|
|
150
|
+
}
|
|
151
|
+
};
|
|
140
152
|
getEachRoomUserFromParticipant(participant) {
|
|
141
153
|
if (this.sendRouter && this.recvRouter.length > 0) {
|
|
142
154
|
if (this.roomPaticipants.has(participant.userId)) {
|
|
@@ -413,7 +425,7 @@ class SFUEachRoomHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
|
|
|
413
425
|
try {
|
|
414
426
|
this.plainTransportConsumers.push(await plainTransport.consume({
|
|
415
427
|
producerId: producer.id,
|
|
416
|
-
rtpCapabilities: this.sendRouter.rtpCapabilities,
|
|
428
|
+
rtpCapabilities: this.sendRouter.rtpCapabilities, // Assume the recorder supports same formats as mediasoup's router
|
|
417
429
|
paused: true,
|
|
418
430
|
}));
|
|
419
431
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Router } from "mediasoup/node/lib/Router";
|
|
2
1
|
import { BaseSFUWebsocket } from "../base/BaseSFUWebsocket";
|
|
3
2
|
import { Participant } from "../models/Participant";
|
|
4
3
|
import { SFUEachRoomHandlerInterface, SFUMessageBody } from "./SFUEachRoomHandler";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { Router } from "mediasoup/node/lib/RouterTypes";
|
|
5
|
+
import { Producer } from "mediasoup/node/lib/ProducerTypes";
|
|
6
|
+
import { Consumer } from "mediasoup/node/lib/ConsumerTypes";
|
|
7
7
|
export declare class SFUEachRoomUserHandler extends BaseSFUWebsocket {
|
|
8
8
|
private isUserPresentInRoom;
|
|
9
9
|
selfParticipant: Participant;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RtpCodecCapability } from "mediasoup/node/lib/
|
|
1
|
+
import { RtpCodecCapability } from "mediasoup/node/lib/rtpParametersTypes";
|
|
2
2
|
import { ConnectionProtocol } from "../models/WebSocketServerStartRequest";
|
|
3
3
|
export declare const mediaCodecs: RtpCodecCapability[];
|
|
4
4
|
export declare function webrtcTransportConfiguration(perferProtocol: ConnectionProtocol): Promise<{
|
package/lib/utility/Constant.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.mediaCodecs = void 0;
|
|
4
|
+
exports.webrtcTransportConfiguration = webrtcTransportConfiguration;
|
|
5
|
+
exports.getPublicIp = getPublicIp;
|
|
6
|
+
exports.plainTransportConfiguration = plainTransportConfiguration;
|
|
4
7
|
const WebSocketServerStartRequest_1 = require("../models/WebSocketServerStartRequest");
|
|
5
8
|
const ServerHandler_1 = require("../ServerHandler");
|
|
6
9
|
const publicIp = require('public-ip');
|
|
@@ -60,7 +63,6 @@ async function webrtcTransportConfiguration(perferProtocol) {
|
|
|
60
63
|
enableSctp: true,
|
|
61
64
|
};
|
|
62
65
|
}
|
|
63
|
-
exports.webrtcTransportConfiguration = webrtcTransportConfiguration;
|
|
64
66
|
;
|
|
65
67
|
async function getPublicIp() {
|
|
66
68
|
if (!publicIpAddress) {
|
|
@@ -68,7 +70,6 @@ async function getPublicIp() {
|
|
|
68
70
|
}
|
|
69
71
|
return publicIpAddress;
|
|
70
72
|
}
|
|
71
|
-
exports.getPublicIp = getPublicIp;
|
|
72
73
|
async function plainTransportConfiguration() {
|
|
73
74
|
if (!publicIpAddress) {
|
|
74
75
|
publicIpAddress = await publicIp.v4();
|
|
@@ -79,6 +80,5 @@ async function plainTransportConfiguration() {
|
|
|
79
80
|
listenIp: { ip: '0.0.0.0', announcedIp: publicIpAddress },
|
|
80
81
|
};
|
|
81
82
|
}
|
|
82
|
-
exports.plainTransportConfiguration = plainTransportConfiguration;
|
|
83
83
|
;
|
|
84
84
|
exports.default = { plainTransportConfiguration, webrtcTransportConfiguration, getPublicIp };
|
|
@@ -35,6 +35,8 @@ export declare enum WebSocketBasicEvents {
|
|
|
35
35
|
export declare enum SFUMessageType {
|
|
36
36
|
SFUMessage = "sfuMessage",
|
|
37
37
|
GetRouterRtpCapabilities = "routerRtpCapabilities",
|
|
38
|
+
ReloadSFU = "reloadSFU",
|
|
39
|
+
ReloadSFUCleanUpDone = "ReloadSFUCleanUpDone",
|
|
38
40
|
OnRouterRtpCapabilities = "onRouterRtpCapabilities",
|
|
39
41
|
OnTransportConnect = "transportConnect",
|
|
40
42
|
OnCreateTransports = "createTransports",
|
|
@@ -47,11 +47,13 @@ var WebSocketBasicEvents;
|
|
|
47
47
|
WebSocketBasicEvents["Message"] = "message";
|
|
48
48
|
WebSocketBasicEvents["OnChat"] = "chat";
|
|
49
49
|
WebSocketBasicEvents["SelfLeft"] = "selfLeft";
|
|
50
|
-
})(WebSocketBasicEvents
|
|
50
|
+
})(WebSocketBasicEvents || (exports.WebSocketBasicEvents = WebSocketBasicEvents = {}));
|
|
51
51
|
var SFUMessageType;
|
|
52
52
|
(function (SFUMessageType) {
|
|
53
53
|
SFUMessageType["SFUMessage"] = "sfuMessage";
|
|
54
54
|
SFUMessageType["GetRouterRtpCapabilities"] = "routerRtpCapabilities";
|
|
55
|
+
SFUMessageType["ReloadSFU"] = "reloadSFU";
|
|
56
|
+
SFUMessageType["ReloadSFUCleanUpDone"] = "ReloadSFUCleanUpDone";
|
|
55
57
|
SFUMessageType["OnRouterRtpCapabilities"] = "onRouterRtpCapabilities";
|
|
56
58
|
SFUMessageType["OnTransportConnect"] = "transportConnect";
|
|
57
59
|
SFUMessageType["OnCreateTransports"] = "createTransports";
|
|
@@ -87,7 +89,7 @@ var SFUMessageType;
|
|
|
87
89
|
// );
|
|
88
90
|
// }
|
|
89
91
|
SFUMessageType["OnProducerNotFound"] = "OnProducerNotFound";
|
|
90
|
-
})(SFUMessageType
|
|
92
|
+
})(SFUMessageType || (exports.SFUMessageType = SFUMessageType = {}));
|
|
91
93
|
var MultiSystemEvents;
|
|
92
94
|
(function (MultiSystemEvents) {
|
|
93
95
|
MultiSystemEvents["OnNewServerJoinedForRoom"] = "OnNewServerJoinedForRoom";
|
|
@@ -96,14 +98,14 @@ var MultiSystemEvents;
|
|
|
96
98
|
MultiSystemEvents["OnConnectPipe"] = "OnConnectPipe";
|
|
97
99
|
MultiSystemEvents["OnPipeConnected"] = "OnPipeConnected";
|
|
98
100
|
MultiSystemEvents["OnPipeClosed"] = "OnPipeClosed";
|
|
99
|
-
})(MultiSystemEvents
|
|
101
|
+
})(MultiSystemEvents || (exports.MultiSystemEvents = MultiSystemEvents = {}));
|
|
100
102
|
var LocalMessageType;
|
|
101
103
|
(function (LocalMessageType) {
|
|
102
104
|
LocalMessageType["OnNewUserJoinedRoom"] = "onNewUserJoinedRoom";
|
|
103
105
|
LocalMessageType["OnUserLeft"] = "OnUserLeft";
|
|
104
106
|
LocalMessageType["SocketMessage"] = "socketMessage";
|
|
105
107
|
LocalMessageType["SelfLeftForceFully"] = "SelfLeftForceFully";
|
|
106
|
-
})(LocalMessageType
|
|
108
|
+
})(LocalMessageType || (exports.LocalMessageType = LocalMessageType = {}));
|
|
107
109
|
class EachSocketConnectionHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
|
|
108
110
|
uuid = (0, uuid_1.v4)();
|
|
109
111
|
socket;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vani-meeting-server",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.7",
|
|
4
4
|
"description": "Vani Meeting Server SDK",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dotenv": "^16.0.2",
|
|
32
32
|
"express": "^4.18.1",
|
|
33
33
|
"helmet": "^6.0.0",
|
|
34
|
-
"mediasoup": "^3.
|
|
34
|
+
"mediasoup": "^3.15.3",
|
|
35
35
|
"public-ip": "4.0.3",
|
|
36
36
|
"typescript": "^5.6.2",
|
|
37
37
|
"uuid": "^9.0.0",
|