cant send im to smack over multiple browser sessions

Over on this thread a comment has been left remarking that messages cannot be sent over multiple browser sessions even though the from and to addresses are the same.

"If I close the ColdFusion client and reopen it I can send messages with no problems, but cannot receive them."

This is caused by IM clients pretty much ignoring the thread id. Exodus links past conversations by the username or buddy id, however Smack uses the threadid as the identifier. Hence when you kill the browser session, and create a new one the thread id changes. This means that Exodus sends a message to the im server, but with an old thread id so smack will never find it because its looking for another message.

In order to regain the connection to a second browser session for the same user the IM client needs to be restarted because they keep conversations open for the length of the application life by default.

The only way around this would be to somehow get smack to pull out all IM messages from the server irrespective of thread id.

Analysis of Smack PSI Miranda IM and Exodus Packets

Over on this thread a comment has been left remarking that Exodus seems to be the only IM client that works with the smack API implementation in ColdFusion.

My research was a bit long so I thought I would respond in a blog entry rather than the comments.

1. "Now I am having trouble sending messages from any client back to the Coldfusion one..... The Google Talk client, Psi, etc do not work under any circumstances. I can get the Exodus client to send messages back to Coldfusion"

Finding out the issue between PSI, Miranda and Exodus involved watching the XMPP packets between the server and the clients.

As far as I can see Exodus is the only one that works because it relays a thread id. this means that Smack can route it back to the associated Java thread properly. PSI and MirandaIM dont do this.

You can take a look at this XML doc of sample packets sent from Smack, Exodus, PSI and Miranda in that order.

PSI: A thread on the PSI forum indicates that it will return the thread xml element if it is given one in the first place, but ONLY for a plain message type, not a chat message.

I cant currently find any information on Miranda support for this tag.

Java Library for instant messaging over XMPP - Smack

Today I have started work on using the Java library SMACK API to concoct a web based chat client for our support teams to chat with clients on our sites.

Its pretty easy to use, and if you are running ColdFusion MX7.x then you dont even need to download the Smack API as the XMPP Event Gateway uses a version of Smack already. So how about some examples then?

[More]

Setting up OpenFire Instant Messaging Server

We are starting to work on a live help desk chat application where authenticated and logged in users can talk to our support and sales teams via a web based instant messenger.

Because this will be for a private application we will need to use a private instant messaging server, i.e. one that Joe Public cant get at - so that means we need to run our own, and having had a look at the free and open source offerings we chose OpenFire (formerly Wildfire) because of it large feature set and the possibility of paying for the enterprise version if we need it.

[More]

BlogCFC was created by Raymond Camden. This blog is running version 5.9.001.