Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
Jingxian #1
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
Subject: When retrieving a contact's VCard, Cisco CUPS returns error "Expecting bind"!
We(Enghouse) are currently Matrix to see if we can build our presence server against a few vendors, first will be cisco. So I'm using miniClient to connect to cisco CUPS using BOSH/plaintext:

  1. xmppClient.Transport = Matrix.Net.Transport.Bosh;
  2. xmppClient.Uri = new System.Uri("http://dev-cups10.domain.local:7335/httpbinding/");
  3.  
  4. private void xmppClient_OnBeforeSasl(object sender, Matrix.Xmpp.Sasl.SaslEventArgs e)
  5. {
  6.             e.Auto = false;
  7.             e.SaslMechanism = Matrix.Xmpp.Sasl.SaslMechanism.Plain;
  8. }
I found the callback is invoked

  1. private void xmppClient_OnLogin(object sender, Matrix.EventArgs e)
  2. {
  3.             DisplayEvent("OnLogin");
  4. }

but this callback is NEVER invoked and also all callbacks to do with Roster is NEVER invoked either

  1. private void xmppClient_OnBind(object sender, JidEventArgs e)
  2. {
  3.             DisplayEvent("OnBind");
  4. }

Then if I try to query VCARD on a user, it returns "Expecting bind" error. Is this because the OnBind calback is not invoked? if yes, what need to be done to get it going?

I'm wondering what I'm missing here(this is the full XML trace)

  1. SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="cucm10.local" version="1.0" >
  2. RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="cucm10.local" version="1.0" id="956076547C" >
  3. RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  4.  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
  5.     <mechanism>PLAIN</mechanism>
  6.     <mechanism>CISCO-VTG-TOKEN</mechanism>
  7.  </mechanisms>
  8. </stream:features>
  9. SEND: <auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">XXX</auth>
  10. RECV: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
  11. SEND: <iq id="MX_1" to="josiel@cucm10.local" from="josiee@cucmcucm10.local" type="get" xmlns="jabber:client">
  12.  <vCard xmlns="vcard-temp" />
  13. </iq>
  14. SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="cucm10.local" version="1.0" >
  15. RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="cucm10.local" version="1.0" id="956076547C" >
  16. RECV: <stream:error xmlns:stream="http://etherx.jabber.org/streams">
  17.  <undefined-condition xmlns="urn:ietf:parms:xml:ns:xmpp-streams" />
  18.  <text xml:lang="en-US.UTF-8" xmlns="urn:ietf:params:xml:ns:xmpp-streams">Expecting bind.</text>
  19. </stream:error>
  20. SEND: </stream:stream>
  21. RECV: </stream:stream>
  22. SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="cucm10.local" version="1.0" >
  23. RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="cucm10.local" version="1.0" id="966328E0B0" >
  24. RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  25.  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
  26.     <mechanism>PLAIN</mechanism>
  27.     <mechanism>CISCO-VTG-TOKEN</mechanism>
  28.  </mechanisms>
  29. </stream:features>
  30. SEND: <auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">XXX</auth>
  31. RECV: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
  32. SEND: <iq id="MX_2" to="josiel@cucm10.local" from="josiee@cucmcucm10.local" type="get" xmlns="jabber:client">
  33.  <vCard xmlns="vcard-temp" />
  34. </iq>
  35. SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="cucm10.local" version="1.0" >
  36. RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="cucm10.local" version="1.0" id="966328E0B0" >
  37. RECV: <stream:error xmlns:stream="http://etherx.jabber.org/streams">
  38.  <undefined-condition xmlns="urn:ietf:parms:xml:ns:xmpp-streams" />
  39.  <text xml:lang="en-US.UTF-8" xmlns="urn:ietf:params:xml:ns:xmpp-streams">Expecting bind.</text>
  40. </stream:error>
  41. SEND: </stream:stream>
  42. RECV: </stream:stream>
Any help is greatly appreciated!
This post was edited 2 times, last on 2015-12-09, 03:45 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
it looks to me like you are sending your vcard request in the OnLogin event which is to early.
Please wait at least until the OnRosterEnd event. Or better until you get the first incoming OnPresence event.

Alex
Avatar
Jingxian #3
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
Hi Alex,

Thank you for the quick response.
The issue is I don't receive OnBind event(should I get this event(There was no Bind message in trace)?) and OnRosterStart or OnRosterEnd event at all.
Do you know what would cause this issue
This post was edited on 2015-12-09, 04:01 by Jingxian.
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
yes you must get those events. Please remove your vcard code because its scheduled wrong and see if you get those events.
Have you tried the MiniClient example with your server?

Alex
Avatar
Jingxian #5
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
I removed the code and tried, still no go. There is no bind message or event. I'm running miniclient. I'm trying again now
Avatar
Jingxian #6
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
I commented out the vcard bit I added and still no go: this is the code I have modified for mini client to connect to cisco CUPS

  1. private void cmdConnect_Click(object sender, System.EventArgs e)
  2.         {
  3.             xmppClient.SetUsername(txtUsername.Text);
  4.             xmppClient.SetXmppDomain(txtServer.Text);
  5.             xmppClient.Password = txtPassword.Text;
  6.            
  7.             // BOSH exmaple
  8.             xmppClient.Transport = Matrix.Net.Transport.Bosh;
  9.             xmppClient.Uri = new System.Uri("http://dev-cups10.zeacomdev.local:7335/httpbinding/");
  10.            
  11.             xmppClient.Status = "ready for chat";
  12.             xmppClient.Show = Matrix.Xmpp.Show.Chat;
  13.  
  14.             if (!String.IsNullOrEmpty(txtHost.Text))
  15.             {
  16.                 // disable SRV lookups and specify the sever hostname manual
  17.                 xmppClient.ResolveSrvRecords = false;
  18.                 xmppClient.Hostname = txtHost.Text;
  19.                 //xmppClient.Hostname = "192.168.1.106";
  20.             }
  21.              
  22.  
  23.             // set settings
  24.             _login.User = txtUsername.Text;
  25.             _login.Server = txtServer.Text;
  26.             _login.Password = txtPassword.Text;
  27.            
  28.             xmppClient.Open();
  29.         }
  30.  
  31. private void xmppClient_OnBeforeSasl(object sender, Matrix.Xmpp.Sasl.SaslEventArgs e)
  32.         {
  33.             //e.Auto = false;
  34.             //e.SaslMechanism = Matrix.Xmpp.Sasl.SaslMechanism.NONE;
  35.            
  36.             /*
  37.             with the following code you can disable the SASL automatic and manual specify a mechanism.*/
  38.            
  39.             e.Auto = false;
  40.             e.SaslMechanism = Matrix.Xmpp.Sasl.SaslMechanism.Plain;
  41.            
  42.  
  43.            
  44.             // X_FACEBOOK_PLATFORM Facebook Auth example
  45.             //e.Auto = false;
  46.             //e.SaslMechanism = Matrix.Xmpp.Sasl.SaslMechanism.X_FACEBOOK_PLATFORM;
  47.  
  48.             //const string APPLICATION_KEY = "12345678901234567890";
  49.             //const string SECRET_KEY = "98765432109876543210";
  50.             //e.SaslProperties = new Matrix.Xmpp.Sasl.Processor.Facebook.FacebookProperties
  51.             //                       {
  52.             //                           ApiKey = APPLICATION_KEY,
  53.             //                           ApiSecret = SECRET_KEY,
  54.             //                           SessionKey = "session_key_from_facebook_api"
  55.             //                       };
  56.          }
This post was edited on 2015-12-09, 04:18 by Alex.
Avatar
Alex #7
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
please post the XML
Avatar
Jingxian #8
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
Here is the XML:

  1. SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="cucm10.local" version="1.0" >
  2. RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="cucm10.local" version="1.0" id="B1072D5FDD" >
  3. RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  4.  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
  5.     <mechanism>PLAIN</mechanism>
  6.     <mechanism>CISCO-VTG-TOKEN</mechanism>
  7.  </mechanisms>
  8. </stream:features>
  9. SEND: <auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">XXX</auth>
  10. RECV: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl" />
  11. SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="cucm10.local" version="1.0" >
  12. RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="cucm10.local" version="1.0" id="B1072D5FDD" >
This post was edited 2 times, last on 2015-12-09, 04:52 by Alex.
Avatar
Alex #9
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
have you tried to connect with sockets instead of BOSH?
Are you sure that your server is setup correct?
MatriX is waiting for stream features and they are not coming from the server to continue.

Alex
Avatar
Jingxian #10
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
I tried to use CAJX and Jabber.net and both works fine
Avatar
Jingxian #11
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
what is required if I just use socket connection? what parameter I should set up?
Avatar
Alex #12
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #10
MatriX must work fine as well.
Then please post the logs from the other software for comparison.

Alex
Avatar
Alex #13
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #11
Quote by Jingxian:
what is required if I just use socket connection? what parameter I should set up?

remove this lines:
  1. xmppClient.Transport = Matrix.Net.Transport.Bosh;
  2. xmppClient.Uri = new System.Uri("http://dev-cups10.zeacomdev.local:7335/httpbinding/");
Avatar
Jingxian #14
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
Interesting. I works for socket connection.

Thx
Avatar
Alex #15
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
looks like something is wrong with our BOSH server.
Makes no sense anyway to use BOSH when sockets can be used.

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:
Forum: MatriX RSS