[asterisk-users] RTP sent to remote internal IP
Harel Cohen
harel at mayorcom.com
Sat Mar 21 17:23:50 CDT 2015
Hello List,
I need your advise please.
I am trying to establish a call from Asterisk 1.8.15-cert5 to one remote SIP
UA (not Asterisk), both are behind NAT. That remote peer is configured with
nat=yes in my sip.conf but yet RTP packets are being sent to its internal IP
address which is declared in the Connection Information (c) in the SDP,
obviously reaching nowhere. I need RTP to be sent to the public IP address
as it is seen on the packet header. Signalling is flowing correctly with no
issues.
Could you please advise why is this happening and how to correct this?
Here is the [peer] in my sip.conf and the SDP in the setup (INVITE + OK).
I'll be happy to provide any other information if needed:
Sip.conf:
[peer_name]
deny=0.0.0.0/0
permit=<remote_public_IP>
type=peer
host=<remote_public_IP> ; same as permit
defaultip=<remote_public_IP> ; same as permit
qualify=no
nat=yes
disallow=all
allow=alaw
context=CALL_in
dtmfmode=rfc2833
codecprobe=yes
canreinvite=yes
video=no
restrictcid=no
insecure=invite
trustrpid = yes
Below is the SDP from both the INVITE and OK packets (from TShark).
172.24.100.2 is the local-private IP address of the remote UA and
192.168.1.200 is the local-private IP of my Asterisk. Both public IP's are
static and do not change:
*INVITE*
Internet Protocol Version 4, Src: 192.168.1.200 (192.168.1.200), Dst:
<remote_public_IP> (<remote_public_IP>) User Datagram Protocol, Src Port:
65060 (65060), Dst Port: 5060 (5060) Session Initiation Protocol (INVITE)
Request-Line: INVITE sip:858@<remote_public_IP> SIP/2.0
Message Header
Message Body
Session Description Protocol
Session Description Protocol Version (v): 0
Owner/Creator, Session Id (o): root 614275163 614275163 IN IP4
<my_public_IP>
Session Name (s): Quantum PBX V 3.0 1.8.17.1 cert
Connection Information (c): IN IP4 <my_public_IP>
Time Description, active time (t): 0 0
Media Description, name and address (m): audio 18468 RTP/AVP 8
101
Media Attribute (a): rtpmap:8 PCMA/8000
Media Attribute (a): rtpmap:101 telephone-event/8000
Media Attribute (a): fmtp:101 0-16
Media Attribute (a): ptime:20
Media Attribute (a): sendrecv
*200 OK*
Internet Protocol Version 4, Src: <remote_public_IP> (<remote_public_IP>),
Dst: 192.168.1.200 (192.168.1.200) User Datagram Protocol, Src Port: 5060
(5060), Dst Port: 65060 (65060) Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Message Header
Message Body
Session Description Protocol
Session Description Protocol Version (v): 0
Owner/Creator, Session Id (o): default 1426152411 1426152411 IN
IP4 172.24.100.2
Session Name (s): Quantum PBX V 3.0 1.8.17.1 cert
Connection Information (c): IN IP4 172.24.100.2
Time Description, active time (t): 0 0
Media Description, name and address (m): audio 32000 RTP/AVP 8
101
Media Attribute (a): sendrecv
Media Attribute (a): rtpmap:101 telephone-event/8000
Media Attribute (a): fmtp:101 0-15
Media Attribute (a): silenceSupp:off - - - -
Media Attribute (a): ptime:20
Media Attribute (a): maxptime:90
After this 'OK' RTP packets are sent to 172.24.100.2 instead of
<remote_public_IP>
Thank you,
Harel
More information about the asterisk-users
mailing list