All Circuits Are Busy after IP change

We are in the process of replacing an AsteriskNow distro server with the FreePBX distro. We have two routers on our network with each server pointing to a different router. The new server tests fine and I can dial out no problem.

What we tried to do was to disconnect the AsteriskNow server from the network. Then we changed the IP on the FreePBX distro to that of the AsteriskNow server. We were able to get everything to work fine as far as receiving external calls and being able to make extension to extension calls. What we weren’t able to do was make a call to an external number. When we did it complained, “All circuits are busy.” When we moved the server back to its original router and IP, it worked fine.

AsteriskNow Server

FreePBX server

Both servers are running using internal IP addresses and NAT.

Any suggestions?

Did you check the ARP cache of the upstream router/switch? Does the problem go away if you leave the server in place for (say) 30 minutes?

Double check all of your IP addresses, including the one set in the SIP/PJ-SIP settings. There are lots of places where IP addresses get set, so you might also want to use something like:

grep /etc/asterisk/* /etc/asterisk//

to see if the address is set in one of your subordinate config files.

It turns out the problem was that it was still using a trunk configuration from the testing environment so when the call got to Twilio, they rejected the connection due to a bad authentication since it was expecting a different public IP. Once I added the ACL to that test trunk for the production IP it worked. I then rebooted the server and removed the ACL and it appears the calls are now going out through the production trunk.

Turns out the problem was that after changing the IP and then changing the host for he SIP trunk, it held onto the host for the sip trunk even after reloading the configuration. Once I rebooted the server it worked. The way I noticed this is that when it tried to authenticate with Twilio, it failed.