The Next Level in Team Communications: Jabber Integration with Drupal
Have Notifications and Messages Passed From Anyone to Anywhere
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.

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.

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.

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.

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.

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.

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.

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:

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.

We can set it up to produce a fortune every hour, post it to the chat, and save it as a new story.

Just don’t set it to run too often, as it can sink your team’s productivity ;-)

/me wants
This is not only the kind integration we’ve all been waiting for, the possibilities are also just mind-blowing! This will definitely open new doors for Drupal.
I thank Development Seed for this investment, because it will certainly be valuable to the entire Drupal community once it’s released.
In the near future, Drupal will be the (only?) platform which will allow for notifications through instant messaging (and even SMS), instead of just e-mail and feed notifications (yes, in several cases IM notifications are justified and even better than other kinds of notifications).
/me wants
Jose – awesome stuff… really
Jose – awesome stuff… really impressive.
What I've been looking for forever
A universal API for incoming and outgoing messages in Drupal? This redefines “awesome”.
This could be used to make a list-server, an email-to-SMS-to-IRC gateway, or all of it at once! I’m going to follow this with bated breath. :)
This could be used to make a
This could be used to make a list-server, an email-to-SMS-to-IRC gateway, or all of it at once!
Yup, that’s coming next :-)
Outstanding work.
Like the others here I continue to be amazed by your work! I can’t help to ask the question: where is this going? As a business person I’d find it hard to justify the development of an internal communications system like this when there are options out there for a minimal fee. I’m assuming that this “R&D” ties in with client work that you’re already doing.
Yes, you’re right about this
Yes, you’re right about this being some kind of R&D work so far, though we are already ‘team testing’ the solution here.
However it seems quite clear to me the advantage of having all of your team’s communication infrastructure so well integrated, which doesn’t mean you need to run all your services, actually you could use a third party xmpp server…
Drupal is a development platform
Who says Drupal is a CMS! I’m amazed at all the stuff we can throw at Drupal.
I’m eager to see the final version of the Messaging processor. :-)
Nice
+1 for the interest in this and the code when you release it! Fantastic idea.
awesome! Is it using the
awesome! Is it using the xmpp_server module?
It is using the XMPP
It is using the XMPP Framework, with some patches and extensions we are posting for that module, which is one of the reasons we cannot release it yet without some patch mess… http://drupal.org/project/xmppframework http://drupal.org/node/333940
thanks
i understand, thanks for the pointers.
wow wow wow
That’s all I can say. Can’t wait to try this out.
Good stuff
I agree, I think my community could really use this sort of this.
Couple this with events/scheduling and you could schedule “chats” so as to be sure several users would be there.
Couple this with
Couple this with events/scheduling and you could schedule “chats” so as to be sure several users would be there.
It seems like a good idea, this for the to-do list, thanks
That's *awesome*
Nice work, Jose! You guys continue to do some really awesome work … you make reading Drupal Planet fun. The ‘fortune’ output is a nice touch. :-)
Is the chatbot source available yet?
Thanks Is the chatbot
Thanks
Is the chatbot source available yet? We are working out some dependencies with the xmppframework, with some patches and extensions, I hope we’ll be able to release it soon.
Any XMPP server?
Will this work with any XMPP server? Or are you building a custom server for just this purpose?
It just uses XMPP and
It just uses XMPP and standard extensions, so it should work.
Currently we are using it with ejabberd, an open source XMPP server, http://www.ejabberd.im/
Outstanding work
Got me anxious to test out the modules when you release them!