@ipcom/asterisk-ari 0.0.35 → 0.0.36
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/esm/index.js
CHANGED
|
@@ -1911,13 +1911,18 @@ var AriClient = class {
|
|
|
1911
1911
|
* @throws {Error} Throws an error if the WebSocket client is not connected when this method is called.
|
|
1912
1912
|
* @returns {void} This function doesn't return a value.
|
|
1913
1913
|
*/
|
|
1914
|
-
|
|
1915
|
-
if (!this.isWebSocketConnectedFlag) {
|
|
1916
|
-
throw new Error("WebSocket ainda n\xE3o est\xE1 conectado.");
|
|
1917
|
-
}
|
|
1914
|
+
onWebSocketEvent(event, callback) {
|
|
1918
1915
|
if (!this.wsClient) {
|
|
1919
|
-
|
|
1916
|
+
console.error("WebSocket n\xE3o est\xE1 configurado.");
|
|
1917
|
+
return;
|
|
1918
|
+
}
|
|
1919
|
+
if (!this.isWebSocketConnectedFlag) {
|
|
1920
|
+
console.warn(
|
|
1921
|
+
"WebSocket ainda n\xE3o est\xE1 conectado. Tentando reconectar..."
|
|
1922
|
+
);
|
|
1923
|
+
return;
|
|
1920
1924
|
}
|
|
1925
|
+
console.log(`Registrando listener para evento: ${event}`);
|
|
1921
1926
|
this.wsClient.on(event, callback);
|
|
1922
1927
|
}
|
|
1923
1928
|
/**
|