Advertisement
Guest User

Untitled

a guest
Aug 30th, 2017
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. public void ConnectXMPP(string userName, string agentID, string password, string domain, string url, string finesseServer)
  2. {
  3.  
  4. System.Net.ServicePointManager.Expect100Continue = true;
  5. System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
  6. System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
  7. // Jid jidSender = new Jid("smacks@dcloud.cisco.com");
  8. // XmppClientConnection xmpp = new XmppClientConnection(jidSender.Server);
  9. AgentId = agentID;
  10. Password = password;
  11. Url = url;
  12. FinesseServer = finesseServer;
  13. UserName = userName;
  14.  
  15. xmpp = new XmppClientConnection();
  16.  
  17. xmpp.Server = domain;//"x.cisco.com";
  18.  
  19. xmpp.ConnectServer = url;
  20.  
  21. xmpp.Username = agentID;//"1072";
  22. xmpp.Password = password;//"123456";
  23.  
  24. xmpp.SocketConnectionType = agsXMPP.net.SocketConnectionType.Bosh;
  25. //xmpp.KeepAlive = true;
  26. xmpp.Port = 5222;
  27. xmpp.Resource = "cisco";
  28. xmpp.AutoRoster = true;
  29. xmpp.AutoAgents = false;
  30. xmpp.AutoPresence = true;
  31. xmpp.AutoResolveConnectServer = true;
  32. xmpp.OnXmppConnectionStateChanged += Xmpp_OnXmppConnectionStateChanged;
  33. xmpp.OnError += Xmpp_OnError;
  34. xmpp.OnAuthError += Xmpp_OnAuthError;
  35. //xmpp.OnWriteXml += new XmlHandler(client_OnWriteXml);
  36. xmpp.OnReadXml += new XmlHandler(client_OnReadXml);
  37. //xmpp.OnMessage += Xmpp_OnMessage;
  38. xmpp.OnRosterStart += Xmpp_OnRosterStart;
  39. xmpp.OnRosterEnd += Xmpp_OnRosterEnd;
  40. xmpp.OnSocketError += Xmpp_OnSocketError;
  41. xmpp.OnStreamError += Xmpp_OnStreamError;
  42. //xmpp.OnLogin += new ObjectHandler(xmpp_OnLogin);
  43. xmpp.Open();
  44. }
  45.  
  46. <?xml version="1.0"?>
  47. -<iq id="agsXMPP_1" type="error" to="finesse1.dcloud.cisco.com/1e2ee691"
  48. from="dcloud.cisco.com" xmlns="jabber:client">
  49. -<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
  50. <resource>cisco</resource>
  51. </bind>
  52. -<error type="modify" code="400">
  53. <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
  54. </error>
  55. </iq>
  56.  
  57. http://www.servername:7071/http-bind/?body rid="1"/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement