Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
AliVireTechnologies1 #1
Member since Jun 2013 · 58 posts
Group memberships: Members
Show profile · Link to this post
Subject: Presence is not working properly
presence is not sending receiving at both end, if one user is login already and then other user login, the first user is receiving the presence but the second user that is login later is not receiving the already login user presence, infect on_presence event is not calling for that user.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
when the server sends the presence then the OnPresence event fires in MatriX. When it does not dire then the server does not send it. There is either a problem with your subscription then or a problem on your server.

Alex
Avatar
AliVireTechnologies1 #3
Member since Jun 2013 · 58 posts
Group memberships: Members
Show profile · Link to this post
i am using this following code for connection, em using openfire 3.8.2 server if it is related to openfire is it is solved ? or still open .. if it is close then please send me its patch link.

  1. public static void ConnectXmpp(string domain, string phone, string password)
  2. {
  3.     SetLicense();
  4.  
  5.     xmppClient.XmppDomain = domain;
  6.     xmppClient.Username = phone;
  7.     xmppClient.Password = password;
  8.     xmppClient.StartTls = false;          
  9.     xmppClient.Open();          
  10. }
This post was edited on 2013-07-09, 17:36 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
your code looks fine and I am not aware of such a problem in Openfire. So it must be related to your subscription status or some other bug in your code as I said before.

Alex
Avatar
AliVireTechnologies1 #5
Member since Jun 2013 · 58 posts
Group memberships: Members
Show profile · Link to this post
Following is complete request and response when i connect to server.

 
  1. <stream:stream xmlns:stream=\"http://etherx.jabber.org/streams\" xmlns=\"jabber:client\" to=\"vtalk.viretechnologies.com\" version=\"1.0\" >
  2. <stream:stream xmlns:stream=\"http://etherx.jabber.org/streams\" xmlns=\"jabber:client\" from=\"vtalk.viretechnologies.com\" id=\"ad2cfe37\" xml:lang=\"en\" version=\"1.0\" >
  3. <stream:features xmlns:stream=\"http://etherx.jabber.org/streams\">\r\n  <starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\" />\r\n  <mechanisms xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">\r\n    <mechanism>DIGEST-MD5</mechanism>\r\n    <mechanism>PLAIN</mechanism>\r\n    <mechanism>ANONYMOUS</mechanism>\r\n    <mechanism>CRAM-MD5</mechanism>\r\n  </mechanisms>\r\n  <compression xmlns=\"http://jabber.org/features/compress\">\r\n    <method>zlib</method>\r\n  </compression>\r\n  <auth xmlns=\"http://jabber.org/features/iq-auth\" />\r\n  <register xmlns=\"http://jabber.org/features/iq-register\" />\r\n</stream:features>
  4. <auth mechanism=\"DIGEST-MD5\" xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" />
  5. <challenge xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">cmVhbG09InZ0YWxrLnZpcmV0ZWNobm9sb2dpZXMuY29tIixub25jZT0iQTdxL2kzZnJaSW1NSTlrREZrbTZETDJXYTlCK0hhYkpXTGdFTEV0VCIscW9wPSJhdXRoIixjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vzcw==</challenge>
  6. <response xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">dXNlcm5hbWU9IjkyMDMyMzQwOTIzOTciLHJlYWxtPSJ2dGFsay52aXJldGVjaG5vbG9naWVzLmNvbSIsbm9uY2U9IkE3cS9pM2ZyWkltTUk5a0RGa202REwyV2E5QitIYWJKV0xnRUxFdFQiLGNub25jZT0iNjI2ZjYxNTc3MzY5MzE0ZTc4NTg2MjU0NGE1MzcwMzk1MzM1NWE3NDU4NjczNDMzNjM3OTM2MzM0OTZmNGQ1NyIsbmM9MDAwMDAwMDEscW9wPWF1dGgsZGlnZXN0LXVyaT0ieG1wcC92dGFsay52aXJldGVjaG5vbG9naWVzLmNvbSIsY2hhcnNldD11dGYtOCxyZXNwb25zZT04M2Y2ZWQ4MjIxYzdjZDhkOGM1OWJjNmE3OTFmMmY1MA==</response>
  7. <success xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">cnNwYXV0aD0yNjdhMjhkNDhmZTBmNDUwZTI4ZjgyY2E5YjM4ZmFjNQ==</success>
  8. <stream:stream xmlns:stream=\"http://etherx.jabber.org/streams\" xmlns=\"jabber:client\" to=\"vtalk.viretechnologies.com\" version=\"1.0\" >
  9. <stream:stream xmlns:stream=\"http://etherx.jabber.org/streams\" xmlns=\"jabber:client\" from=\"vtalk.viretechnologies.com\" id=\"ad2cfe37\" lang=\"en\" version=\"1.0\" >
  10. <stream:features xmlns:stream=\"http://etherx.jabber.org/streams\">\r\n  <compression xmlns=\"http://jabber.org/features/compress\">\r\n    <method>zlib</method>\r\n  </compression>\r\n  <bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\" />\r\n  <session xmlns=\"urn:ietf:params:xml:ns:xmpp-session\" />\r\n</stream:features>
  11. <iq id=\"MX_1\" type=\"set\" xmlns=\"jabber:client\">\r\n  <bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\">\r\n    <resource>Matrix-Windows-Phone</resource>\r\n  </bind>\r\n</iq>
  12. <iq type=\"result\" id=\"MX_1\" to=\"vtalk.viretechnologies.com/ad2cfe37\" xmlns=\"jabber:client\">\r\n  <bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\">\r\n    <jid>9203234092397@vtalk.viretechnologies.com/Matrix-Windows-Phone</jid>\r\n  </bind>\r\n</iq>
  13. <iq id=\"MX_2\" type=\"set\" xmlns=\"jabber:client\">\r\n  <session xmlns=\"urn:ietf:params:xml:ns:xmpp-session\" />\r\n</iq>
  14. <iq type=\"result\" id=\"MX_2\" to=\"9203234092397@vtalk.viretechnologies.com/Matrix-Windows-Phone\" xmlns=\"jabber:client\" />
  15. <iq id=\"MX_3\" type=\"get\" xmlns=\"jabber:client\">\r\n  <query xmlns=\"jabber:iq:roster\" />\r\n</iq>
  16. <iq type=\"result\" id=\"MX_3\" to=\"9203234092397@vtalk.viretechnologies.com/Matrix-Windows-Phone\" xmlns=\"jabber:client\">\r\n  <query xmlns=\"jabber:iq:roster\">\r\n    <item jid=\"9203234092200@vtalk.viretechnologies.com\" name=\"imran\" subscription=\"from\" />\r\n    <item jid=\"9203234092398@vtalk.viretechnologies.com\" name=\"omer\" subscription=\"from\" />\r\n    <item jid=\"9203234092300@vtalk.viretechnologies.com\" name=\"hanan\" subscription=\"from\" />\r\n    <item jid=\"9203234092395@vtalk.viretechnologies.com\" name=\"imran2\" ask=\"subscribe\" subscription=\"none\" />\r\n    <item jid=\"923008034310@vtalk.viretechnologies.com\" name=\"hamza\" subscription=\"from\" />\r\n    <item jid=\"923244092397@vtalk.viretechnologies.com\" name=\"hamza\" subscription=\"to\" />\r\n    <item jid=\"923334294757@vtalk.viretechnologies.com\" name=\"faisal nizami\" ask=\"subscribe\" subscription=\"none\" />\r\n    <item jid=\"9203234092399@vtalk.viretechnologies.com\" name=\"usman\" subscription=\"from\" />\r\n    <item jid=\"923455898185@vtalk.viretechnologies.com\" name=\"jibran\" subscription=\"to\" />\r\n    <item jid=\"afsfd@vtalk.viretechnologies.com\" name=\"Afsfd\" ask=\"subscribe\" subscription=\"none\" />\r\n  </query>\r\n</iq>
  17. <presence xmlns=\"jabber:client\">\r\n  <status></status>\r\n  <priority>0</priority>\r\n</presence>

==================================================
now this following user is receiving my presence but i am not receiving his presence
   <item jid=\"923008034310@vtalk.viretechnologies.com\" name=\"hamza\" subscription=\"from\" />
==================================================
now see my presence from his side .

  1. <item jid="9203234092397@vtalk.viretechnologies.com" name="ali" subscription="to" />
This post was edited 2 times, last on 2013-07-10, 13:12 by Alex.
Avatar
Alex #6
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
as I said before your subscription is wrong. It must be subscription='both' on both sides.
Please fix your subscription and subscribe properly with presenceManager.Subscribe(...)
This post was edited on 2013-07-10, 16:29 by Alex.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters: