Viewing By Category : Google/Gmail/Gtalk /
Main
Yesterday, I was trying to get Gtalk to respond to a user where neither the user nor the gateway had added the other to their buddy lists. For simple gateways (like echo.cfc) this doesn't seem to be a problem, it works fine (yes, Scott, it works fine without the permit_all snippet from yesterday... you were not wrong). It seems that this isn't really well-supported by Jabber under any circumstances, on Google Talk or elsewhere.
So, after all that, It seems to come down to having onAddBuddyRequest and onAddBuddyResponse in your CFC, having your users add the gateway's IM account to their buddy list, and then going for it. Sorry for any misleading information yesterday... I was testing testing testing and got a false positive.
There's some odd issues with Jabber, according to Matt Woodward, who wrote
this article on Macromedia's dev center... things seem dependent on the server config and permit lists. It seems to block some messages between untrusted accounts (that is, accounts that haven't gone thru the process of adding each other to buddy lists). In an IM conversation today he confirmed that it's "flaky or just doesn't work" under most circumstances. To get reliable results, code up onAddBuddyRequest(CFEvent) to send an "approved" message back to the IM client.
So, the moral of the story here is that sometimes you have to guess at what works by testing and observing outputs. In this case, it seems that the rules dictate adding a gateway's IM account to your buddy list... which is easy enough using the onAddBuddyRequest() method in your gateway CFC to send an affirmative response back to the user. Once you've done that, things seem quite stable and easy to work with.
Hopefully, this will be the last word on the subject. :)
Laterz!
OK, this has actually been tested and found to be working!!
There's a some technical issues at work with Gtalk, specifically focusing on their implementation of the XMPP standards... suffice it to say that the only way to initiate a chat with someone is to first request permission to add them to your list... effectively they give you permission to subscribe to their status beacon. If you can see if they're online, you're assumed to have permission to message them. Interestingly, even if they're on YOUR list, they have to ask you for a subscription to YOUR status in order to IM YOU.
So... since Gtalk blocks any messages to accounts that haven't given you permission to send to them, it was blocking all messages to gateways unless they were coded to auto-permit requesters, then the requester could send messages. The question became "How do we auto-add users when the incoming message is blocked?" You can't allow for an event that's never received, right? And having people have to add to their buddy lists isn't always convenient. So I did some research and found what appears to, according to tests, to have worked.
By adding the following code to the pseudo-constructor, when the gateway is instantiated it will send a message to the Gtalk service telling Gtalk "I want ANYONE to be able to message me!"
<cfset getGatewayHelper("GatewayID_from_cfAdmin").setPermitMode("PERMIT_ALL")>
If you add this in the space inside a cfcomponent tag and outside any cffunction tag, it will execute when the gateway starts and free your Gtalk bot up to respond to anyone that wishes to contact it.
Laterz!
I've been playing with Gtalk this morning a bit. Like many have noted, their lack of support for non-Windows platforms is distressing although they have promised to
support OSX and Linux. Still, the presence of a high-availability, high-traffic Jabber/XMPP service in a market previously dominated by proprietary protocols has got to intimidate the pants off the competition. Yahoo ain't yahooing to much because America's online alright... but thru the new kid in town. Once they support Mac, Linux, and webcams I'm guessing that the end will be in sight for the domination of the ICQ/AOL/Yahoo/MSN morass of services.
Especially since Google's trying to develop a
federation of open VOIP platforms that already include Earthlink and Sipphone to provide end-to-end communication between subscribers to various services. Imagine if they got Skype to join the fray... it's a wild world.
But none of that was the point of this post, which was simply to say that in order to connect to the Gtalk network, you have no special signup process thru which to go unless you're on of few people on the planet who hasn't yet gotten a Gmail account. And since Sean Corfield and I each have 150 invites available, let us know and the 9 of you can finally get with the program. In order to connect to Gtalk with a Jabber IM client, you need 4 tidbits of information:
- server: talk.google.com
- port: 5222
- gmail account
- gmail account password
- ok, 5: be sure to click Use TLS where your IM client asks for it
That's it!
I was testing it this morning and opened Adium, hit the prefs window and "Add account...":Jabber, gave it one of my Gmail addies and password, talk.google.com, and the port number, checked Use TLS, and hit OK. And whammo, it hooked right up. So for anyone who's used to having to spend a half-hour signing up for a service, your email address and password on Gmail is all you need to hook up to this and if there's someone you want to get on Gtalk, hit your gmail account and send them an invite, then invite them to join Gtalk too.
Laterz!