1
votes

I am trying to the get the values of SID, RID and JID from the strophe connection and trying to pass them to converse.js. I am running the example that comes with strophe and I am able to get the message with all the values but i can not retrieve the values from the element.

 <body rid='629033749' xmlns='http://jabber.org/protocol/httpbind' sid='c270b6b5' to='127.0.0.1' xml:lang='en' xmpp:restart='true' xmlns:xmpp='urn:xmpp:xbosh'/>

I have tried connection.sid but returns as undefined. Can some one help me with this please?

1
Your initial session creation should return a SID. How are you initially connecting?Mark S
Thanks for the response Mark....I finally got it working after i used connection._proto.ridMahi

1 Answers

1
votes

Just for the record, Another way with converse.js is setting to true expose_rid_and_sid at the time of initializing converse.js

converse.initialize({
     prebind: false,
     bosh_service_url: BOSH_SERVICE,
     show_controlbox_by_default: true,
     expose_rid_and_sid: true
});

and after that you cant get RID and SID with

converse.getSID();
converse.getRID();

or, if you have a newer version, you could use

converse.tokens.get('sid');
converse.tokens.get('rid');