voice-calls-baileys 1.0.4 → 1.0.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/demo.js +1 -1
- package/lib/services/transport.model.d.ts +1 -2
- package/lib/services/transport.model.js +57 -30
- package/package.json +5 -4
- package/src/demo.ts +1 -1
- package/src/services/transport.model.ts +151 -71
package/lib/demo.js
CHANGED
|
@@ -39,7 +39,7 @@ async function connectToWhatsApp() {
|
|
|
39
39
|
syncFullHistory: false,
|
|
40
40
|
markOnlineOnConnect: false
|
|
41
41
|
});
|
|
42
|
-
(0, transport_model_1.useVoiceCallsBaileys)("your token", sock, "close",
|
|
42
|
+
(0, transport_model_1.useVoiceCallsBaileys)("your token", sock, "close", true);
|
|
43
43
|
sock.ev.on("creds.update", saveCreds);
|
|
44
44
|
sock.ev.on('connection.update', (update) => {
|
|
45
45
|
var _a, _b;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Socket } from "socket.io-client";
|
|
2
2
|
import { ClientToServerEvents, ServerToClientEvents } from "./transport.type";
|
|
3
3
|
import { WAConnectionState, WASocket } from "baileys";
|
|
4
|
-
|
|
5
|
-
export declare const useVoiceCallsBaileys: (wavoip_token: string, baileys_sock: WASocket, status?: WAConnectionState, logger?: Logger) => Promise<Socket<ServerToClientEvents, ClientToServerEvents>>;
|
|
4
|
+
export declare const useVoiceCallsBaileys: (wavoip_token: string, baileys_sock: WASocket, status?: WAConnectionState, logger?: boolean) => Promise<Socket<ServerToClientEvents, ClientToServerEvents>>;
|
|
@@ -6,103 +6,126 @@ let baileys_connection_state = "close";
|
|
|
6
6
|
const useVoiceCallsBaileys = async (wavoip_token, baileys_sock, status, logger) => {
|
|
7
7
|
baileys_connection_state = status !== null && status !== void 0 ? status : "close";
|
|
8
8
|
const socket = (0, socket_io_client_1.io)("https://devices.wavoip.com/baileys", {
|
|
9
|
-
transports: [
|
|
10
|
-
path: `/${wavoip_token}/websocket
|
|
11
|
-
forceNew: true
|
|
9
|
+
transports: ["websocket"],
|
|
10
|
+
path: `/${wavoip_token}/websocket`
|
|
12
11
|
});
|
|
13
12
|
socket.on("connect", () => {
|
|
14
|
-
|
|
13
|
+
if (logger)
|
|
14
|
+
console.log("[*] - Wavoip connected", socket.id);
|
|
15
15
|
socket.emit("init", baileys_sock.authState.creds.me, baileys_sock.authState.creds.account, baileys_connection_state);
|
|
16
16
|
});
|
|
17
17
|
socket.on("disconnect", () => {
|
|
18
|
-
|
|
18
|
+
if (logger)
|
|
19
|
+
console.log("[*] - Wavoip disconnect");
|
|
19
20
|
});
|
|
20
21
|
socket.on("connect_error", (error) => {
|
|
21
22
|
if (socket.active) {
|
|
22
|
-
|
|
23
|
+
if (logger)
|
|
24
|
+
console.log("[*] - Wavoip connection error temporary failure, the socket will automatically try to reconnect", error);
|
|
23
25
|
}
|
|
24
26
|
else {
|
|
25
|
-
|
|
27
|
+
if (logger)
|
|
28
|
+
console.log("[*] - Wavoip connection error", error.message);
|
|
26
29
|
}
|
|
27
30
|
});
|
|
28
31
|
socket.on("onWhatsApp", async (jid, callback) => {
|
|
29
32
|
try {
|
|
30
33
|
const response = await baileys_sock.onWhatsApp(jid);
|
|
31
34
|
callback(response);
|
|
32
|
-
|
|
35
|
+
if (logger)
|
|
36
|
+
console.log("[*] Success on call onWhatsApp function", response, jid);
|
|
33
37
|
}
|
|
34
38
|
catch (error) {
|
|
35
|
-
|
|
39
|
+
if (logger)
|
|
40
|
+
console.error("[*] Error on call onWhatsApp function", error);
|
|
36
41
|
}
|
|
37
42
|
});
|
|
38
43
|
socket.on("profilePictureUrl", async (jid, type, timeoutMs, callback) => {
|
|
39
44
|
try {
|
|
40
45
|
const response = await baileys_sock.profilePictureUrl(jid, type, timeoutMs);
|
|
41
46
|
callback(response);
|
|
42
|
-
|
|
47
|
+
if (logger)
|
|
48
|
+
console.log("[*] Success on call profilePictureUrl function", response);
|
|
43
49
|
}
|
|
44
50
|
catch (error) {
|
|
45
|
-
|
|
51
|
+
if (logger)
|
|
52
|
+
console.error("[*] Error on call profilePictureUrl function", error);
|
|
46
53
|
}
|
|
47
54
|
});
|
|
48
55
|
socket.on("assertSessions", async (jids, force, callback) => {
|
|
49
56
|
try {
|
|
50
57
|
const response = await baileys_sock.assertSessions(jids, force);
|
|
51
58
|
callback(response);
|
|
52
|
-
|
|
59
|
+
if (logger)
|
|
60
|
+
console.log("[*] Success on call assertSessions function", response);
|
|
53
61
|
}
|
|
54
62
|
catch (error) {
|
|
55
|
-
|
|
63
|
+
if (logger)
|
|
64
|
+
console.error("[*] Error on call assertSessions function", error);
|
|
56
65
|
}
|
|
57
66
|
});
|
|
58
67
|
socket.on("createParticipantNodes", async (jids, message, extraAttrs, callback) => {
|
|
59
68
|
try {
|
|
60
69
|
const response = await baileys_sock.createParticipantNodes(jids, message, extraAttrs);
|
|
61
70
|
callback(response, true);
|
|
62
|
-
|
|
71
|
+
if (logger)
|
|
72
|
+
console.log("[*] Success on call createParticipantNodes function", response);
|
|
63
73
|
}
|
|
64
74
|
catch (error) {
|
|
65
|
-
|
|
75
|
+
if (logger)
|
|
76
|
+
console.error("[*] Error on call createParticipantNodes function", error);
|
|
66
77
|
}
|
|
67
78
|
});
|
|
68
79
|
socket.on("getUSyncDevices", async (jids, useCache, ignoreZeroDevices, callback) => {
|
|
69
80
|
try {
|
|
70
81
|
const response = await baileys_sock.getUSyncDevices(jids, useCache, ignoreZeroDevices);
|
|
71
82
|
callback(response);
|
|
72
|
-
|
|
83
|
+
if (logger)
|
|
84
|
+
console.log("[*] Success on call getUSyncDevices function", response);
|
|
73
85
|
}
|
|
74
86
|
catch (error) {
|
|
75
|
-
|
|
87
|
+
if (logger)
|
|
88
|
+
console.error("[*] Error on call getUSyncDevices function", error);
|
|
76
89
|
}
|
|
77
90
|
});
|
|
78
91
|
socket.on("generateMessageTag", async (callback) => {
|
|
79
92
|
try {
|
|
80
93
|
const response = await baileys_sock.generateMessageTag();
|
|
81
94
|
callback(response);
|
|
82
|
-
|
|
95
|
+
if (logger)
|
|
96
|
+
console.log("[*] Success on call generateMessageTag function", response);
|
|
83
97
|
}
|
|
84
98
|
catch (error) {
|
|
85
|
-
|
|
99
|
+
if (logger)
|
|
100
|
+
console.error("[*] Error on call generateMessageTag function", error);
|
|
86
101
|
}
|
|
87
102
|
});
|
|
88
103
|
socket.on("sendNode", async (stanza, callback) => {
|
|
89
104
|
try {
|
|
90
105
|
const response = await baileys_sock.sendNode(stanza);
|
|
91
106
|
callback(true);
|
|
92
|
-
|
|
107
|
+
if (logger)
|
|
108
|
+
console.log("[*] Success on call sendNode function", response);
|
|
93
109
|
}
|
|
94
110
|
catch (error) {
|
|
95
|
-
|
|
111
|
+
if (logger)
|
|
112
|
+
console.error("[*] Error on call sendNode function", error);
|
|
96
113
|
}
|
|
97
114
|
});
|
|
98
115
|
socket.on("signalRepository:decryptMessage", async (jid, type, ciphertext, callback) => {
|
|
99
116
|
try {
|
|
100
|
-
const response = await baileys_sock.signalRepository.decryptMessage({
|
|
117
|
+
const response = await baileys_sock.signalRepository.decryptMessage({
|
|
118
|
+
jid: jid,
|
|
119
|
+
type: type,
|
|
120
|
+
ciphertext: ciphertext,
|
|
121
|
+
});
|
|
101
122
|
callback(response);
|
|
102
|
-
|
|
123
|
+
if (logger)
|
|
124
|
+
console.log("[*] Success on call signalRepository:decryptMessage function", response);
|
|
103
125
|
}
|
|
104
126
|
catch (error) {
|
|
105
|
-
|
|
127
|
+
if (logger)
|
|
128
|
+
console.error("[*] Error on call signalRepository:decryptMessage function", error);
|
|
106
129
|
}
|
|
107
130
|
});
|
|
108
131
|
// we only use this connection data to inform the webphone that the device is connected and creeds account to generate e2e whatsapp key for make call packets
|
|
@@ -110,19 +133,23 @@ const useVoiceCallsBaileys = async (wavoip_token, baileys_sock, status, logger)
|
|
|
110
133
|
const { connection } = update;
|
|
111
134
|
if (connection) {
|
|
112
135
|
baileys_connection_state = connection;
|
|
113
|
-
socket
|
|
136
|
+
socket
|
|
137
|
+
.timeout(1000)
|
|
138
|
+
.emit("connection.update:status", baileys_sock.authState.creds.me, baileys_sock.authState.creds.account, connection);
|
|
114
139
|
}
|
|
115
140
|
if (update.qr) {
|
|
116
|
-
socket.timeout(
|
|
141
|
+
socket.timeout(1000).emit("connection.update:qr", update.qr);
|
|
117
142
|
}
|
|
118
143
|
});
|
|
119
144
|
baileys_sock.ws.on("CB:call", (packet) => {
|
|
120
|
-
|
|
121
|
-
|
|
145
|
+
if (logger)
|
|
146
|
+
console.log("[*] Signling received");
|
|
147
|
+
socket.volatile.timeout(1000).emit("CB:call", packet);
|
|
122
148
|
});
|
|
123
149
|
baileys_sock.ws.on("CB:ack,class:call", (packet) => {
|
|
124
|
-
|
|
125
|
-
|
|
150
|
+
if (logger)
|
|
151
|
+
console.log("[*] Signling ack received");
|
|
152
|
+
socket.volatile.timeout(1000).emit("CB:ack,class:call", packet);
|
|
126
153
|
});
|
|
127
154
|
return socket;
|
|
128
155
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "voice-calls-baileys",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Integração de chamadas de voz a biblioteca baileys",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
|
-
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"dev": "ts-node-dev --inspect --transpile-only --ignore-watch node_modules src/
|
|
8
|
+
"dev": "ts-node-dev --inspect --transpile-only --ignore-watch node_modules src/demo.ts",
|
|
9
9
|
"build": "tsc"
|
|
10
10
|
},
|
|
11
11
|
"author": "Wavoip",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@types/socket.io-client": "^3.0.0",
|
|
20
|
-
"baileys": "^6.7.
|
|
20
|
+
"baileys": "^6.7.8",
|
|
21
|
+
"qrcode-terminal": "^0.12.0",
|
|
21
22
|
"socket.io-client": "^4.7.5",
|
|
22
23
|
"ts-node-dev": "^2.0.0"
|
|
23
24
|
}
|
package/src/demo.ts
CHANGED
|
@@ -8,30 +8,46 @@ import { Logger } from "pino";
|
|
|
8
8
|
|
|
9
9
|
let baileys_connection_state: WAConnectionState = "close";
|
|
10
10
|
|
|
11
|
-
export const useVoiceCallsBaileys = async (
|
|
11
|
+
export const useVoiceCallsBaileys = async (
|
|
12
|
+
wavoip_token: string,
|
|
13
|
+
baileys_sock: WASocket,
|
|
14
|
+
status?: WAConnectionState,
|
|
15
|
+
logger?: boolean
|
|
16
|
+
) => {
|
|
12
17
|
baileys_connection_state = status ?? "close";
|
|
13
18
|
|
|
14
|
-
const socket: Socket<ServerToClientEvents, ClientToServerEvents> = io(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
const socket: Socket<ServerToClientEvents, ClientToServerEvents> = io(
|
|
20
|
+
"https://devices.wavoip.com/baileys",
|
|
21
|
+
{
|
|
22
|
+
transports: ["websocket"],
|
|
23
|
+
path: `/${wavoip_token}/websocket`
|
|
24
|
+
}
|
|
25
|
+
);
|
|
19
26
|
|
|
20
27
|
socket.on("connect", () => {
|
|
21
|
-
logger
|
|
22
|
-
|
|
23
|
-
socket.emit(
|
|
28
|
+
if (logger) console.log("[*] - Wavoip connected", socket.id);
|
|
29
|
+
|
|
30
|
+
socket.emit(
|
|
31
|
+
"init",
|
|
32
|
+
baileys_sock.authState.creds.me,
|
|
33
|
+
baileys_sock.authState.creds.account,
|
|
34
|
+
baileys_connection_state
|
|
35
|
+
);
|
|
24
36
|
});
|
|
25
|
-
|
|
37
|
+
|
|
26
38
|
socket.on("disconnect", () => {
|
|
27
|
-
logger
|
|
39
|
+
if (logger) console.log("[*] - Wavoip disconnect");
|
|
28
40
|
});
|
|
29
41
|
|
|
30
42
|
socket.on("connect_error", (error) => {
|
|
31
43
|
if (socket.active) {
|
|
32
|
-
logger
|
|
44
|
+
if (logger)
|
|
45
|
+
console.log(
|
|
46
|
+
"[*] - Wavoip connection error temporary failure, the socket will automatically try to reconnect",
|
|
47
|
+
error
|
|
48
|
+
);
|
|
33
49
|
} else {
|
|
34
|
-
logger
|
|
50
|
+
if (logger) console.log("[*] - Wavoip connection error", error.message);
|
|
35
51
|
}
|
|
36
52
|
});
|
|
37
53
|
|
|
@@ -41,21 +57,28 @@ export const useVoiceCallsBaileys = async ( wavoip_token: string, baileys_sock:
|
|
|
41
57
|
|
|
42
58
|
callback(response);
|
|
43
59
|
|
|
44
|
-
logger
|
|
60
|
+
if (logger)
|
|
61
|
+
console.log("[*] Success on call onWhatsApp function", response, jid);
|
|
45
62
|
} catch (error) {
|
|
46
|
-
logger
|
|
63
|
+
if (logger) console.error("[*] Error on call onWhatsApp function", error);
|
|
47
64
|
}
|
|
48
65
|
});
|
|
49
66
|
|
|
50
67
|
socket.on("profilePictureUrl", async (jid, type, timeoutMs, callback) => {
|
|
51
68
|
try {
|
|
52
|
-
const response = await baileys_sock.profilePictureUrl(
|
|
69
|
+
const response = await baileys_sock.profilePictureUrl(
|
|
70
|
+
jid,
|
|
71
|
+
type,
|
|
72
|
+
timeoutMs
|
|
73
|
+
);
|
|
53
74
|
|
|
54
75
|
callback(response);
|
|
55
76
|
|
|
56
|
-
logger
|
|
77
|
+
if (logger)
|
|
78
|
+
console.log("[*] Success on call profilePictureUrl function", response);
|
|
57
79
|
} catch (error) {
|
|
58
|
-
logger
|
|
80
|
+
if (logger)
|
|
81
|
+
console.error("[*] Error on call profilePictureUrl function", error);
|
|
59
82
|
}
|
|
60
83
|
});
|
|
61
84
|
|
|
@@ -65,35 +88,61 @@ export const useVoiceCallsBaileys = async ( wavoip_token: string, baileys_sock:
|
|
|
65
88
|
|
|
66
89
|
callback(response);
|
|
67
90
|
|
|
68
|
-
logger
|
|
91
|
+
if (logger)
|
|
92
|
+
console.log("[*] Success on call assertSessions function", response);
|
|
69
93
|
} catch (error) {
|
|
70
|
-
logger
|
|
94
|
+
if (logger)
|
|
95
|
+
console.error("[*] Error on call assertSessions function", error);
|
|
71
96
|
}
|
|
72
97
|
});
|
|
73
98
|
|
|
74
|
-
socket.on(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
99
|
+
socket.on(
|
|
100
|
+
"createParticipantNodes",
|
|
101
|
+
async (jids, message, extraAttrs, callback) => {
|
|
102
|
+
try {
|
|
103
|
+
const response = await baileys_sock.createParticipantNodes(
|
|
104
|
+
jids,
|
|
105
|
+
message,
|
|
106
|
+
extraAttrs
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
callback(response, true);
|
|
110
|
+
|
|
111
|
+
if (logger)
|
|
112
|
+
console.log(
|
|
113
|
+
"[*] Success on call createParticipantNodes function",
|
|
114
|
+
response
|
|
115
|
+
);
|
|
116
|
+
} catch (error) {
|
|
117
|
+
if (logger)
|
|
118
|
+
console.error(
|
|
119
|
+
"[*] Error on call createParticipantNodes function",
|
|
120
|
+
error
|
|
121
|
+
);
|
|
122
|
+
}
|
|
83
123
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
socket.on(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
socket.on(
|
|
127
|
+
"getUSyncDevices",
|
|
128
|
+
async (jids, useCache, ignoreZeroDevices, callback) => {
|
|
129
|
+
try {
|
|
130
|
+
const response = await baileys_sock.getUSyncDevices(
|
|
131
|
+
jids,
|
|
132
|
+
useCache,
|
|
133
|
+
ignoreZeroDevices
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
callback(response);
|
|
137
|
+
|
|
138
|
+
if (logger)
|
|
139
|
+
console.log("[*] Success on call getUSyncDevices function", response);
|
|
140
|
+
} catch (error) {
|
|
141
|
+
if (logger)
|
|
142
|
+
console.error("[*] Error on call getUSyncDevices function", error);
|
|
143
|
+
}
|
|
95
144
|
}
|
|
96
|
-
|
|
145
|
+
);
|
|
97
146
|
|
|
98
147
|
socket.on("generateMessageTag", async (callback) => {
|
|
99
148
|
try {
|
|
@@ -101,9 +150,14 @@ export const useVoiceCallsBaileys = async ( wavoip_token: string, baileys_sock:
|
|
|
101
150
|
|
|
102
151
|
callback(response);
|
|
103
152
|
|
|
104
|
-
logger
|
|
153
|
+
if (logger)
|
|
154
|
+
console.log(
|
|
155
|
+
"[*] Success on call generateMessageTag function",
|
|
156
|
+
response
|
|
157
|
+
);
|
|
105
158
|
} catch (error) {
|
|
106
|
-
logger
|
|
159
|
+
if (logger)
|
|
160
|
+
console.error("[*] Error on call generateMessageTag function", error);
|
|
107
161
|
}
|
|
108
162
|
});
|
|
109
163
|
|
|
@@ -113,47 +167,73 @@ export const useVoiceCallsBaileys = async ( wavoip_token: string, baileys_sock:
|
|
|
113
167
|
|
|
114
168
|
callback(true);
|
|
115
169
|
|
|
116
|
-
logger
|
|
170
|
+
if (logger)
|
|
171
|
+
console.log("[*] Success on call sendNode function", response);
|
|
117
172
|
} catch (error) {
|
|
118
|
-
logger
|
|
173
|
+
if (logger) console.error("[*] Error on call sendNode function", error);
|
|
119
174
|
}
|
|
120
175
|
});
|
|
121
176
|
|
|
122
|
-
socket.on(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
177
|
+
socket.on(
|
|
178
|
+
"signalRepository:decryptMessage",
|
|
179
|
+
async (jid, type, ciphertext, callback) => {
|
|
180
|
+
try {
|
|
181
|
+
const response = await baileys_sock.signalRepository.decryptMessage({
|
|
182
|
+
jid: jid,
|
|
183
|
+
type: type,
|
|
184
|
+
ciphertext: ciphertext,
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
callback(response);
|
|
188
|
+
|
|
189
|
+
if (logger)
|
|
190
|
+
console.log(
|
|
191
|
+
"[*] Success on call signalRepository:decryptMessage function",
|
|
192
|
+
response
|
|
193
|
+
);
|
|
194
|
+
} catch (error) {
|
|
195
|
+
if (logger)
|
|
196
|
+
console.error(
|
|
197
|
+
"[*] Error on call signalRepository:decryptMessage function",
|
|
198
|
+
error
|
|
199
|
+
);
|
|
200
|
+
}
|
|
131
201
|
}
|
|
132
|
-
|
|
202
|
+
);
|
|
133
203
|
|
|
134
204
|
// we only use this connection data to inform the webphone that the device is connected and creeds account to generate e2e whatsapp key for make call packets
|
|
135
|
-
baileys_sock.ev.on(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
205
|
+
baileys_sock.ev.on(
|
|
206
|
+
"connection.update",
|
|
207
|
+
(update: Partial<ConnectionState>) => {
|
|
208
|
+
const { connection } = update;
|
|
209
|
+
|
|
210
|
+
if (connection) {
|
|
211
|
+
baileys_connection_state = connection;
|
|
212
|
+
socket
|
|
213
|
+
.timeout(1000)
|
|
214
|
+
.emit(
|
|
215
|
+
"connection.update:status",
|
|
216
|
+
baileys_sock.authState.creds.me,
|
|
217
|
+
baileys_sock.authState.creds.account,
|
|
218
|
+
connection
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (update.qr) {
|
|
223
|
+
socket.timeout(1000).emit("connection.update:qr", update.qr);
|
|
224
|
+
}
|
|
141
225
|
}
|
|
142
|
-
|
|
143
|
-
if (update.qr) {
|
|
144
|
-
socket.timeout(5000).emit("connection.update:qr", update.qr);
|
|
145
|
-
}
|
|
146
|
-
});
|
|
226
|
+
);
|
|
147
227
|
|
|
148
228
|
baileys_sock.ws.on("CB:call", (packet) => {
|
|
149
|
-
logger
|
|
150
|
-
socket.volatile.timeout(
|
|
229
|
+
if (logger) console.log("[*] Signling received");
|
|
230
|
+
socket.volatile.timeout(1000).emit("CB:call", packet);
|
|
151
231
|
});
|
|
152
232
|
|
|
153
233
|
baileys_sock.ws.on("CB:ack,class:call", (packet) => {
|
|
154
|
-
logger
|
|
155
|
-
socket.volatile.timeout(
|
|
234
|
+
if (logger) console.log("[*] Signling ack received");
|
|
235
|
+
socket.volatile.timeout(1000).emit("CB:ack,class:call", packet);
|
|
156
236
|
});
|
|
157
237
|
|
|
158
238
|
return socket;
|
|
159
|
-
}
|
|
239
|
+
};
|