I recently built a new FreePBX server using FreePBX 16.0.40.4 and Asterisk 20.4.0. Not the official distribution, this is on a Raspberry Pi. Then, I restored a config backup from my previous FreePBX 15 installation. It mostly works except that the FastAGI server is binding to the localhost IPv6 address ::1, but the calls to the server in the Asterisk config files point to the IPv4 localhost address 127.0.0.1 so there is no response from the AGI server. Just one example:
exten => s,n(dial),AGI(agi://127.0.0.1/dialparties.agi)
This causes a lot of issues, like incoming calls not working. I suspect it may be because my old server was IPv4 only, and I restored the backup onto the new server which is dual-stack (IPv4 and IPv6).
I managed to get it working by removing the ::1 localhost entry from /etc/hosts, leaving only 127.0.0.1 for localhost. This causes the AGI server to correctly bind to the IPv4 address, and everything works. I could leave it like this, but I’m wondering if there’s a better way.
Thanks!