cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1663
Views
0
Helpful
3
Replies

how to get once the stanza from the xmpp connection

windleaf5188
Level 1
Level 1

Hi, I use Finesse Cisco Finesse 11.5 API for my website, when I use xmpp to connect finesse, I can get the message of stanza from xmpp. But the problem is when I refresh the webpage, I have to connect again the xmpp, and then I will get twice the same message of stanza from xmpp. So is there a method can check if xmpp is connected or not? If it is connected, we can ignore and not execute the connection of xmpp. Or if we have got a stanza, then the xmpp will not send the same stanza again. here is my code xmpp with sample-xmpp:


var xmpp = require('simple-xmpp');

xmpp.connect({

  jid : ID,

  password : PSW,

  host : HOST,

  port : PORT
});

xmpp.send("finesse@xxx.mcra.fr", `<presence to="finesse@xxx.tel.mcra.fr" type="subscribe" />`);

xmpp.on("stanza", function(stanza){

//function

});

1 Accepted Solution

Accepted Solutions

Hi,

I haven't used too many xmpp libraries. The only one I've tried is for python, but you can get a list here: https://xmpp.org/software/libraries.html

Here is the sample I created using python: https://github.com/CiscoDevNet/finesse-sample-code/tree/master/NonGadgetPythonSample

Thanx,

Denise

View solution in original post

3 Replies 3

dekwan
Cisco Employee
Cisco Employee

Hi,

Which library are you using for your xmpp connection. My initial thought is to see if you can check the presence of the user to see if they are connected or not.

Thanx,

Denise

Hello, I use simple-xmpp for the nodejs,but I find it is not very good when I use it for the back-end. Do you have a good library for the front-end? And can you give me a example to get the stanza from finesse API with your library xmpp? Thank you very much !

Hi,

I haven't used too many xmpp libraries. The only one I've tried is for python, but you can get a list here: https://xmpp.org/software/libraries.html

Here is the sample I created using python: https://github.com/CiscoDevNet/finesse-sample-code/tree/master/NonGadgetPythonSample

Thanx,

Denise