SIP Peers marked unreachable

General discussions about Asterisk.

Moderators: Moderator, Support

SIP Peers marked unreachable

Postby iglass » Fri Feb 13, 2015 3:29 pm

Asterisk ver 11.14.2
CentOS - release 6.5

I am seeing a number of our SIP peers marked UNREACHABLE and then REACHABLE 10 seconds later. The peers are both phones and trunks. If I run a TCPDUMP on my asterisk server, I see the Qualify message being sent to the peer and I see the reply received from the peer with a SIP/2.0 200 OK message.

Here is an example what I am seeing the log:

[2015-02-13 15:54:20] NOTICE[21932] chan_sip.c: Peer 'fpbx-1-749052d6' is now UNREACHABLE! Last qualify: 41
[2015-02-13 15:54:20] NOTICE[21932] chan_sip.c: Peer 'fpbx-1-749052d6' is now UNREACHABLE! Last qualify: 41
[2015-02-13 15:54:30] NOTICE[21932] chan_sip.c: Peer 'fpbx-1-749052d6' is now Reachable. (41ms / 2000ms)
[2015-02-13 15:54:30] NOTICE[21932] chan_sip.c: Peer 'fpbx-1-749052d6' is now Reachable. (41ms / 2000ms)

Here is the out from the TCPDUMP:
15:54:15.085118 IP (tos 0x60, ttl 64, id 5961, offset 0, flags [none], proto UDP (17), length 578)
192.168.185.85.sip > static.192.159.66.3.cyberlynk.net.sip: SIP, length: 550
OPTIONS sip:trunk1.freepbx.com SIP/2.0
Via: SIP/2.0/UDP 70.62.110.170:5060;branch=z9hG4bK46f9ebe7;rport
Max-Forwards: 70
From: "Unknown" <sip:Unknown@70.62.110.170>;tag=as06140c11
To: <sip:trunk1.freepbx.com>
Contact: <sip:Unknown@70.62.110.170:5060>
Call-ID: 79c51590352150e152c7e1d54eb56eec@70.62.110.170:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.11.0(11.14.2)
Date: Fri, 13 Feb 2015 20:54:15 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


15:54:15.126892 IP (tos 0x0, ttl 51, id 58989, offset 0, flags [none], proto UDP (17), length 721)
static.192.159.66.3.cyberlynk.net.sip > 192.168.185.85.sip: SIP, length: 693
SIP/2.0 200 OK
Via: SIP/2.0/UDP 70.62.110.170:5060;branch=z9hG4bK46f9ebe7;rport=5060
From: "Unknown" <sip:Unknown@70.62.110.170>;tag=as06140c11
To: <sip:trunk1.freepbx.com>;tag=Z2DQXQ8H5rSpN
Call-ID: 79c51590352150e152c7e1d54eb56eec@70.62.110.170:5060
CSeq: 102 OPTIONS
Contact: <sip:192.159.66.3>
User-Agent: SIPStation 2.11.3
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, precondition, path, replaces
Allow-Events: talk, hold, conference, presence, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
Content-Length: 0


15:54:20.125546 IP (tos 0x60, ttl 64, id 5962, offset 0, flags [none], proto UDP (17), length 578)
192.168.185.85.sip > static.192.159.66.3.cyberlynk.net.sip: SIP, length: 550
OPTIONS sip:trunk1.freepbx.com SIP/2.0
Via: SIP/2.0/UDP 70.62.110.170:5060;branch=z9hG4bK46f9ebe7;rport
Max-Forwards: 70
From: "Unknown" <sip:Unknown@70.62.110.170>;tag=as06140c11
To: <sip:trunk1.freepbx.com>
Contact: <sip:Unknown@70.62.110.170:5060>
Call-ID: 79c51590352150e152c7e1d54eb56eec@70.62.110.170:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.11.0(11.14.2)
Date: Fri, 13 Feb 2015 20:54:15 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


15:54:20.167270 IP (tos 0x0, ttl 51, id 58990, offset 0, flags [none], proto UDP (17), length 721)
static.192.159.66.3.cyberlynk.net.sip > 192.168.185.85.sip: SIP, length: 693
SIP/2.0 200 OK
Via: SIP/2.0/UDP 70.62.110.170:5060;branch=z9hG4bK46f9ebe7;rport=5060
From: "Unknown" <sip:Unknown@70.62.110.170>;tag=as06140c11
To: <sip:trunk1.freepbx.com>;tag=Z2DQXQ8H5rSpN
Call-ID: 79c51590352150e152c7e1d54eb56eec@70.62.110.170:5060
CSeq: 102 OPTIONS
Contact: <sip:192.159.66.3>
User-Agent: SIPStation 2.11.3
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, precondition, path, replaces
Allow-Events: talk, hold, conference, presence, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
Content-Length: 0


15:54:30.125590 IP (tos 0x60, ttl 64, id 5963, offset 0, flags [none], proto UDP (17), length 578)
192.168.185.85.sip > static.192.159.66.3.cyberlynk.net.sip: SIP, length: 550
OPTIONS sip:trunk1.freepbx.com SIP/2.0
Via: SIP/2.0/UDP 70.62.110.170:5060;branch=z9hG4bK4662e20c;rport
Max-Forwards: 70
From: "Unknown" <sip:Unknown@70.62.110.170>;tag=as778b7910
To: <sip:trunk1.freepbx.com>
Contact: <sip:Unknown@70.62.110.170:5060>
Call-ID: 2a52eda60cbf9ac16142d61162c9c902@70.62.110.170:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.11.0(11.14.2)
Date: Fri, 13 Feb 2015 20:54:30 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


15:54:30.167049 IP (tos 0x0, ttl 51, id 58991, offset 0, flags [none], proto UDP (17), length 721)
static.192.159.66.3.cyberlynk.net.sip > 192.168.185.85.sip: SIP, length: 693
SIP/2.0 200 OK
Via: SIP/2.0/UDP 70.62.110.170:5060;branch=z9hG4bK4662e20c;rport=5060
From: "Unknown" <sip:Unknown@70.62.110.170>;tag=as778b7910
To: <sip:trunk1.freepbx.com>;tag=a394Zmj1B7gaK
Call-ID: 2a52eda60cbf9ac16142d61162c9c902@70.62.110.170:5060
CSeq: 102 OPTIONS
Contact: <sip:192.159.66.3>
User-Agent: SIPStation 2.11.3
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, precondition, path, replaces
Allow-Events: talk, hold, conference, presence, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
Content-Length: 0

From my limited knowledge of asterisk, it appears that the peer is replying within 2000ms. This trunk is marked unreachable every 15 to 30 minutes. I don't really understand why the peer is marked unreachable if it is replying in timely manner to the qualify message. Any ideas what would cause this? I have tried disabling fail2ban and iptables.
iglass
Newsterisk
 
Posts: 4
Joined: Fri Feb 13, 2015 3:05 pm

Re: SIP Peers marked unreachable

Postby navaismo » Fri Feb 13, 2015 4:49 pm

Dont use qualify or increase the time to qualify your peers
navaismo
Salt of the Asterisk
 
Posts: 1610
Joined: Mon Dec 07, 2009 1:30 pm
Location: Mexico City, Mexico

Re: SIP Peers marked unreachable

Postby iglass » Mon Feb 16, 2015 10:14 am

I have not configured a qualify time and it is my understanding that the default is 2000ms. If my peers reply in less than 50 ms how is increasing the time to qualify going to help?
iglass
Newsterisk
 
Posts: 4
Joined: Fri Feb 13, 2015 3:05 pm

Re: SIP Peers marked unreachable

Postby ambiorixg12 » Mon Feb 16, 2015 11:33 am

If you turn on qualify in the configuration of a SIP device in sip.conf, Asterisk will send a SIP OPTIONS command regularly to check that the device is still online. If the device does not answer within the configured (or default) period (in ms) Asterisk considers the device off-line for future calls. This status can be checked by the SIPPEER function, and inversely this function will only provide status information for peers which have qualify=yes.



Unreachable generally means you have qualify=yes, but the peer is ignoring OPTIONS requests.

But I personally think that your problem, is beyond any qualify setting.

could be possible that you lose network connectivity with the remote peer, did you check ICMP echo reply , when peer is reachable and then is unreachable
ambiorixg12
Astmaster
 
Posts: 967
Joined: Sun Mar 04, 2007 9:32 pm
Location: Dominican Republic

Re: SIP Peers marked unreachable

Postby iglass » Mon Feb 16, 2015 3:23 pm

I have a continuous ping going to peer with no packet loss.
iglass
Newsterisk
 
Posts: 4
Joined: Fri Feb 13, 2015 3:05 pm

Re: SIP Peers marked unreachable

Postby iglass » Mon Feb 16, 2015 3:25 pm

Peers are always marked reachable 10 seconds after they are marked unreachable.
iglass
Newsterisk
 
Posts: 4
Joined: Fri Feb 13, 2015 3:05 pm

Re: SIP Peers marked unreachable

Postby mustardman » Wed Aug 05, 2015 6:10 pm

This is more of a workaround but try adding:

keepalive=yes


To sip.conf. It's a new feature as of Asterisk v11
https://wiki.asterisk.org/wiki/display/ ... +Keepalive

If it still does it try set
qualify=no


To the extension.

The keepalive=yes will take care of keeping the NAT port opened so technically qualify=yes is no longer needed if that is the case.

I personally think this qualify OPTIONS reply problem is a long standing Asterisk bug of some sort. If you do a search you see a lot of people having this problem randomly and not necessarily because they have a lot of extensions or certain brands/models of hardware. Messing around with configs doesn't always solve it unless it involves workarounds
mustardman
Oldsterisk
 
Posts: 169
Joined: Sat Dec 02, 2006 11:21 pm


Return to Asterisk General

Who is online

Users browsing this forum: No registered users and 1 guest