DNS SRV for Remote Phones

I have a primary PBX and a warm spare at a secondary location. I have DNS Made Easy, with TTL set for 30 sec. for my domain which my phones are registered to. In the event of an outage, I take down the primary server, and MOST of my remote clients phones update IP’s within a minute or two. All remote clients EACH have a different ISP and IP. However, some IP changes do not propagate to their ISP (I’m assuming) and even rebooting hardware (phones, modems) will sometimes not work at updating the IP.

I’m reading up on DNS SRV to fix this issue, but need to know if I’m missing anything. I have primary and secondary SRV records as follows:

(Primary Server): _sip_udp.xyz.net. (Priority 1, weight 20) Port set for 5060
(Secondary Server) _sip_udp.xyz.net. (Priority 2, weight 10) Port 5060

Phones are set to register at domain, xyz.net. Phones (Sangoma S500, also set for SRV use and not A record)

Asterisk 13 SIP settings, YES for Enable SRV Lookup.

I dont know if there are any SIP registration timing/settings I should change, or if I have it mostly configured. I dont have 2 test boxes so I am basically waiting on my next outage to see if this works unless I can get some test boxes spun up. Can anyone advise anything left out or any other best practices? Thanks in advance.

You need something to diffentiate the various servers’ route beyond priority and weighing. You can use ip address if they are different or add a host name before the domain name , that would need a working dns server on you local router to so direct the inbound voip traffic correctly

I do have:

Blacked out areas are my “xyz.net” domain.
pbx1.xyz.net points to a static IP address of my primary server.
pbx2.xyz.net points to a static IP address of my secondary.

That work?

That depends on how your srv records are written, I don’t recognize the gui interface and it unclear that host pbx1 will inherit the xyz.net domain also. You won’t go wrong by using the raw ip address if they are truly static.

Ok. I will use IP instead of subdomain. Interface is DNS Made Easy.

Why? By doing that you’ve just defeated the whole point of your DNS SRV setup. So far everything looks fine with your SRV records and if the phones are set to use SRV lookups then everything should be good.

For the most part true but for this type of setup, it makes things wrong as how do you get the phones to know when IP is the master and which is the backup without making a bunch of accounts on the phone. Using the DNS SRV will allow the phone to query the DNS and have a list of destination to attempt to resolve/connect to.

“This type of setup” was described as
.
.
.

Phones are set to register at domain, xyz.net. Phones (Sangoma S500, also set for SRV use and not A record)
.
.
.

And there are SRV records for _sip._udp.xyz.net that resolve to pbx1.xyz.net and pbx2.xyz.net (last is an assumption based on current info provided). So if the S-series phones have their Proxy/Host set to xyz.net and “Use SRV Lookups” the phone will prepend _sip.udp. to xyz.net and do a SRV lookup. That will resolve the two records based on priority and weight.

Again, outside of just using xyz.net instead of a sip.xyz.net for the host, there is nothing wrong with the SRV records or the setup for doing this.

@jyates01 You don’t need to wait for an outage to test this. Just schedule a maintenance window and on the primary PBX just do “fwconsole stop” which will stop Asterisk from running and thus the system responding/listening on the IP at port 5060, this should be enough to trigger your SRV failover for testing and see if/how long it takes for the phones to hit the spare server.

Then “fwconsole start” to bring it all back online on the primary and see how long it takes for the SRV records to see it back up and push them back over.

1 Like

Thanks so much for the help. I’ll test tonight and advise.

Asterisk with chansip never worked with SRV records properly. Pjsip solves the issues not sure which channel driver you are using.

Reverse it. This is so the phones can do the SRV lookups to reach the PBX. So the channel driver is irrelevant here as the SRV support is 100% phone dependent in this case.

Sorry missed that.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.