XMPP (Jabber) is an XML based protocol primarily for presence and messaging. It is an open standard and there are several open server implementations, such as ejabberd, jabberd(2), openfire, and others, as well as several open source clients, Psi, gajim, gaim etc. XMPP differs from other IM applications as it is immensly extendable. This allows us to easily integrate Asterisk with XMPP. The Asterisk XMPP Interface is provided by res_jabber.so.
res_jabber allows for Asterisk to connect to any XMPP (Jabber) server and is also used to provide the connection interface for
JABBER_RECEIVE) and applications (
JabberSend) are exposed to the dialplan.
You'll find examples of how to use these functions/applications hereafter. We assume that 'asterisk-xmpp' is properly configured in
JabberSend sends an XMPP message to a buddy. Example:
JABBER_STATUS stores the status of a buddy in a dialplan variable for further use. Here is an AEL example of how to use it:
JABBER_RECEIVE waits (up to X seconds) for a XMPP message and returns its content. Used along with
SendText, provided it's implemented in the corresponding channel type),
JABBER_RECEIVE helps Asterisk interact with users while calls flow through the dialplan.
JabberSend are not tied to the XMPP media modules
chan_jingle, and can be used anywhere in the dialplan. In the following example, calls targeted to extension 1234 (be it accessed from SIP, DAHDI or whatever channel type) are controlled by user [email protected] Asterisk notifies him that a call is coming, and asks him to take an action. This dialog takes place over an XMPP chat.
When calling from a GoogleTalk or Jingle client, the
CALLERID(name) is set to the XMPP id of the caller (i.e. his JID). In the following example, Asterisk chats back with the caller identified by the caller id. We also take advantage of the
SendText implementation in
chan_gtalk (available in
chan_sip as well), to allow the caller to establish SIP calls from his GoogleTalk client:
The maintainer of
res_jabber is Philippe Sultan <[email protected]>.