Smack and sending ICQ messages

Hello everbody,

I am trying to send an IM to an ICQ recipient via an ICQ gateway. From Exodus, I registered with the gateway object and it works fine.

From Java with Smack, it only works if I am logged in with Exodus in parallel! If I just run my code standalone, no exception is raised and no message received on my ICQ account.

Here is my code:

XMPPConnection connection = new SSLXMPPConnection(“amessage.de”);

connection.login(“user”, “password”);

Chat chat = connection.createChat("icqn@icq.amessage.info");

Message message = chat.createMessage();

message.setBody(“Howdy!”);

chat.sendMessage(message);

connection.close();

Can anyone tell me what I’'m doing wrong, please?

Regards,

Andreas

Goonie,

It’‘s really hard to say what might be going on. It doesn’‘t sound quite like a Smack issue though. One thing you might try is turning on Smack debug and seeing if the XML messages appear different than what is being sent through Exodus. One thing I did notice in your snippet is that you use the servers amessage.de and icq.amessage.info. I assume that’'s what you mean to do, but it would cause a problem if you used the wrong server names…

Regards,

Matt

Well, the reason I am connecting to amessage.de and registering to an object icq.amessage.info is that if I use the Exodus Jabber Browser (F11), it returns icq.amessage.info if I click on “Netzuebergang ICQ” (ICQ gateway).

With Exodus, this works fine. I will have a look at the logs now.

Regards,

Andreas

Below I have attached the logs for Smack and Exodus. With Smack, I get the following message reply: “Sending message failed, user is not connected”. But how could this be? Firstly, the ICQ user I’'m trying to address is connected. Secondly, even if he were not connected the message should be sent via the ICQ server.


Smack:

SENT: <stream:stream to=“amessage.de” xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams”>

RECV: <stream:stream xmlns=’‘jabber:client’’ xmlns:stream=’‘http://etherx.jabber.org/streams’’ from=’‘amessage.de’’ id=’‘1782283117’’>

SENT: schildbach.de

RECV: <iq id=’‘AG54K-0’’ type=’‘result’’><query xmlns=’‘jabber:iq:auth’’>schildbach.de

SENT: schildbach.dexxxSmack

RECV: <iq type=’‘result’’ id=’‘AG54K-1’’/>

SENT:

RECV: <iq from=’‘schildbach.de@amessage.de/Smack’’ id=’‘AG54K-2’’ type=’‘result’’><query xmlns=’‘jabber:iq:roster’’><item subscription=’‘from’’ jid=’‘icq.amessage.info/registered’’/><item subscription=’‘both’’ jid=’‘646790@icq.amessage.info’’ name=’’’’>Friends

SENT:

SENT: Howdy!mPRvT0

RECV: <message from=’‘646790@icq.amessage.info’’ to=’‘schildbach.de@amessage.de’’>Sending message failed, user is not connected.<x stamp=’‘20031029T20:38:05’’ from=’‘schildbach.de@amessage.de’’ xmlns=’‘jabber:x:delay’’>Offline Storage

SENT:

RECV: <presence from=’‘646790@icq.amessage.info’’ to=’‘schildbach.de@amessage.de’’ type=’‘unavailable’’/>

RECV: <presence from=’‘icq.amessage.info/registered’’ to=’‘schildbach.de@amessage.de’’>online

Exodus:

SENT: <stream:stream to=“amessage.de” xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams” version=“1.0” >

RECV: <stream:stream xmlns=’‘jabber:client’’ xmlns:stream=’‘http://etherx.jabber.org/streams’’ from=’‘amessage.de’’ id=’‘589303549’’>

SENT: schildbach.de

RECV: <iq id=’‘jcl_1’’ type=’‘result’’><query xmlns=’‘jabber:iq:auth’’>schildbach.de

SENT: schildbach.deExodus</reso urce>xxx

RECV: <iq type=’‘result’’ id=’‘jcl_2’’/>

SENT:

SENT:

SENT: available1

SENT:

SENT:

RECV: <iq from=’‘schildbach.de@amessage.de/Exodus’’ id=’‘jcl_3’’ type=’‘result’’><query xmlns=’‘jabber:iq:roster’’><item subscription=’‘from’’ jid=’‘icq.amessage.info/registered’’/><item subscription=’‘both’’ jid=’‘646790@icq.amessage.info’’ name=’’’’>Friends

RECV: <iq from=’‘schildbach.de@amessage.de/Exodus’’ id=’‘jcl_4’’ type=’‘result’’><query xmlns=’‘jabber:iq:private’’><storage xmlns=’‘storage:bookmarks’’/>

RECV: <presence from=’‘646790@icq.amessage.info’’ to=’‘schildbach.de@amessage.de’’ type=’‘unavailable’’/>

RECV: <iq from=’‘amessage.de’’ id=’‘jcl_5’’ to=’‘schildbach.de@amessage.de/Exodus’’ type=’‘result’’><query xmlns=’‘jabber:iq:agents’’><agent jid=’‘users.jabber.org’’>Benutzerverzeichnis: jabber.orgjud<agent jid=’‘aim.gate.amessage.de’’>Netzübergang: AIMaimEnter ID<agent jid=’‘icq.amessage.info’’>Netzübergang: ICQicqEnter ID<agent jid=’‘msn.gate.amessage.de’’>Netzübergang: MSNmsnEnter ID<agent jid=’‘yahoo.amessage.info’’>Netzübergang: Yahoo!yahooEnter ID<agent jid=’‘email.amessage.de’’>Netzübergang: E-Mailsmtp<agent jid=’‘chat.amessage.info’’>Chat-Räumepublic<agent jid=’‘jabber.eu.org’’>Jabber-Server in Europaserverlist

RECV: <iq from=’‘schildbach.de@amessage.de/Exodus’’ id=’‘jcl_6’’ type=’‘result’’><query xmlns=’‘jabber:iq:private’’><storage xmlns=’‘storage:imprefs’’/>

RECV: <presence from=’‘icq.amessage.info/registered’’ to=’‘schildbach.de@amessage.de’’>availableonline

RECV: <presence from=’‘646790@icq.amessage.info’’ to=’‘schildbach.de@amessage.de’’/>

SENT: 523de64a2da7a0761c7f14be467c7e76a6f3ff88Howd y!

SENT:

Goonie,

Did you ever figure this out… having the same problems with sending to an MSN account… how do you make this work?