[asterisk-bugs] [JIRA] (ASTERISK-24687) Asterisk behind NAT sets wrong Contact Header

Lukas Hauser (JIRA) noreply at issues.asterisk.org
Thu Jan 15 09:55:36 CST 2015


    [ https://issues.asterisk.org/jira/browse/ASTERISK-24687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=224499#comment-224499 ] 

Lukas Hauser edited comment on ASTERISK-24687 at 1/15/15 9:55 AM:
------------------------------------------------------------------

Here the arguable rather uninteresting settings and outputs.

This is my setting of the peer:
{code}
asterisk*CLI> sip show peer 799


  * Name       : 799
  Description  : 
  Secret       : <Set>
  MD5Secret    : <Not set>
  Remote Secret: <Not set>
  Context      : localsets-common
  Record On feature : automon
  Record Off feature : automon
  Subscr.Cont. : <Not set>
  Language     : 
  Tonezone     : <Not set>
  AMA flags    : Unknown
  Transfer mode: open
  CallingPres  : Presentation Allowed, Not Screened
  Callgroup    : 
  Pickupgroup  : 
  Named Callgr : 
  Nam. Pickupgr: 
  MOH Suggest  : 
  Mailbox      : 
  VM Extension : asterisk
  LastMsgsSent : 0/0
  Call limit   : 0
  Max forwards : 0
  Dynamic      : Yes
  Callerid     : "" <>
  MaxCallBR    : 384 kbps
  Expire       : 3387
  Insecure     : no
  Force rport  : Yes
  Symmetric RTP: Yes
  ACL          : No
  DirectMedACL : No
  T.38 support : No
  T.38 EC mode : Unknown
  T.38 MaxDtgrm: 4294967295
  DirectMedia  : No
  PromiscRedir : No
  User=Phone   : No
  Video Support: No
  Text Support : No
  Ign SDP ver  : No
  Trust RPID   : No
  Send RPID    : No
  Path support : No
  Path         : N/A
  TrustIDOutbnd: Legacy
  Subscriptions: Yes
  Overlap dial : No
  DTMFmode     : auto
  Timer T1     : 500
  Timer B      : 32000
  ToHost       : 
  Addr->IP     : MY_PUBLIC_IP:2048
  Defaddr->IP  : (null)
  Prim.Transp. : UDP
  Allowed.Trsp : UDP
  Def. Username: 799
  SIP Options  : 100rel from-change replaces replace timer 
  Codecs       : (g722|alaw|ulaw)
  Auto-Framing : No
  Status       : OK (53 ms)
  Useragent    : snom300/8.7.3.25.5
  Reg. Contact : sip:799 at MY_INTERNAL_IP:2048;line=ekyetc70
  Qualify Freq : 60000 ms
  Keepalive    : 0 ms
  Sess-Timers  : Accept
  Sess-Refresh : uas
  Sess-Expires : 1800 secs
  Min-Sess     : 90 secs
  RTP Engine   : asterisk
  Parkinglot   : 
  Use Reason   : No
  Encryption   : No
{code}


This is the full output in rasterisk with sip debug and verbose/debug 5:
{code}
asterisk*CLI> 

<--- SIP read from UDP:My_Public_IP:2048 --->
INVITE sip:200 at Servers_Public_IP;user=phone SIP/2.0
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-7urjyzzcy8uk;rport
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 1 INVITE
Max-Forwards: 70
Contact: <sip:799 at My_Internal_IP:2048;line=ekyetc70>;reg-id=1
X-Serialnumber: 0004133BD3D8
P-Key-Flags: keys="3"
User-Agent: snom300/8.7.3.25.5
Accept: application/sdp
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO, UPDATE
Allow-Events: talk, hold, refer, call-info
Supported: timer, 100rel, replaces, from-change
Session-Expires: 3600;refresher=uas
Min-SE: 90
Content-Type: application/sdp
Content-Length: 487

v=0
o=root 1423334005 1423334005 IN IP4 My_Internal_IP
s=call
c=IN IP4 My_Internal_IP
t=0 0
m=audio 63440 RTP/AVP 9 0 8 3 99 108 18 101
a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:8hG6KenMGHoQudyXSAfEpNZDGfXGSEWEIoRRpSLu
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:99 G726-32/8000
a=rtpmap:108 AAL2-G726-32/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
<------------->
--- (19 headers 19 lines) ---
Sending to My_Public_IP:2048 (NAT)
Sending to My_Public_IP:2048 (NAT)
Using INVITE request as basis request - 54b7df7fc133-3j2o6a6kz2ln
Found peer '799' for '799' from My_Public_IP:2048

<--- Reliably Transmitting (NAT) to My_Public_IP:2048 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-7urjyzzcy8uk;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as715f8224
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 1 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="100a8bed"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '54b7df7fc133-3j2o6a6kz2ln' in 6400 ms (Method: INVITE)
Retransmitting #1 (NAT) to My_Public_IP:2048:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-7urjyzzcy8uk;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as715f8224
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 1 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="100a8bed"
Content-Length: 0


---

<--- SIP read from UDP:My_Public_IP:2048 --->
ACK sip:200 at Servers_Public_IP;user=phone SIP/2.0
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-7urjyzzcy8uk;rport
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as715f8224
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 1 ACK
Max-Forwards: 70
Contact: <sip:799 at My_Internal_IP:2048;line=ekyetc70>;reg-id=1
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---

<--- SIP read from UDP:My_Public_IP:2048 --->
INVITE sip:200 at Servers_Public_IP;user=phone SIP/2.0
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;rport
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Max-Forwards: 70
Contact: <sip:799 at My_Internal_IP:2048;line=ekyetc70>;reg-id=1
X-Serialnumber: 0004133BD3D8
P-Key-Flags: keys="3"
User-Agent: snom300/8.7.3.25.5
Accept: application/sdp
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO, UPDATE
Allow-Events: talk, hold, refer, call-info
Supported: timer, 100rel, replaces, from-change
Session-Expires: 3600;refresher=uas
Min-SE: 90
Authorization: Digest username="799",realm="asterisk",nonce="100a8bed",uri="sip:200 at Servers_Public_IP;user=phone",response="bafcc7afbc111650b1f0599622f8d421",algorithm=MD5
Content-Type: application/sdp
Content-Length: 487

v=0
o=root 1423334005 1423334005 IN IP4 My_Internal_IP
s=call
c=IN IP4 My_Internal_IP
t=0 0
m=audio 63440 RTP/AVP 9 0 8 3 99 108 18 101
a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:8hG6KenMGHoQudyXSAfEpNZDGfXGSEWEIoRRpSLu
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:99 G726-32/8000
a=rtpmap:108 AAL2-G726-32/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
<------------->
--- (20 headers 19 lines) ---
Sending to My_Public_IP:2048 (NAT)
Using INVITE request as basis request - 54b7df7fc133-3j2o6a6kz2ln
Found peer '799' for '799' from My_Public_IP:2048
Found RTP audio format 9
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 3
Found RTP audio format 99
Found RTP audio format 108
Found RTP audio format 18
Found RTP audio format 101
Found audio description format G722 for ID 9
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format GSM for ID 3
Found audio description format G726-32 for ID 99
Found audio description format AAL2-G726-32 for ID 108
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 101
Capabilities: us - (g722|alaw|ulaw), peer - audio=(ulaw|gsm|alaw|g722|g729|g726|g726aal2)/video=(nothing)/text=(nothing), combined - (g722|alaw|ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port My_Internal_IP:63440
Looking for 200 in localsets-common (domain Servers_Public_IP)
sip_route_dump: route/path hop: <sip:799 at My_Internal_IP:2048;line=ekyetc70>

<--- Transmitting (NAT) to My_Public_IP:2048 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Length: 0


<------------>

<--- SIP read from UDP:My_Public_IP:2048 --->
ACK sip:200 at Servers_Public_IP;user=phone SIP/2.0
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-7urjyzzcy8uk;rport
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as715f8224
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 1 ACK
Max-Forwards: 70
Contact: <sip:799 at My_Internal_IP:2048;line=ekyetc70>;reg-id=1
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Audio is at 18274
Adding codec g722 to SDP
Adding codec alaw to SDP
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (NAT) to My_Public_IP:2048 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

<------------>
Retransmitting #1 (NAT) to My_Public_IP:2048:
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---
Retransmitting #2 (NAT) to My_Public_IP:2048:
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---
Retransmitting #3 (NAT) to My_Public_IP:2048:
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---
Retransmitting #4 (NAT) to My_Public_IP:2048:
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---
Scheduling destruction of SIP dialog '54b7df7fc133-3j2o6a6kz2ln' in 6400 ms (Method: INVITE)
Retransmitting #5 (NAT) to My_Public_IP:2048:
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---
Retransmitting #6 (NAT) to My_Public_IP:2048:
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---
[Jan 15 16:40:55] WARNING[1056]: chan_sip.c:4047 retrans_pkt: Retransmission timeout reached on transmission 54b7df7fc133-3j2o6a6kz2ln for seqno 2 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6400ms with no response
Really destroying SIP dialog '54b7df7fc133-3j2o6a6kz2ln' Method: INVITE
{code}


was (Author: luka5):
Here the arguable rather interesting settings and outputs.

This is my setting of the peer:
{code}
asterisk*CLI> sip show peer 799


  * Name       : 799
  Description  : 
  Secret       : <Set>
  MD5Secret    : <Not set>
  Remote Secret: <Not set>
  Context      : localsets-common
  Record On feature : automon
  Record Off feature : automon
  Subscr.Cont. : <Not set>
  Language     : 
  Tonezone     : <Not set>
  AMA flags    : Unknown
  Transfer mode: open
  CallingPres  : Presentation Allowed, Not Screened
  Callgroup    : 
  Pickupgroup  : 
  Named Callgr : 
  Nam. Pickupgr: 
  MOH Suggest  : 
  Mailbox      : 
  VM Extension : asterisk
  LastMsgsSent : 0/0
  Call limit   : 0
  Max forwards : 0
  Dynamic      : Yes
  Callerid     : "" <>
  MaxCallBR    : 384 kbps
  Expire       : 3387
  Insecure     : no
  Force rport  : Yes
  Symmetric RTP: Yes
  ACL          : No
  DirectMedACL : No
  T.38 support : No
  T.38 EC mode : Unknown
  T.38 MaxDtgrm: 4294967295
  DirectMedia  : No
  PromiscRedir : No
  User=Phone   : No
  Video Support: No
  Text Support : No
  Ign SDP ver  : No
  Trust RPID   : No
  Send RPID    : No
  Path support : No
  Path         : N/A
  TrustIDOutbnd: Legacy
  Subscriptions: Yes
  Overlap dial : No
  DTMFmode     : auto
  Timer T1     : 500
  Timer B      : 32000
  ToHost       : 
  Addr->IP     : MY_PUBLIC_IP:2048
  Defaddr->IP  : (null)
  Prim.Transp. : UDP
  Allowed.Trsp : UDP
  Def. Username: 799
  SIP Options  : 100rel from-change replaces replace timer 
  Codecs       : (g722|alaw|ulaw)
  Auto-Framing : No
  Status       : OK (53 ms)
  Useragent    : snom300/8.7.3.25.5
  Reg. Contact : sip:799 at MY_INTERNAL_IP:2048;line=ekyetc70
  Qualify Freq : 60000 ms
  Keepalive    : 0 ms
  Sess-Timers  : Accept
  Sess-Refresh : uas
  Sess-Expires : 1800 secs
  Min-Sess     : 90 secs
  RTP Engine   : asterisk
  Parkinglot   : 
  Use Reason   : No
  Encryption   : No
{code}


This is the full output in rasterisk with sip debug and verbose/debug 5:
{code}
asterisk*CLI> 

<--- SIP read from UDP:My_Public_IP:2048 --->
INVITE sip:200 at Servers_Public_IP;user=phone SIP/2.0
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-7urjyzzcy8uk;rport
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 1 INVITE
Max-Forwards: 70
Contact: <sip:799 at My_Internal_IP:2048;line=ekyetc70>;reg-id=1
X-Serialnumber: 0004133BD3D8
P-Key-Flags: keys="3"
User-Agent: snom300/8.7.3.25.5
Accept: application/sdp
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO, UPDATE
Allow-Events: talk, hold, refer, call-info
Supported: timer, 100rel, replaces, from-change
Session-Expires: 3600;refresher=uas
Min-SE: 90
Content-Type: application/sdp
Content-Length: 487

v=0
o=root 1423334005 1423334005 IN IP4 My_Internal_IP
s=call
c=IN IP4 My_Internal_IP
t=0 0
m=audio 63440 RTP/AVP 9 0 8 3 99 108 18 101
a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:8hG6KenMGHoQudyXSAfEpNZDGfXGSEWEIoRRpSLu
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:99 G726-32/8000
a=rtpmap:108 AAL2-G726-32/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
<------------->
--- (19 headers 19 lines) ---
Sending to My_Public_IP:2048 (NAT)
Sending to My_Public_IP:2048 (NAT)
Using INVITE request as basis request - 54b7df7fc133-3j2o6a6kz2ln
Found peer '799' for '799' from My_Public_IP:2048

<--- Reliably Transmitting (NAT) to My_Public_IP:2048 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-7urjyzzcy8uk;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as715f8224
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 1 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="100a8bed"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '54b7df7fc133-3j2o6a6kz2ln' in 6400 ms (Method: INVITE)
Retransmitting #1 (NAT) to My_Public_IP:2048:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-7urjyzzcy8uk;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as715f8224
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 1 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="100a8bed"
Content-Length: 0


---

<--- SIP read from UDP:My_Public_IP:2048 --->
ACK sip:200 at Servers_Public_IP;user=phone SIP/2.0
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-7urjyzzcy8uk;rport
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as715f8224
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 1 ACK
Max-Forwards: 70
Contact: <sip:799 at My_Internal_IP:2048;line=ekyetc70>;reg-id=1
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---

<--- SIP read from UDP:My_Public_IP:2048 --->
INVITE sip:200 at Servers_Public_IP;user=phone SIP/2.0
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;rport
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Max-Forwards: 70
Contact: <sip:799 at My_Internal_IP:2048;line=ekyetc70>;reg-id=1
X-Serialnumber: 0004133BD3D8
P-Key-Flags: keys="3"
User-Agent: snom300/8.7.3.25.5
Accept: application/sdp
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO, UPDATE
Allow-Events: talk, hold, refer, call-info
Supported: timer, 100rel, replaces, from-change
Session-Expires: 3600;refresher=uas
Min-SE: 90
Authorization: Digest username="799",realm="asterisk",nonce="100a8bed",uri="sip:200 at Servers_Public_IP;user=phone",response="bafcc7afbc111650b1f0599622f8d421",algorithm=MD5
Content-Type: application/sdp
Content-Length: 487

v=0
o=root 1423334005 1423334005 IN IP4 My_Internal_IP
s=call
c=IN IP4 My_Internal_IP
t=0 0
m=audio 63440 RTP/AVP 9 0 8 3 99 108 18 101
a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:8hG6KenMGHoQudyXSAfEpNZDGfXGSEWEIoRRpSLu
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:99 G726-32/8000
a=rtpmap:108 AAL2-G726-32/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
<------------->
--- (20 headers 19 lines) ---
Sending to My_Public_IP:2048 (NAT)
Using INVITE request as basis request - 54b7df7fc133-3j2o6a6kz2ln
Found peer '799' for '799' from My_Public_IP:2048
Found RTP audio format 9
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 3
Found RTP audio format 99
Found RTP audio format 108
Found RTP audio format 18
Found RTP audio format 101
Found audio description format G722 for ID 9
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format GSM for ID 3
Found audio description format G726-32 for ID 99
Found audio description format AAL2-G726-32 for ID 108
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 101
Capabilities: us - (g722|alaw|ulaw), peer - audio=(ulaw|gsm|alaw|g722|g729|g726|g726aal2)/video=(nothing)/text=(nothing), combined - (g722|alaw|ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port My_Internal_IP:63440
Looking for 200 in localsets-common (domain Servers_Public_IP)
sip_route_dump: route/path hop: <sip:799 at My_Internal_IP:2048;line=ekyetc70>

<--- Transmitting (NAT) to My_Public_IP:2048 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Length: 0


<------------>

<--- SIP read from UDP:My_Public_IP:2048 --->
ACK sip:200 at Servers_Public_IP;user=phone SIP/2.0
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-7urjyzzcy8uk;rport
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as715f8224
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 1 ACK
Max-Forwards: 70
Contact: <sip:799 at My_Internal_IP:2048;line=ekyetc70>;reg-id=1
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Audio is at 18274
Adding codec g722 to SDP
Adding codec alaw to SDP
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (NAT) to My_Public_IP:2048 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

<------------>
Retransmitting #1 (NAT) to My_Public_IP:2048:
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---
Retransmitting #2 (NAT) to My_Public_IP:2048:
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---
Retransmitting #3 (NAT) to My_Public_IP:2048:
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---
Retransmitting #4 (NAT) to My_Public_IP:2048:
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---
Scheduling destruction of SIP dialog '54b7df7fc133-3j2o6a6kz2ln' in 6400 ms (Method: INVITE)
Retransmitting #5 (NAT) to My_Public_IP:2048:
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---
Retransmitting #6 (NAT) to My_Public_IP:2048:
SIP/2.0 200 OK
Via: SIP/2.0/UDP My_Internal_IP:2048;branch=z9hG4bK-ztufmjdkgq36;received=My_Public_IP;rport=2048
From: "asterisk" <sip:799 at Servers_Public_IP>;tag=xg3y10jayj
To: <sip:200 at Servers_Public_IP;user=phone>;tag=as48253780
Call-ID: 54b7df7fc133-3j2o6a6kz2ln
CSeq: 2 INVITE
Server: PhoneServer
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:200 at Servers_Internal_IP:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 298

v=0
o=peter-marrat 841592342 841592342 IN IP4 Servers_Internal_IP
s=PhoneServer
c=IN IP4 Servers_Internal_IP
t=0 0
m=audio 18274 RTP/AVP 9 8 0 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---
[Jan 15 16:40:55] WARNING[1056]: chan_sip.c:4047 retrans_pkt: Retransmission timeout reached on transmission 54b7df7fc133-3j2o6a6kz2ln for seqno 2 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6400ms with no response
Really destroying SIP dialog '54b7df7fc133-3j2o6a6kz2ln' Method: INVITE
{code}

> Asterisk behind NAT sets wrong Contact Header
> ---------------------------------------------
>
>                 Key: ASTERISK-24687
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24687
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_sip/General
>    Affects Versions: 13.1.0
>         Environment: ubuntu 14.04.1
>            Reporter: Lukas Hauser
>            Assignee: Lukas Hauser
>            Severity: Critical
>
> If asterisk is behind a statically configured NAT (e.g. with iptables), the externaddr or localnet option does not work.
> The Contact Header still contains the private IP address.
> The media_address option works.
> It also works as defined with version 11.7.0~dfsg-1ubuntu1.
> The Contact Header does not get updated in version 13.1 and 13.1.0-rc2.
> Therefore, I guess it is a bug in 13?
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list