I’ve got a handful of FreePBX servers that need to be migrated to a new set of static public IPs on a different network (same upstream router, though). I need to minimize downtime - zero if possible.
What’s the best way to go about this?
My first thought is to run on both IPs until the DNS changes propagate. Is that feasible? How would I go about doing that? Can it be done with FreePBX, or do I need to do it at the Linux/asterisk level?
This is quite tough. I believe that you would have to set up two pjsip transports on different ports, because Asterisk needs to know its external address to send in SIP headers and SDP.
The lazy approach is to set the DNS TTL to e.g. one minute (30 seconds is theoretical minimum) and set the phones registration expiry to e.g. two minutes. Wait for this to propagate, then do the cutover. You’ll have about five minutes of downtime. You can then increase TTL and/or expiry as desired.
If you have a system that can’t tolerate any downtime, you really should have a live spare or even load balance between two or more servers. Unfortunately, this is even tougher.
Assuming you are in US or Canada, cutting over a system starting at e.g. 4 AM Eastern on a Sunday would be a very small disruption. If the trunking provider supports it, route failed calls to an announcement advising the caller to try again after an hour.
I do have DNS control, and can set up SRV records as soon as I get the new IPs from my hosting provider. My concern is that while I can specify the TTL, intermediate nameservers can choose to ignore that value.
Plus, unless I’m missing something, that post doesn’t address how to make a single asterisk instance listen on multiple IPs. I’m not concerned in the least about the route from asterisk to the VSP, but I am concerned about the routes to/from the phones.
I have come across docs that indicate that PJSIP can be configured to bind to a specific IP. FreePBX is currently configured for “both” chan_sip and chan_pjsip.
What is your application? For an ordinary business, it should be no big deal to be down for an hour in the wee morning hours on a weekend day. If it’s something seriously important e.g. an accidental poisoning hotline, you should have at least two servers always working anyhow.
I have a little niggle that chan_pjsip seems not easily to be configured to disallow IP address based communication. You can use URI or SRV routes for both trunks and extensions if they all support that.