Registration Failover

I have 2 Asterisk servers (Primary and Secondary). The secondary runs a backup once a day to mirror the config of the primary.

All of our IP500’s are programmed to register to both servers and flawlessly fail over to the secondary if there is a problem.

I am now starting to experiment with SIP clients on Android and iPhone however these only support single server registration.

My problem is that if the primary goes offline the mobile phone does not know about the existence of the secondary. I have experimented with DNS-SRV which works fine however I have found that the following scenario causes problems:

Android registered to primary - Makes and receives calls via primary fine.

Primary goes offline so Android uses DNS-SRV to switch across to the secondary - Makes and receives calls via secondary fine

Primary comes back online however Android does not switch registration back therefore the IP500 handsets which are now back to the primary see the Android as being unreachable and cannot call the phone however the Android can make calls via the secondary.

Can anyone advise?

Sounds like a problem with the Android SIP stack not keeping an eye on the primary server. We ran into this problem with an old Yealink firmware where it did exactly the same behavior. In that case, Yealink had to actually update their code to add some hooks to say “Keep an eye on server A and go back to it when it comes online again”. My guess is that the Android SIP client isn’t doing that. Might try posting as a bug on the Android devel forums since it’s not a PBX problem but a client issue…

As a work around maybe you can setup a script on the backup server that keeps an eye on the first, and when it comes back online it could disconnect/de-register the Android clients. That would force them to try to re-register, which I suspect would mean they’d check the DNS-SRV entry again. I’ve never built such a script but I’m sure it’s possible…