SIP Presence Across Two Servers

Home » Asterisk Users » SIP Presence Across Two Servers
Asterisk Users 3 Comments

Hi All,

We’ve been running Asterisk for years in our offices but just recently replaced an Asterisk Appliance* in our smaller office with an actual server, upgraded the server in hardware in our HQ location and upgrading both ends to 11.5.0 with Gareth’s patch for Cisco phones.
99.99% of our endpoints are Cisco 7961Gs.

Each office is more-or-less standalone for ease of management and fault tolerance but we have a unified dialplan and SIP “trunking” from site to site via our VPN.

Everything presence related works wonderfully for local users, but I’m hoping there’s a way we could get presence for the people “at the other end of the pipe” fairly transparently. We have a lot of cross-office collaboration, and our office manager/receptionist (who has the battleship of a 7961G+7914+7914 BLF) would love to “at a glance” know if the remote folks are available for a call or not.

I’m sure this has been covered, but my Googlefu us turning up a ton of redundant, old, and deprecated information so I’ve resorted to asking here. From what I have found it sounds like it may be “easier” with IAX2 but my experiments with IAX2 haven’t yielded wonderful results and management prefers “SIP everywhere”

If anyone has any pointers I’d greatly appreciate it – thanks in advance!

Lincoln

*- One of the worst IT decisions I’ve made for better or worse. Looked good on paper; in practice not a good idea for anything beyond a very simple SOHO.

3 thoughts on - SIP Presence Across Two Servers

  • Aligning presence over multiple servers is not simple and require some changes on the dialplan and some custom code to transmit the state from one server to the other.

    The BLF on the phone is displayed using the “hint” of an extension. To be able to manually manage the “hint” of an extension, you need to first link the internal hint to the Custom hint. In the extensions.conf just add:

    exten => _.,hint,Custom:${EXTEN}

    I was unable to create the same entry in the AEL language or in the realtime extensions table… if any was able, I will appreciate.

    If a phone want to know the status for the 100-TEST sip account, it will poll the hint for 100-TEST and in the end, it will check the status for Custom:100-TEST.

    Now you need an application to capture the change in status of every extension on server A and send it to server B, so the Custom:100-TEST will have the same value on both servers.

    I solved this problem creating a small pair of php application, using Asterisk Manager Interface to continuously listen to events. If I see a phone dialing out, I change its Custom state to IN_USE… if he hangups, I
    change the state back to AVAILABLE … if it is ringing, I change the state in RINGING and so on. You need to take into account multiple calls can be made by the same phone and so it is not really so straightforward. When the php AMI application identify a change in the state for a phone, it notifies the same application running on the other server about the change, so both asterisk are taken aligned.

    Let me know if you need additional details.

    Leandro

    2013/11/13 Lincoln King-Cliby