[solved] Asterisk 11 and nat=yes

I use asterisk 10 with “nat=yes” , after upgrade to asterisk 11 and change “nat=yes” to “nat=force_rport,comedia” , some SIP clients don’t work. After change on asterisk 11 “nat=force_rport,comedia” backward to “nat=yes” , this clients work again.

What is it about the clients that needs NAT fixups? (A lot of people use nat= when they don’t need it, but it sounds like you do need it.)

There was an issue tracker issue about nat=yes not being the same as your combination. I’d suggest looking at that issue and seeing what the conclusion was, or if it is still open, adding a “me too”.

In my case

Client (172.16.0.33:5060) - Client NAT (95.138.160.45:6789) - My server (88.80.1.50:5060)

With “nat=yes” my server sending packet to 95.138.160.45:6789 and this normal, but with “nat=force_rport,comedia” packet sending to 95.138.160.45:5060 and this erroneously.

with “sip=yes”

[code]<— SIP read from UDP:95.138.160.45:6789 —>
OPTIONS sip:88.80.1.50 SIP/2.0
Via: SIP/2.0/UDP 172.16.0.33:5060;branch=z9hG4bK7234c042;rport
Max-Forwards: 70
From: “asterisk” sip:asterisk@172.16.0.33;tag=as7a4f4a22
To: sip:88.80.1.50
Contact: sip:asterisk@172.16.0.33:5060
Call-ID: 3a181af619cfeb742df8da847babca49@172.16.0.33:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 1.8.15.0
Date: Tue, 19 Mar 2013 05:52:02 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0

<— Transmitting (NAT) to 95.138.160.45:6789 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.0.33:5060;branch=z9hG4bK7234c042;received=95.138.160.45;rport=6789
From: “asterisk” sip:asterisk@172.16.0.33;tag=as7a4f4a22
To: sip:88.80.1.50;tag=as12d5101b
Call-ID: 3a181af619cfeb742df8da847babca49@172.16.0.33:5060
CSeq: 102 OPTIONS
Server: Asterisk PBX 11.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:88.80.1.50:5060
Accept: application/sdp
Content-Length: 0[/code]

with “sip=force_rport,comedia”

[code]<— SIP read from UDP:95.138.160.45:6789 —>
OPTIONS sip:88.80.1.50 SIP/2.0
Via: SIP/2.0/UDP 172.16.0.33:5060;branch=z9hG4bK30f1a216;rport
Max-Forwards: 70
From: “asterisk” sip:asterisk@172.16.0.33;tag=as0a042694
To: sip:88.80.1.50
Contact: sip:asterisk@172.16.0.33:5060
Call-ID: 2bac31670113f59d48c86e6e012ae030@172.16.0.33:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 1.8.15.0
Date: Tue, 19 Mar 2013 05:51:50 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0

<— Transmitting (no NAT) to 95.138.160.45:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.0.33:5060;branch=z9hG4bK30f1a216;rport;received=95.138.160.45
From: “asterisk” sip:asterisk@172.16.0.33;tag=as0a042694
To: sip:88.80.1.50;tag=as1c414cce
Call-ID: 2bac31670113f59d48c86e6e012ae030@172.16.0.33:5060
CSeq: 102 OPTIONS
Server: Asterisk PBX 11.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:88.80.1.50:5060
Accept: application/sdp
Content-Length: 0[/code]

Trouble solved.

issues.asterisk.org/jira/browse/ASTERISK-20674