RTP issues to sip trunk when using DNS name rather than IP

I’m now managing a few FreePBX installations, all built with the SNG7 iso and running FreePBX 16 and Asterisk 18. I’m noticing that when using a DNS name rather than the public IP in the Asterisk SIP > External IP setting, i’m getting issues with the RTP setup. In a pcap, everything looks to be resolving the correct IP, except the from, where it lists 127.0.0.1, but the rest of the contact info seems to be resolving the correct IP. Pinging the DNS name from the FreePBX install gives the same 127.0.0.1 loopback. Hostname is set to the same DNS name, under sys admin. Is this typical? Should I be able to use a DNS name here? One of the systems is at a location with dynamic DNS from the ISP (trying to get a static but ISP is being troublesome), or just for flexibility if the IP ever needs to change.

Quick update on this, SIP provider got back to me and said the address in SDP is 127.0.0.1. When I ping the DNS/hostname of the FreePBX instance from SSH, it also returns 127.0.0.1.

I think you must have the host name pointing to 127.0.0.1 in your /etc/hosts file.

Just checked and it sure is. Would that have set when setting the host name in freepbx? I guess what I would like is the DNS name to be sent out in SDP rather than PJSIP resolving the hostname locally and sending whatever IP it comes up with. That way, if I have a local DNS resolver that resolves a local ip, it wont affect an external connection. Like the SIP provider would just resolve the DNS name. Or is this just not the way things work?

I think the reason it resolves it to an address is that an FQDN can resolve to multiple addresses, but, for things to work, the RTP needs to go to the specific machine.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.