Your experience is strange. Normally, in Asterisk SIP Settings on the General tab, you set your External Address and Local Networks. This data is for both pjsip and chan_sip. On the chan_sip tab, you can override the external address, but that is only required in unusual circumstances and is normally left blank.
The purpose of these settings is for Asterisk to supply its external address in SDP (telling the remote server or device where to send audio) when the remote address is not in the ranges set in Local Networks.
What may be happening in your case is one of:
- The external address on the General tab is incorrect.
- Your router/firewall does not have the RTP port range forwarded to the internal address of the PBX.
- Your router/firewall has a SIP ALG enabled that is corrupting the traffic.
- Your router/firewall is not preserving the source port number for outgoing RTP.
Then, when you put the internal IP as the external address, the trunking provider sees your system as behind NAT and does their own NAT traversal logic (including sending RTP back to the address and port that your RTP came from), which works around the problem. IMO this is not a good long term solution because it won’t work with external extensions, unless they can simulate being on a public IP, and it won’t work with trunking providers that don’t handle NAT traversal.