I've got an asterisk server out in the cloud, and a Linksys SPA-504G behind a nat in my home.
My router port forwards TCP 5060-5063, and also UDP 10000-20000 (for RTP) to the sip phone.
My phone is set for NAT Mapping Enable = yes and Nat Keep Alive Enable = yes. SIP is set to 5061, not 5060.
The phone is set NOT to register. Instead, my public IP address is set in the sip.conf stanza at the Asterisk server.
Here's my sip.conf entry:
[201]
type=peer
host=69.xxx.xxx.121
nat=force_rport,comedia
dtmfmode=rfc2833
insecure=invite,port
context=6502
defaultuser=201
canreinvite=no
qualify=yes
port=5061
RTP packets are getting sent back to my internal address, 192.168.1.3, rather than the public address.
My SIP INVITE header looks like so:
<--- SIP read from UDP:69.xxx.xxx.121:5061 --->
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.3:5061;branch=z9hG4bK-9f38d4c9;rport
From: "Ed Greenberg" <sip:[email protected]>;tag=ac07a7e1291a5687o0
To: <sip:[email protected]>
Call-ID: [email protected]
CSeq: 101 INVITE
Max-Forwards: 70
Contact: "Ed Greenberg" <sip:[email protected]:5061>
Expires: 240
User-Agent: Cisco/SPA504G-7.5.6a
Content-Length: 389
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER, UPDATE
Supported: replaces
Content-Type: application/sdp
v=0
o=- 4725 4725 IN IP4 192.168.1.3 <--- note internal address here
s=-
c=IN IP4 192.168.1.3 <--- and here
t=0 0
m=audio 16448 RTP/AVP 0 2 8 9 18 96 97 98 101
a=rtpmap:0 PCMU/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:18 G729a/8000
a=rtpmap:96 G726-40/8000
a=rtpmap:97 G726-24/8000
a=rtpmap:98 G726-16/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:30
a=sendrecv
<-------------->
I note that both c= and o= show my internal address, not my external address. Not sure how to influence this in the Linksys beyond what I've done.
NAT Mapping Enable: yes
Nat Keep Alive Enable: yes
Insert VIA rport=yes
Send Resp to Src Port=yes.
I tried with and without a STUN server.
Any ideas?
Thanks