For some reason, people have been doing this, and it's a bad idea.
The scenario is that in Asterisk sip.conf, the "externhost" is set to a certain hostname, or in FreePBX Asterisk SIP Settings, the external host name is set. The idea is to provide a hostname that points to the external IP for NAT mapping.
Then in /etc/hosts, that same host name is set to 127.0.0.1.
What would be the reason for this? So that Asterisk can always find itself? There is a bad side effect. When Asterisk registers to a remote SIP service, it uses the information it finds from that externhost to build a Contact: header. When the externhost is mapped to 127.0.0.1, the Contact: becomes sip:user@127.0.0.1.
Some services may ignore that but others, including GVGW, accept it since it is what the user has requested, but the end result is failed incoming calls.
The only name that should be mapped to 127.0.0.1 in /etc/hosts is localhost.
↧