I have an issue at work and I can't find a solution. I know StackOverflow questions aren't for documentation, but apparently the documentation for node-xmpp is rather... "light".
My problem is the following:
I have an xmpp client connected to a server. This server is used to send notifications to my client when it's REST API is called. Basically the HTTP Request will get a 202 code if the server determines the request looks OK and will return the full XML answer through XMPP protocol.
For those who may have some insight on this specific matter: I am trying to use Cisco Finesse API Notifications system.
I managed to view those notifications using Pidgin, but the only way to see them is to open the XMPP console (and not the regular chat flow).
Now I managed to log in to this XMPP server using node-xmpp but I just can't read notifications. I tried to listen on "data" and "stanza" events, but it never triggers those events.
Here is the code excerpt:
const XMPP = require("node-xmpp-client");
let xmpp_client = new XMPP({
jid: json_message.login + '@abc.inc',
password: json_message.pwd,
host: CONF.FINESSE_SERVER.replace("http://", ""),
port: 5222
});
console.log("jid: " + json_message.login + '@abc.inc');
console.log("password: " + json_message.pwd);
console.log("host: " + CONF.FINESSE_SERVER.replace("http://", ""));
console.log("post: 5222");
xmpp_client.on("online", function(){
console.log("online");
});
xmpp_client.on('stanza', function(stanza) {
console.log("xmpp::");
console.log('Incoming stanza: ');
console.log(stanza);
});
xmpp_client.connection.on("data", function(data) {
console.log(data.toString("utf-8"));
});
I am a bit confused right now because the documentation from Cisco doesn't detail anything about JavaScript and the node-xmpp documentation is super short.
Any help is welcome, thanks in advance people! \o/