smack

How to create a jabber/XMPP proxy/logging service?

只谈情不闲聊 提交于 2019-12-05 11:12:14
I am working for a company that is using Google Chatback (anonymous chat with a support employee in my company's case) as the main chat service provider. This service uses the XMPP (formerly known as Jabber) protocol for sending and receiving messages. Our company has ten support employee accounts, and they are accessible through the chatback service we have used on our website. The employees use both Mac OSX and Windows, along with different clients on the different OSes. The chat is also available through native apps on both Android and iOS. We need a service for logging the chat sessions,

(a)Smack returns “service-unavailable (503)” error at login()

若如初见. 提交于 2019-12-05 10:08:40
I'm trying to implement a simple jabber messenger on Android using asmack library. Here's the code: public boolean login() { if (connection != null && connection.isConnected()) { Log.i("XMPP", connection.getHost()); try { connection.login(USERNAME, PASSWORD); } catch (XMPPException e) { e.printStackTrace(); return false; } return true; } return false; } Exception I get after connection.login() (connection looks fine): service-unavailable(503) at org.jivesoftware.smack.NonSASLAuthentication.authenticate(NonSASLAuthentication.java:77) at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection

smack connect to xmpp server with previous stream id

ぐ巨炮叔叔 提交于 2019-12-05 09:54:24
I'm building a chat application using xmpp over Ejabbered for server and smack for android client I've established connecting , login , send and receiving messages ,then I've faced a problem with user network disconnecting and reconnecting , which has been solved by Reconnecting Manger in smack and xmpp-0198, however there is a case where i need to create a new connection in smack but use the previous session (stream) to get all the messages stored in that session (they don't get stored to offline messages) ,and if i create a new connection with new stream id , user messages get lost . so is

Could not establish socket with any provided host

允我心安 提交于 2019-12-05 09:03:35
I am struggling with file transfer in android.I am using smack 4.1 to connect to openfire server. My problem is: When i am using Spark to Spark file transfer, it works fine.But when i transfer file from Spark to Android or Android to Android , The iq received showing error "Could not establish socket with any provided host" like this: <iq id="018vq-231" to="sender@domain.com/Spark 2.6.3" from="receiver@domain.com/Smack" type="error"> <error code="-1" type="CANCEL"> <item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en"

Who actually uses a full JID?

你离开我真会死。 提交于 2019-12-05 07:27:09
When logging in to an XMPP server via smack, I only send the userid/password combination. Do server components actually use the "resource" parameter in a full JID? e.g. ali@someplace/resource What are the benefits of sending it? Resources are useful if you have multiple clients logged in. For example, if I'm logged in at home and at work using a different resource for each connection, then I can have my presence set for each. Maybe I'm at home so work is set xa and home is set to chat . Resources can really be useful when you've got heterogeneous clients and you can use capabilities (XEP-0115)

Check if a user exist on server in XMPP with (a)smack

Deadly 提交于 2019-12-05 06:27:59
I'm working on a chat application using asmack as a library and on android platform. Is there is any way that before adding friend in Roster can I check that friend exist on server or not? nitin tyagi I Found the answer : UserSearchManager search = new UserSearchManager(mXMPPConnection); Form searchForm = search .getSearchForm("search." + mXMPPConnection.getServiceName()); Form answerForm = searchForm.createAnswerForm(); answerForm.setAnswer("Username", true); answerForm.setAnswer("search", user); ReportedData data = search .getSearchResults(answerForm, "search." + mXMPPConnection

how to create persistent muc room in smack 4.1 beta2

为君一笑 提交于 2019-12-05 05:29:14
问题 migrated from asmack to smack 4.1 beta2. The muc rooms created are no longer persistent. MultiUserChatManager mucm=MultiUserChatManager.getInstanceFor(connection); muc=mucm.getMultiUserChat(groupid+"@conference.localhost"); DiscussionHistory histroy=new DiscussionHistory(); histroy.setMaxStanzas(10); muc.createOrJoin(username,null,histroy,SmackConfiguration.getDefaultPacketReplyTimeout()); muc.nextMessage(); when created with gajim, the rooms are persistent. EDIT : Here is code we used

difference between XMPP servername and XMPP servicename?

不羁岁月 提交于 2019-12-04 21:44:43
问题 In Smack API, there is a configuration class for connection, described at this page ConnectionConfiguration I am confused about the distinction between service name and server name. Suppose I have a computer named "mybox.mydomain.com", and I have ejabberd on it with a configured host called "myhost" (using the line {hosts, ["myhost"]}. in ejabbed.cfg), what is the host name, server name and service name in this case? 回答1: myhost: service name (or XMPP domain) mybox.mydomain.com: hostname and

Android/Smack: Keep XMPP connection alive in sleep mode

做~自己de王妃 提交于 2019-12-04 20:49:37
问题 I have an Android application that has a chat client as one of its features. The chat client uses XMPP based on the Smack library for Android and running Openfire as XMPP server in the background. The connection is established using BOSH The whole XMPP connection handling is implemented as a service to run and listen in the background for incoming messages even if not activity of the app is in the foreground. So far, everything works perfectly fine. The only problem seems to be the sleep mode

Smack: “Trust anchor for certification path not found”

痴心易碎 提交于 2019-12-04 20:25:24
I'm trying to connect from Android to a Apache Vysper XMPP server in localhost. I'm using Smack framework to perform XMPP operations: AbstractXMPPConnection connection = new XMPPTCPConnection("bigdestroyer", "", ip); try { connection.setPacketReplyTimeout(10000); connection.connect(); } catch (SmackException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (XMPPException e) { e.printStackTrace(); } But I get this error: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. I guess it is