@ipcom/asterisk-ari 0.0.120 → 0.0.121
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/dist/cjs/index.cjs
CHANGED
|
@@ -2241,6 +2241,11 @@ var AriClient = class {
|
|
|
2241
2241
|
if (!app) {
|
|
2242
2242
|
throw new Error("O nome do aplicativo \xE9 obrigat\xF3rio.");
|
|
2243
2243
|
}
|
|
2244
|
+
console.log(`Conectando WebSocket para o app '${app}'...`);
|
|
2245
|
+
if (this.wsClients.has(app)) {
|
|
2246
|
+
console.log(`WebSocket para '${app}' j\xE1 est\xE1 conectado.`);
|
|
2247
|
+
return;
|
|
2248
|
+
}
|
|
2244
2249
|
if (this.webSocketReady.get(app)) {
|
|
2245
2250
|
console.log(`Conex\xE3o WebSocket para '${app}' j\xE1 est\xE1 ativa.`);
|
|
2246
2251
|
return this.webSocketReady.get(app);
|
|
@@ -2308,16 +2313,22 @@ var AriClient = class {
|
|
|
2308
2313
|
return;
|
|
2309
2314
|
}
|
|
2310
2315
|
const eventHandlers = {
|
|
2316
|
+
StasisStart: (data) => {
|
|
2317
|
+
console.log(`[${app}] Evento 'StasisStart' recebido:`, data);
|
|
2318
|
+
},
|
|
2311
2319
|
PlaybackStarted: (data) => {
|
|
2312
2320
|
if ("playbackId" in data) {
|
|
2321
|
+
console.log(`[${app}] PlaybackStarted:`, data);
|
|
2313
2322
|
}
|
|
2314
2323
|
},
|
|
2315
2324
|
PlaybackFinished: (data) => {
|
|
2316
2325
|
if ("playbackId" in data) {
|
|
2326
|
+
console.log(`[${app}] PlaybackFinished:`, data);
|
|
2317
2327
|
}
|
|
2318
2328
|
},
|
|
2319
2329
|
ChannelDtmfReceived: (data) => {
|
|
2320
2330
|
if (data.type === "ChannelDtmfReceived" && "digit" in data) {
|
|
2331
|
+
console.log(`[${app}] DTMF recebido: ${data.digit}`);
|
|
2321
2332
|
} else {
|
|
2322
2333
|
console.warn(
|
|
2323
2334
|
`[${app}] Evento inesperado em ChannelDtmfReceived`,
|
|
@@ -2327,6 +2338,7 @@ var AriClient = class {
|
|
|
2327
2338
|
},
|
|
2328
2339
|
ChannelStateChange: (data) => {
|
|
2329
2340
|
if ("channel" in data) {
|
|
2341
|
+
console.log(`[${app}] Estado do canal alterado:`, data.channel);
|
|
2330
2342
|
}
|
|
2331
2343
|
}
|
|
2332
2344
|
};
|