[jdev] Transport Registration
James Bunton
james at delx.cjb.net
Sun May 1 08:35:06 CDT 2005
Hi everybody.
I just cooked up a neat little PHP script that will register you with a
Jabber gateway.
If the Jabber gateway supports roster-subsync (That's Py*t), then your
contacts will even be added to your list for you :)
Here's what it does..
1) Log into Jabber server
2) Send disco#items to the server's JID
3) Send disco#info to the JID of everything returned from the above
request
4) Save to $gatewayjid When we find something that has
category="gateway" and type="msn"
5) Send jabber:iq:register to $gatewayjid
6) Accept auth from $gatewayjid
7) Autoauthorise anything in the $gatewayjid domain that has
roster-subsync flag
8) Respond with "I am not here" to any messages sent from MSN users in
this time
9) Wait for 15 seconds
10) Disconnect from Jabber server
If there is a delay of more than 15 seconds between any of these steps,
bail out & warn the user
Please feel free to try it out
http://msn-transport.jabberstudio.org/tarballs/webreg.tar.gz to
download and try for yourself.
I suggest you install php4-mhash (otherwise passwords are sent in
cleartext).
Apart from that it should just work in any PHP enabled web server.
Oh yeah, anybody with design skills, please have a look at index.php &
style.css to make it prettier :)
Edit config.php to allow registration with ICQ, AIM, etc. I'll make a
better way of doing this soon.
Thanks
Enjoy!
---
James
More information about the JDev
mailing list