[asterisk-users] Asterisk behind NAT and Kamailio --> Internal IP in SDP and not "externip"
Johan Wilfer
lists at jttech.se
Fri Jun 28 09:29:05 CDT 2013
Hi,
We have some Asterisk servers that we are moving behind a NAT to
preserve public addresses and make room for growth. This is Asterisk 1.4
NAT works very good with the externip/localnet-setting when we are
connected directly to our teleco. But when I try to use NAT and put them
behind our Kamailio something interesting happens: The media-address in
the SDP is the internal ip and not the external.
This is the setup:
Teleco <-> Kamailio <-> Asterisk
SIP --> 1.2.3.4
10.0.0.1 --> 10.0.0.2
externip=1.2.3.5
localnet=10.0.0.0/255.255.255.0
RTP <----------------> 1.2.3.5 (NAT:ed to 10.0.0.2)
On an incomming call from the teleco -> to kamailio (public addr) -> to
asterisk in the private net. Asterisk responds with the following SDP:
v=0
o=root 1889 1889 IN IP4 10.0.0.2
s=session
c=IN IP4 10.0.0.2
t=0 0
m=audio 23344 RTP/AVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
Asterisk seems to think that because the proxy is on the localnet, the
media is too, so it doesn't use the externip as the RTP-ip.
This is a incomming call and the RTP ip of the other leg is another
public address. So the RTP-ip should the public address (externip).
If I connect to the teleco directly from the pbx (bypassing kamailio)
Asterisk correctly uses the externip as the rtp-ip in the SDP.
I know this is an old and unsupported version of Asterisk, but any input
on the topic is welcome. If this is supported in later versions we can
maybe work around until we migrate later.
Thanks!
--
Johan Wilfer
More information about the asterisk-users
mailing list