Unable to change Contact Header IP Address

Hello,

I am currently using Asterisk 15.3 and am trying to overwrite the Contact IP Address being used by Asterisk in its ‘200 OK’ response to an INVITE. I am trying to get Asterisk to use the Private IP Address of the Server it is on, but it is always using the Public IP Address, I have local_net set to the Private IP Address, and have played with rewrite_contact, and external_signaling_address, but nothing I have done so far is letting me set the Contact to the Private IP Address. I have a another Server that uses Asterisk 14.6 and I can get it to use the Private IP Address for the Contact. Note: the pjsip.conf files of these two Servers are comparable.

Thank you,

Clarifying, If using the exact same pjsip.conf, extentions.conf, and rtp.conf files; Asterisk 15.3 puts the Public IP-Address of the Asterisk Server into the Contact Header but Asterisk 14.6 puts the Private IP-Address of the Asterisk Server into the Contact Header for a “200 OK” from an “INVITE” Request. tcpdump captures show no other differences when other to pertinent data (The only difference is the version of Asterisk).

Thank you

(BUMP)

Apologies for digging this up… I am running into the issue with an internal address showing on the Contact SIP header for asterisk 15.6.2. What is the best way to set the Contact SIP address in 15.6.2

assuming you are using the preferred channel driver, or externaddr if you are using the legacy one. You will probably have to set the media address, as well, for the preferred one.

David,
Here is a block from my sip.conf (not using pjsip)

[twilio-virginia-inbound-1]
nat = no
localnet=10.89.2.0/255.255.255.0
externaddr=34.215.49.151
type=friend
dtmfmode=auto
host=54.172.60.0
context=from-trunk
allow=all
insecure=port
canreinvite=no

and the SIP headders still have

Contact: sip:+12012444088@10.89.2.121:5060

externaddr and localnet are in the wrong section, as I told you in