login | register
Thu 04 of Dec, 2008 [02:21 UTC]

voip-info.org

Discuss [0] History

Asterisk cmd JabberStatus

Created by: JustRumours,Last modification on Wed 04 of Jun, 2008 [13:31 UTC]

Synopsis

 JabberStatus(Jabber,ScreenName,Variable)

Description

JabberStatus is used to retrieve the XMPP status of a buddy, and store it in a diaplan variable.

 Jabber - Client or transport Asterisk uses to connect to Jabber
 ScreenName - User Name to retrieve status from.
 Variable - Variable to store presence in will be 1-6.
                In order, Online, Chatty, Away, XAway, DND, Offline
                If not in roster variable will = 7

Example

Here is an AEL example of how to use it :

1234 => {
         JabberStatus(asterisk-gmail,buddy <at> gmail.com,STATUS);
         if (${STATUS}=1) {
                   NoOp(User is online and active, ring his Gtalk client.);
                   Dial(Gtalk/asterisk-gmail/buddy <at> gmail.com);
         } else {
                   NoOp(Prefer the SIP phone);
                   Dial(SIP/1234);
         }
}


Background

Philippe Sultan in June 2008:
Asterisk (or any other XMPP client) cannot change the Jabber status on
behalf of another Jabber user, even if you connect it as a component
to your XMPP server. This behaviour is forbidden by the XMPP specs.

To be able to do this, you can use OpenFire along with its Asterisk
plugin, or patch your own XMPP server. I had written a patch for
Jabberd2 some time ago, but I'm not aware of anything that would be
applicable to Ejabberd (written in Erlang).

I'm in the process of extending Asterisk's "Hints" dialplan to XMPP
notifications for authorized users. Those notifications would be
carried over XMPP as message stanza of type 'headline'. That will be a
first step toward implementing PEP (Personal Eventing via Pubsub).

See also



Comments