PJSIP, NAT and RTP: no audio

Basically, RTP is going to the endpoint local IP address, so I don’t have audio.

Here’s the relevant configs:

Local server IP: 192.168.44.6
WAN server IP: 131.161.42.186
Local endpoint IP: 192.168.42.10
WAN endpoint IP: 187.107.126.32

pjsip.conf: https://pastebin.com/raw/Eb3Ws3vw

debug info: https://pastebin.com/raw/QayrjEts

I’m using Asterisk Certified 13.13-cert8. Any suggestions?

You have not provided the contents of the “endpoint-internal” template so the configuration is incomplete. If “rtp_symmetric” is not set to yes then we won’t send to their source address. You will also need to provide the output of “rtp set debug on” to confirm that media is reaching Asterisk from the remote endpoint.

Sorry, here’s it:

[transport-udp-nat]
type = transport
protocol = udp
bind = 0.0.0.0:5063
allow_reload = yes
; NAT settings
local_net = 192.168.44.0/24
external_media_address = 131.161.42.126
external_signaling_address = 131.161.42.126

endpoint-internal
type = endpoint
context = Long-Distance
allow = !all,alaw
trust_id_outbound = yes
device_state_busy_at = 1
dtmf_mode = rfc4733
direct_media = no
transport = transport-udp-nat
;media_address = 131.161.42.126
;media_use_received_transport = yes
rtp_symmetric = yes
force_rport = yes
rewrite_contact = yes

auth-userpass
type = auth
auth_type = userpass

aor-single-reg
type = aor
max_contacts = 1
remove_existing = yes

998
auth = 998
aors = 998
callerid = 998 <998>

998
password = ASjn1j32nrif
username = 998

998
mailboxes = 998@example

999
auth = 999
aors = 999
callerid = 999 <999>

999
password = Aslknfdalrn1r2
username = 999

999
mailboxes = 999@example

Here’s the rtp debug:

-- PJSIP/998-00000002 answered
-- Started music on hold, class 'default', on channel 'PJSIP/998-00000002'

Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007809, ts 000160, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007810, ts 000320, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007811, ts 000480, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007812, ts 000640, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007813, ts 000800, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007814, ts 000960, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007815, ts 001120, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007816, ts 001280, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007817, ts 001440, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007818, ts 001600, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007819, ts 001760, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007820, ts 001920, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007821, ts 002080, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007822, ts 002240, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007823, ts 002400, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007824, ts 002560, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007825, ts 002720, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007826, ts 002880, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007827, ts 003040, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007828, ts 003200, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007829, ts 003360, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007830, ts 003520, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007831, ts 003680, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007832, ts 003840, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007833, ts 004000, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007834, ts 004160, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007835, ts 004320, len 000160)
Sent RTP packet to 192.168.42.10:12944 (type 08, seq 007836, ts 004480, len 000160)

I’m doing a “originate” so only Asterisk sends audio to the endpoint.

It does not appear as though Asterisk received any media from the remote side so it was not able to change outgoing media to its source. You’ll need to check any firewall in place to make sure it is forwarding the RTP range, and also confirm the correct the IP address. For example you’ve configured Asterisk with an external IP address of “131.161.42.126” but in your initial post you stated it is “131.161.42.186”.

Shame on me, it really was the wrong IP address :frowning:

Sorry about the noise.