[Home]

Summary:ASTERISK-23329: Realtime Peers behind NAT becomes unreachable after peer reload
Reporter:Paul Mathews (baijupaul)Labels:
Date Opened:2014-02-19 06:39:30.000-0600Date Closed:2014-03-06 09:49:15.000-0600
Priority:CriticalRegression?
Status:Closed/CompleteComponents:
Versions:1.8.20.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:
Description:I have a realtime peer behind NAT. Things work perfectly. I then did an asterisk reload, which caused the peer cache to be cleared, I then attempted to reach the peer. The private IP address from the Reg. Contact was copied over to the IP address, which caused the peer to be unreachable.


Here is the sip show peer 10116 before reload
{noformat}
ip-10-0-0-94*CLI> sip show peer 10116
Name : 10116
Realtime peer: Yes, cached
Secret : <Set>
MD5Secret : <Not set>
Remote Secret: <Not set>
Context : from-internal
Subscr.Cont. : <Not set>
Language :
AMA flags : Unknown
Transfer mode: open
CallingPres : Presentation Allowed, Not Screened
Callgroup :
Pickupgroup :
MOH Suggest :
Mailbox :
VM Extension : *97
LastMsgsSent : 32767/65535
Call limit : 0
Max forwards : 0
Dynamic : Yes
Callerid : "" <>
MaxCallBR : 384 kbps
Expire : 191
Insecure : no
Force rport : Yes
ACL : No
DirectMedACL : No
T.38 support : No
T.38 EC mode : Unknown
T.38 MaxDtgrm: -1
DirectMedia : Yes
PromiscRedir : No
User=Phone : No
Video Support: No
Text Support : No
Ign SDP ver : No
Trust RPID : No
Send RPID : No
Subscriptions: Yes
Overlap dial : Yes
DTMFmode : rfc2833
Timer T1 : 500
Timer B : 32000
ToHost :
Addr->IP : 27.122.12.75:50427
Defaddr->IP : (null)
Prim.Transp. : TCP
Allowed.Trsp : TCP,UDP
Def. Username: 10116
SIP Options : (none)
Codecs : 0x50e (gsm|ulaw|alaw|g729|ilbc)
Codec Order : (g729:20,ilbc:30,gsm:20,ulaw:20,alaw:20)
Auto-Framing : No
Status : OK (471 ms)
Useragent : MicroSIP/3.3.31
Reg. Contact : sip:10116@10.185.1.6:5060;transport=TCP;ob
Qualify Freq : 60000 ms
Sess-Timers : Accept
Sess-Refresh : uas
Sess-Expires : 1800 secs
Min-Sess : 90 secs
RTP Engine : asterisk
Parkinglot :
Use Reason : No
Encryption : No
{noformat}


Here is the sip show peer after reload
{noformat}
ip-10-0-0-94*CLI> sip show peer 10116
Name : 10116
Realtime peer: Yes, cached
Secret : <Set>
MD5Secret : <Not set>
Remote Secret: <Not set>
Context : from-internal
Subscr.Cont. : <Not set>
Language :
AMA flags : Unknown
Transfer mode: open
CallingPres : Presentation Allowed, Not Screened
Callgroup :
Pickupgroup :
MOH Suggest :
Mailbox :
VM Extension : *97
LastMsgsSent : 32767/65535
Call limit : 0
Max forwards : 0
Dynamic : Yes
Callerid : "" <>
MaxCallBR : 384 kbps
Expire : -1
Insecure : no
Force rport : Yes
ACL : No
DirectMedACL : No
T.38 support : No
T.38 EC mode : Unknown
T.38 MaxDtgrm: -1
DirectMedia : Yes
PromiscRedir : No
User=Phone : No
Video Support: No
Text Support : No
Ign SDP ver : No
Trust RPID : No
Send RPID : No
Subscriptions: Yes
Overlap dial : Yes
DTMFmode : rfc2833
Timer T1 : 500
Timer B : 32000
ToHost :
Addr->IP : 10.185.1.6:50427
Defaddr->IP : (null)
Prim.Transp. : TCP
Allowed.Trsp : TCP,UDP
Def. Username: 10116
SIP Options : (none)
Codecs : 0x50e (gsm|ulaw|alaw|g729|ilbc)
Codec Order : (g729:20,ilbc:30,gsm:20,ulaw:20,alaw:20)
Auto-Framing : No
Status : UNREACHABLE
Useragent : MicroSIP/3.3.31
Reg. Contact : sip:10116@10.185.1.6:5060;transport=TCP;ob
Qualify Freq : 60000 ms
Sess-Timers : Accept
Sess-Refresh : uas
Sess-Expires : 1800 secs
Min-Sess : 90 secs
RTP Engine : asterisk
Parkinglot :
Use Reason : No
Encryption : No
{noformat}
Comments:By: Michael L. Young (elguero) 2014-02-19 11:02:34.233-0600

One thing that is probably not correct is that you have "directmedia" set to "yes".  You are working with NAT and that should be turned off.  If you do have that off for this peer, then it would probably be due to a bug that has been fixed in recent versions of Asterisk.

The other thing I would request is that you update to a newer version of Asterisk.  1.8.25 is the latest version and there have been some fixes in regards to realtime peers and NAT.

When upgrading, make sure you update your DB schemas since the schemas in the contrib directory were not up to date in 1.8.20.  They have been updated in recent versions.  Also, make sure you read the Changelog.  Upon updating, some of the default global settings in chan_sip were not being overridden and they will now be overridden properly if a peer is defining a different value from the default global values.

Please try the above and report back if this is still an issue for you.

Thanks

By: Rusty Newton (rnewton) 2014-03-06 09:49:08.913-0600

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.  Further information can be found at http://www.asterisk.org/developers/bug-guidelines