Once the WebSocket connection is established, we attempt to start monitoring a specific device. However, after sending the device monitoring request, we do not receive any error response or device events through the WebSocket.
The issue can be summarized as follows:
We are using Node.js to establish the WebSocket connection and start the device monitoring.
The Node.js code used to establish the WebSocket connection and start monitoring the device is provided below:
import WebSocket from "ws";
const AES_IP = "10.0.1.XX";
const AES_PORT = 443;
const USERNAME = "UserName";
const PASSWORD = "Password";
const url = `wss://${AES_IP}:${AES_PORT}/api/wti/session`;
console.log("Connecting:", url);
const ws = new WebSocket(url, {
// HTTP Basic Authorization during WebSocket handshake
auth: `${USERNAME}:${PASSWORD}`,
// ONLY for testing if AES uses a self-signed certificate
rejectUnauthorized: false,
handshakeTimeout: 15000
});
ws.on("open", () => {
console.log("================================");
console.log("WTI WEBSOCKET CONNECTED");
console.log("================================");
console.log("Waiting 10 seconds before starting device monitor...");
setTimeout(() => {
startDeviceMonitor("200XXX:CM:0.0.0.0:0");
}, 10000);
});
function startDeviceMonitor(device) {
const request = {
Header: {
version: "1.0"
},
monitorObject: {
deviceObject: device
}
};
ws.send(JSON.stringify(request));
console.log("Start Device Monitor sent for:", device);
}
ws.on("message", (data) => {
const message = data.toString();
console.log("WTI EVENT:");
console.log(message);
try {
const event = JSON.parse(message);
console.log("Event:", event);
if (event.event) {
console.log("Event type:", event.event);
}
} catch (err) {
console.log("Received non-JSON message");
}
});
ws.on("error", (err) => {
console.error("WTI error:", err);
});
ws.on("close", (code, reason) => {
console.log("WTI disconnected:", code, reason.toString());
});
Could you please help us identify whether any additional steps, subscription, monitor configuration, or specific message format is required to receive device events through the Avaya AES 10.2 WebSocket API?
The issue can be summarized as follows:
- The WebSocket connection to Avaya AES is established successfully.
- The device monitoring request is sent after the WebSocket connection is established.
- No error is reported by the WebSocket connection.
- However, we are not receiving any events or notifications for the monitored device.
We are using Node.js to establish the WebSocket connection and start the device monitoring.
The Node.js code used to establish the WebSocket connection and start monitoring the device is provided below:
import WebSocket from "ws";
const AES_IP = "10.0.1.XX";
const AES_PORT = 443;
const USERNAME = "UserName";
const PASSWORD = "Password";
const url = `wss://${AES_IP}:${AES_PORT}/api/wti/session`;
console.log("Connecting:", url);
const ws = new WebSocket(url, {
// HTTP Basic Authorization during WebSocket handshake
auth: `${USERNAME}:${PASSWORD}`,
// ONLY for testing if AES uses a self-signed certificate
rejectUnauthorized: false,
handshakeTimeout: 15000
});
ws.on("open", () => {
console.log("================================");
console.log("WTI WEBSOCKET CONNECTED");
console.log("================================");
console.log("Waiting 10 seconds before starting device monitor...");
setTimeout(() => {
startDeviceMonitor("200XXX:CM:0.0.0.0:0");
}, 10000);
});
function startDeviceMonitor(device) {
const request = {
Header: {
version: "1.0"
},
monitorObject: {
deviceObject: device
}
};
ws.send(JSON.stringify(request));
console.log("Start Device Monitor sent for:", device);
}
ws.on("message", (data) => {
const message = data.toString();
console.log("WTI EVENT:");
console.log(message);
try {
const event = JSON.parse(message);
console.log("Event:", event);
if (event.event) {
console.log("Event type:", event.event);
}
} catch (err) {
console.log("Received non-JSON message");
}
});
ws.on("error", (err) => {
console.error("WTI error:", err);
});
ws.on("close", (code, reason) => {
console.log("WTI disconnected:", code, reason.toString());
});
Could you please help us identify whether any additional steps, subscription, monitor configuration, or specific message format is required to receive device events through the Avaya AES 10.2 WebSocket API?
