The Next Level in Team Communications: Jabber Integration with Drupal
- Estimated
- 4 min read
We’ve done a lot to set up team communications tools that help us work more productively. So far we have an intranet with a HTML shoutbox and an XMPP server for secure instant messaging and group chats, and we use the Notifications and Messaging frameworks so we can subscribe and get notifications of updates from just about anywhere. Our next challenge is to put all these pieces together and have notifications and messages passed around from anyone to anywhere.
The missing piece to do this and glue these pieces together is a messaging broker that can take incoming messages from multiple input channels, do some processing with them, and route the results to anywhere. We recently got this working. Meet the Messaging processor, an architecture capable of handling multiple channels and configurable processing queues. This is a high level block diagram of how it all fits together.
!http://farm4.static.flickr.com/3294/3056773788_ed52b4e5db.jpg?v=0!
Note: Though the following screenshots are from live sites, this is still in the development stage and we are not releasing all the code (yet). Stay tuned for upcoming releases of all these modules.
The Ingredients
-
XMPP server and the XMPP Framework, with a few patches to allow persistent XMPP connections
-
A (100% PHP Drupal) chatbot that can connect periodically to the chat room and post read messages
-
A shoutbox module (integrated with our spaces architecture) that allows setting up shoutbox blocks for informal message blasts, tied to a specific team or site section
-
Messaging and Notifications frameworks, which are fully released as contributed modules
-
The new Messaging processor, which handles incoming messages, processing, and routing between channels
The Recipe
We start by setting up a shoutbox on our website and a chat room for the team to hang out in. These are the visible parts that team members can interact with, either posting a ‘shout’ using some AJAX UI or posting to the chat room.
!http://farm4.static.flickr.com/3205/3056760256_dc907230a2.jpg?v=0!
Then we set up the ‘chatbot’ module, which can connect to the chat from time to time and say ‘Hi’ and whatever else you’d like it to.
!http://farm4.static.flickr.com/3226/3055923641_ba043780c7.jpg?v=0!
Now we want the messages posted to the shoutbox (on the website) to show up in the chat room too, so we don’t have to check both at all times. We use incoming messages and messaging processors to do this. We see we have different ‘incoming methods’, depending on how messages enter the system.
!http://farm4.static.flickr.com/3189/3056760238_82dce7d1e5.jpg?v=1227555547!
For each method, we have one or more channels. For example for ‘shoutbox’, each different shoutbox is a channel and for ‘chatbot’ one channel is the group chat while another is the individual messages sent to the chatbot from your XMPP account.
!http://farm4.static.flickr.com/3290/3056760446_df296ec195.jpg?v=1227555567!
Now we set up the actions (processors) to run for messages coming from each channel. In this example, we set up messages coming from the shoutbox to be redirected to the chat.
!http://farm4.static.flickr.com/3152/3056760418_46a5258ae9.jpg?v=1227555636!
We also set it up so that messages posted to the ‘chatbot’ are be redirected to the shoutbox. So now, you can ping our chatbot on Pidgin or another XMPP client and “talk to him.” This allows us to post to the ‘shoutbox’ without even using the website, for example with your iPhone.
!http://farm4.static.flickr.com/3153/3056760390_612b541de5.jpg?v=1227555685!
This is our set up so far. By enabling the Notifications module too, you also will be able to:
-
Subscribe to the shoutbox and get IM, SMS, and mail notifications of updates. For example, you can get a daily email with all the shouts from a certain group.
-
Get updates from the shoutbox or the chat room on system events like comments and node updates. Every notifications event can be now treated as an incoming message in any of these cases.
-
…
Those dots are for real. With this we can have everything cross-posted to anywhere and have subscriptions on anything. So if we want to get notices about node updates in the chat, all we have to do is:
!http://farm4.static.flickr.com/3044/3055923663_dba2acf0e6.jpg?v=1227555728!
The Dessert
Now that we have the main set up complete, what about something extra? For example, how about a “fortune” generator that spices up your chat room by posting some funny stuff from time time? Our chatbot module includes a fortune generator, using the Linux fortunes package.
!http://farm4.static.flickr.com/3181/3055923577_be4ebae3a2.jpg?v=0!
We can set it up to produce a fortune every hour, post it to the chat, and save it as a new story.
!http://farm4.static.flickr.com/3273/3055923609_fda4754c16.jpg?v=1227555787!
Just don’t set it to run too often, as it can sink your team’s productivity ;-)
!http://farm4.static.flickr.com/3050/3056760274_99f151929e.jpg?v=0!
What we're doing.
Latest