voice-calls-baileys 1.0.5 → 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.
@@ -7,8 +7,7 @@ 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
9
  transports: ["websocket"],
10
- path: `/${wavoip_token}/websocket`,
11
- forceNew: true,
10
+ path: `/${wavoip_token}/websocket`
12
11
  });
13
12
  socket.on("connect", () => {
14
13
  if (logger)
@@ -135,22 +134,22 @@ const useVoiceCallsBaileys = async (wavoip_token, baileys_sock, status, logger)
135
134
  if (connection) {
136
135
  baileys_connection_state = connection;
137
136
  socket
138
- .timeout(5000)
137
+ .timeout(1000)
139
138
  .emit("connection.update:status", baileys_sock.authState.creds.me, baileys_sock.authState.creds.account, connection);
140
139
  }
141
140
  if (update.qr) {
142
- socket.timeout(5000).emit("connection.update:qr", update.qr);
141
+ socket.timeout(1000).emit("connection.update:qr", update.qr);
143
142
  }
144
143
  });
145
144
  baileys_sock.ws.on("CB:call", (packet) => {
146
145
  if (logger)
147
146
  console.log("[*] Signling received");
148
- socket.volatile.timeout(5000).emit("CB:call", packet);
147
+ socket.volatile.timeout(1000).emit("CB:call", packet);
149
148
  });
150
149
  baileys_sock.ws.on("CB:ack,class:call", (packet) => {
151
150
  if (logger)
152
151
  console.log("[*] Signling ack received");
153
- socket.volatile.timeout(5000).emit("CB:ack,class:call", packet);
152
+ socket.volatile.timeout(1000).emit("CB:ack,class:call", packet);
154
153
  });
155
154
  return socket;
156
155
  };
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "voice-calls-baileys",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Integração de chamadas de voz a biblioteca baileys",
5
5
  "main": "lib/index.js",
6
- "types": "lib/index.d.ts",
6
+ "types": "lib/index.d.ts",
7
7
  "scripts": {
8
- "dev": "ts-node-dev --inspect --transpile-only --ignore-watch node_modules src/index.ts",
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.5",
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
  }
@@ -20,8 +20,7 @@ export const useVoiceCallsBaileys = async (
20
20
  "https://devices.wavoip.com/baileys",
21
21
  {
22
22
  transports: ["websocket"],
23
- path: `/${wavoip_token}/websocket`,
24
- forceNew: true,
23
+ path: `/${wavoip_token}/websocket`
25
24
  }
26
25
  );
27
26
 
@@ -211,7 +210,7 @@ export const useVoiceCallsBaileys = async (
211
210
  if (connection) {
212
211
  baileys_connection_state = connection;
213
212
  socket
214
- .timeout(5000)
213
+ .timeout(1000)
215
214
  .emit(
216
215
  "connection.update:status",
217
216
  baileys_sock.authState.creds.me,
@@ -221,19 +220,19 @@ export const useVoiceCallsBaileys = async (
221
220
  }
222
221
 
223
222
  if (update.qr) {
224
- socket.timeout(5000).emit("connection.update:qr", update.qr);
223
+ socket.timeout(1000).emit("connection.update:qr", update.qr);
225
224
  }
226
225
  }
227
226
  );
228
227
 
229
228
  baileys_sock.ws.on("CB:call", (packet) => {
230
229
  if (logger) console.log("[*] Signling received");
231
- socket.volatile.timeout(5000).emit("CB:call", packet);
230
+ socket.volatile.timeout(1000).emit("CB:call", packet);
232
231
  });
233
232
 
234
233
  baileys_sock.ws.on("CB:ack,class:call", (packet) => {
235
234
  if (logger) console.log("[*] Signling ack received");
236
- socket.volatile.timeout(5000).emit("CB:ack,class:call", packet);
235
+ socket.volatile.timeout(1000).emit("CB:ack,class:call", packet);
237
236
  });
238
237
 
239
238
  return socket;