How big an internet user are you? If you are big enough you should do this using the proper internet mechanisms for dual homing, in which case all your IP addresses will be available over all your service providers,
The company I used to work for, in the UK, had proper autonomous system numbers, even though it had less than 100 employees.
The proper way is with border gateway protocol and autonomous system numbers, but that is a service only likely to be provided by ISPs aiming at medium to large businesses.
Ad Daivd55 was mentioned, if you have BGP4 routing and dual providers this problem wouldn’t exist, because both providers are routing your IP addresses, but I’m guessing this is not the case.
I have clients with this exact configuration and you need to force all traffic out of a specific route on thre router/firewall and define SIP as the IP associated with that route on the PBX.
That I’m aware of you need to manually switch both firewall and SIP at the point it fails and there is no way to make it happen automatically.
I will further define this for someone reading it and saying of course you can…
Yes most firewalls will configure fail over and that will work, but your PBX will have the wrong SIP IP and once the call connected will almost immediately drop as well as media not communicating.
I’m not sure if Schmooze HA will change the SIP IP, that may be something to research.
I don’t see why you would have to force traffic out a specific route. Your pfsense takes care of the failover from one internet connection to the other but Asterisk has to find out about your external IP address being different.
You can accomplish that by using a hostname in your SIP settings instead of a fixed IP.
You would then need a mechanism so that your hostname resolves to your currently active external IP address by using some DDNS service or use the one you get when you purchase Freepbx sysadmin pro.
You can do this automatically. You need to use DYNDNS name and specify that in Asterisk SIP settings. At that point if you write a script to check for IP address change, then reload asterisk once that happens, it will re-register via the new IP address (of course DYNDNS would have changed at that point). Then incoming calls will know where to go.
My issue is that I can’t make this happen instantly. It will take a few minutes to determine the IP address change, then reload and all should be good at that point. But during that time, I get 1-way audio, because the UDP traffic won’t know where to go during that time. The SIP provider thinks the box is still registered at 1 IP and the box is now using a different IP address.
You don’t need to do that. Dnsmgr will regularly resolve the name (default I think is 300 seconds) and Asterisk will update itself (at least with PJSIP).
Now if you register to your provider incoming calls will fail until your server sends a register packet via the new active internet connection with a different IP address.
You can set Asterisk to send registration packets more frequently if it’s too long between registrations.
Ah, you’re right. I added the dnsmgr.conf file with proper syntax and now it’s enabled, after an asterisk restart.
This should now monitor the change of IP address as long as the DYNDNS entry is listed in the Dynamic Host entry field. I assume at that point if the primary WAN goes down the hostname is updated and asterisk will re-register with SIP provider and new IP address.