Change INVITE with private IP to public

How can I send INVITE with public IP in SDP? My Asterisk is behind NAT and when I make a call I don’t hear the ringing tone. My operator says that this is due to the wrong (private Asterisk IP address) address being sent in INVITE packet. My Asterisk is 16.7.0 and use pjsip channel driver.

I tried to make it work by modifying:
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
local_net=172.23.16.0/24
;external_media_address=78.xx.xx.117
;external_signaling_address=78.xx.xx.117

However when I uncomment the last two lines then no any call is possible.

My all endpoints also has:
from_domain=78.xx.xx.117
but I don’t see any difference.

What else can I check?

Have you forwarded the ports to the Asterisk instance? Can you provide a log with the external options enabled (as that is how to place your public IP address in the signaling and SDP)?

When I enable external_media_address=78.xx.xx.117
then there is (null) instead of the IP address in the INVITE
and Warning: 301 87.xx.xx.4 “invalid transport IP address”

v=0
o=- 38900982 38900982 IN IP4 (null)
s=Asterisk
c=IN IP4 (null)
t=0 0
m=audio 15072 RTP/AVP 0 8 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

I didn’t forward any ports on the router because I thought that since I can make a call then it is not needed.

What is the output of /etc/hosts? What is the precise current configuration? What platform/distro are you using? As well your version of Asterisk is old, and if I recall there were some issues resolved in that area.

I have updated my Asterisk to 16.11.1 but still I don’t hear ringing sound.

My endpoints looks like this:

endpoint-template](!)
type=endpoint
transport=transport-udp
context=from-internal
disallow=all
allow=ulaw
direct_media=no
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
from_domain=78.xx.xx.117

pjsip_wizard.conf

[netia]
type=wizard
aor/maximum_expiration=300
aor/default_expiration=300
aor/qualify_timeout=10.0
aor/qualify_frequency=30
aor/contact=sip:demo.integralnet.pl:5060
aor/remove_existing=yes
endpoint/context=from-external
endpoint/allow=!all,alaw,ulaw,g729
endpoint/direct_media=no
endpoint/send_pai=yes
endpoint/send_rpid=yes
endpoint/from_user=48xxxxxxx0
endpoint/from_domain=demo.integralnet.pl
identify/match=87.xxx.xxx.4/32
client_uri_pattern=sip:48xxxxxxx0@${REMOTE_HOST}
;registration/server_uri=sip:${REMOTE_HOST}
;registration/client_uri=sip:48xxxxxxx0@${REMOTE_HOST}
registration/contact_user=48xxxxxxx0
registration/auth_rejection_permanent=no
registration/expiration=60
outbound_auth_type=userpass
outbound_auth/username=NG0000000_1
outbound_auth/password=***
remote_hosts=demo.integralnet.pl
sends_auth=yes
sends_registrations=yes

/etc/hosts

87.xxx.xxx.4 demo.integralnet.pl

Can you please send me the jira link to the issues please

That’s incomplete, I wanted full configuration including transports and everything. As well what is the platform/distro you are using?

I don’t have them, I remembered reviewing code in that area - that is all.

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