IP call to user behind NAT - RTP Loss one way


sorry for lengthy question but hope you understand my problem.
I am dialing a registered user via his URI, but facing one way audio. the problem is that called user never hears any sound while the calling party can hear the called party.

Asterisk server is on public ip while both caller and called user are behind different routers (even different countries) and are registered to asterisk. when i dial by “Dial(SIP/adf,30)” the voice is ok both ways. but dialing sip uri has this one way audio issue
Asterisk server ip: 33.44.555.xx
callee ip: 118.15.x.x
caller ip: 175.33.x.x

below is URI dial statement


I took traces and examined them under wireshark and came to conclusion that voice rtp path is ok from caller to server and back. like this

caller ------------------> asterisk [RTP OK]
caller <----------------- asterisk [RTP OK]

and RTP from callee to asterisk is ok
but RTP from asterisk is not reaching to callee

callee ----------------> asterisk [RTP OK]
callee <--------------- asterisk [NO RTP]

now lets take a look at sip debug traces of both normal sip call and uri call. i suspect that INVITE and TO fields are creating problem as they point to local ip in normal dialing and asterisk know how to send NAT to router ip and then contact local ip. but in case of uri dial both INVITE and TO fields contain router ip and hence asterisk has no way to reach local ip.

so can any body tell me how to tell asterisk to send INVITE to local ip via NATED router ip?

below are both normal and uri dial sip trace of INVITE.

URI dial … Voice problem … Dial(SIP/adf@118.15.x.x:5678,30)

Reliably Transmitting (NAT) to 118.15.x.x:5678:
INVITE sip:adf@118.15.x.x:5678 SIP/2.0
Via: SIP/2.0/UDP 33.44.555.x:5678;branch=z9hG4bK2de33d20;rport
From: “pepsi” sip:123456789@33.44.555.x:5678;tag=as0f65cc7f
To: sip:adf@118.15.x.x:5678
Contact: sip:123456789@33.44.555.x:5678

Normal dial … Voice OK … Dial(SIP/adf,30)

Reliably Transmitting (NAT) to 118.15.x.x:5678:
INVITE sip:adf@ SIP/2.0
Via: SIP/2.0/UDP 33.44.555.xx:5678;branch=z9hG4bK499e86c6;rport
From: “pepsi” sip:123456789@33.44.555.x:5678;tag=as1c845ff7
To: sip:adf@
Contact: sip:123456789@33.44.555.x:5678

so can any body tell me how to tell asterisk to send INVITE to local ip via NATED router ip?


I had a similar issue when Asterisk & SIP phone were behind NAT, and incoming calls were via SIP:xxx@domain.com, the calling party could hear the callee, but the callee could not hear the calling party.

I fixed it by making sure I had externip and externhost setup in my sip_nat.conf file. As your Asterisk server is in in the public side, I don’t think those settings would apply, but who knows!

I hope you get it resolved!


Both peers are defined with the “nat” setting for their entries in sip.conf?

You could also try disabling direct media by setting directmedia=no in the peers entries in sip.conf.