Asterisk 1.6, Now with Distributed Presence

Have you ever wanted presence information across multiple Asterisk servers? Well, making that possible is something that I have worked on a bit here and there. I previously made a post asking for some of that code to be tested. Now, this code has been merged in to Asterisk 1.6.

Asterisk 1.6.1 will have the ability to share device state between servers using a new module, res_ais, which uses the SAForum AIS to share events between Asterisk servers. It has been tested with and developed against the openais implementation of AIS.

In addition to writing res_ais, this effort consisted of a lot of improvements to the Asterisk core to understand distributed device state. My next step is to complete the changes to pbx_dundi to allow Asterisk servers to use DUNDi to share events, as well. This should provide the best results for servers that want to share state information across the Internet, as opposed to servers in a local cluster on a high speed LAN.

Commits related to merging this code into Asterisk 1.6:

23 thoughts on “Asterisk 1.6, Now with Distributed Presence

  1. Hello!

    Why dont you use XMPP aka Jabber for syncing states between remote servers? Its all in there AFAIK. Dont get it why we have to invent yet another protocol….
    Besides this technical detail I think this is seriously cool feature! Congrats!

  2. Thanks for the feedback. Someone else has mentioned using XMPP, too. I think that’s an interesting idea. Before I work any further on modifying DUNDi to do what I need, I’m going to research that method and give it serious consideration.

  3. Please continue and finish the work on DUNDi.
    DUNDi is already up and running in a lot of setups with multiple servers in a ‘cluster’ over the internet.
    Having to setup XMPP besides that for this would be a major bummer

  4. Yeah, that was what got me looking at doing it with DUNDi in the first place. However, I should do my due diligence and consider all of the reasonable options.

  5. Using XMPP for presence sharing and messaging would be a logical step forward.

    Especially now that the manufacturers of SIP phones have it integrated in their recent models.
    If you haven’t had a look at the wireless Siemens SIP-DECT phones, you should really, really do that!, all their handsets have a XMPP (Jabber) client on board by default, which opens a whole new world of possibilities!
    How great it would be if Asterisk would support that functionality out of the box!

  6. Pingback: Distributed Presence For Asterisk in Asterisk 1.6.1. | VoIP MoVoIP Blog

  7. Hi Russell,

    Brian West (bkw) told me that doing distributed presence on top of DUNDI is a stupid idea… what do you think of this? was he just trolling? or is this a bad idea at all?

    Thanks in advance, keep up the great work!

  8. Why not do both? XMPP is semi-‘native’ presence, and DUNDI would be terrific for the more PBX-related functions / systems.

    Let’s have our cake and eat it too.

  9. Let’s give the guy a chance, we all agree that distributed presence is the endgoal, so let’s all give Russell a chance to check out both methods. He hasn’t steered us wrong yet.

    Thanks for all the great work.

  10. Pingback: Astricon, Code Zone Adventures

  11. Russel,

    Your improvments with clustering are a real need for us . Thank you for working on this side.

    Our main goal is to solve this : “how SIP session information could be transferred to a server in the case of a fault on another server” (was in one of your previous post).

    We will gonna have a try and keep you informed.

    Thanks for all the great work.

  12. I agree with what Teleweb and Eric Stone have said and believe that both XMPP and DUNDi are required. In order to compete effectively in the enterprise against Unified Communication Solutions the need for XMPP arises when you start talking presence/IM. SIP is not designed for this type of communication (see HTML or PDF of “On Helicopters and Submarines” here, XMPP however while best known as an IM tool (Jabber) is much more, and was designed specifically with the intent of securely routing context-sensitive data among a complex interconnection of nodes (see “XMPP transports presence data” here, DUNDi was created to handle that which SIP could not and publishes routes which are in turn accessed via IAX, SIP and H.323. I would say leave the IM functionality to XMPP and the telephony functionality to DUNDi. Great work Russell, keep up the great work.

  13. I’ve some problem with this, i’ve installed openais but when i “make menuselect” in asterisk directory i see XXX before res_ais. I tried alot to fix this issue but no luck. Please guide me to fix this.

  14. Russel , Can we use this clustering for sharing device states across the data centers. Actually we have two data centers one in Newyork and other is in California and there is 100ms network delay between these two data centers.

  15. I’m managing a project for a customer to implement Office Communications Server 2007 R2. Pilot begins in late June. The customer is using the Asterisk solution for their VoIP (it’s a new implementation, pilot begins in early June). I am looking for documentation on how Asterisk publishes presence information for devices. We are looking to integrate OCS and Asterisk to display the user’s phone presence on OCS. Would you be able to offer any guidance/point me in the right direction? The Asterisk implementation is being done by another vendor and they have no experience in such an implementation so I haven’t been able to get anywhere with them.


  16. It is now possible to do this using XMPP, as well, which will be the best solution for doing this between remote servers. It was just merged into the development tree and will be a part of Asterisk 1.8 when it released later this year.

  17. Hi,

    I’m trying distributed event with Openais but don’t work.

    I made the test with two asterisk box in the same LAN

    box A: asterisk
    BoxB: asterisk 1.8.0


    # Please read the openais.conf.5 manual page

    totem {
    version: 2
    secauth: off
    threads: 0
    consensus: 4800
    interface {
    ringnumber: 0
    mcastport: 5405

    logging {
    to_stderr: yes
    debug: on
    timestamp: on
    to_file: yes
    to_syslog: no
    syslog_facility: daemon
    logfile: /var/log/openais.log

    amf {
    mode: disabled

    When I load, the pbx crash (boths)

    Some time not crash but no clusters members are present.

    What I’m doing wrong?



Leave a Reply to russell Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.