<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<div id="compose-container" itemscope="" itemtype="https://schema.org/EmailMessage">
<span itemprop="creator" itemscope="" itemtype="https://schema.org/Organization"><span itemprop="name" content="Outlook Mobile for iOS"></span></span>
<div>Hi Matthew,
<div><br>
</div>
<div>I have the option '<span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">keep_alive_interval' disabled at present as the function causes a deadlock. There is an issue open for this.</span></div>
<div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br>
</span></div>
<div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">As I understand it, this function is Asterisk's own way of sending keep alive and not using the underlying OS to manage them. I was looking at a work around for the
deadlock and thought that chan_sip uses the SO_KEEPALIVE option therefore this might be an easy solution.</span></div>
<div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br>
</span></div>
<div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">Kind regards,</span></div>
<div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br>
</span></div>
<div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">Ross</span></div>
<div><span style="-webkit-text-size-adjust: auto;"><br>
</span></div>
<div><span style="-webkit-text-size-adjust: auto;"><br>
</span><br>
</div>
<div class="gmail_quote">_____________________________<br>
From: Matt Fredrickson <<a dir="ltr" href="mailto:creslin@digium.com" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="0">creslin@digium.com</a>><br>
Sent: Thursday, March 2, 2017 20:38<br>
Subject: Re: [asterisk-dev] Asterisk 13 and PJSIP 2.6 TLS Disconnections<br>
To: Asterisk Developers Mailing List <<a dir="ltr" href="mailto:asterisk-dev@lists.digium.com" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="2">asterisk-dev@lists.digium.com</a>><br>
<br>
<br>
On Thu, Mar 2, 2017 at 7:02 AM, Ross Beer <<a dir="ltr" href="mailto:ross.beer@outlook.com" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="3">ross.beer@outlook.com</a>> wrote:<br>
> Hi All,<br>
><br>
><br>
> I'm trying to diagnose an issue with Asterisk 13 and PJSIP where TLS<br>
> connections are being randomly closed by Asterisk. I'm currently testing the<br>
> latest GIT version which uses Bundled PJSIP 2.6.<br>
><br>
><br>
> Phones are set to register every 120 seconds, so connections shouldn't be<br>
> timing out.<br>
><br>
><br>
> I have a feeling this is related to the PJSIP keepalive options<br>
> (<a dir="ltr" href="https://trac.pjsip.org/repos/ticket/95" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="5">https://trac.pjsip.org/repos/ticket/95</a>):<br>
><br>
><br>
> PJSIP_TCP/TLS_KEEP_ALIVE_INTERVAL<br>
><br>
><br>
> I have tried setting these in the pjsip config, however, it doesn't appear<br>
> to be working:<br>
><br>
><br>
> 'netstat --timers -tn' shows that keepalives are not currently is use:<br>
><br>
><br>
> tcp 0 0 <DESTINATION IP>:5060 <SROURCE IP>:39395<br>
> ESTABLISHED off (0.00/0/0)<br>
> tcp 0 0 <DESTINATION IP>:22 <SROURCE IP>:61282<br>
> ESTABLISHED keepalive (195.31/0/0)<br>
> tcp 0 0 <DESTINATION IP>:5061 <SROURCE IP>:46216<br>
> ESTABLISHED off (0.00/0/0)<br>
> tcp 0 0 <DESTINATION IP>:5061 <SROURCE IP>:47727<br>
> ESTABLISHED off (0.00/0/0)<br>
> tcp 0 0 <DESTINATION IP>:5061 <SROURCE IP>:56087<br>
> ESTABLISHED off (0.00/0/0)<br>
> tcp 0 704 <DESTINATION IP>:22 <SROURCE IP>:59566<br>
> ESTABLISHED on (0.04/0/0)<br>
> tcp 0 0 <DESTINATION IP>:5060 <SROURCE IP>:39394<br>
> ESTABLISHED off (0.00/0/0)<br>
> tcp 0 0 <DESTINATION IP>:5060 <SROURCE IP>:46139<br>
> ESTABLISHED off (0.00/0/0)<br>
><br>
><br>
><br>
> Would SO_KEEPALIVE need to be defined when setting up sockets in Asterisk?<br>
<br>
Good question. I believe that application level keep alives are<br>
generally relied upon in Asterisk's TCP/TLS code. Essentially, a<br>
'\r\n\r\n' is sent over the TCP socket every so often to verify/ensure<br>
connectivity.<br>
<br>
Do you have the variable keep_alive_interval set in the [global]<br>
section of your pjsip.conf? The value you set it to in seconds is the<br>
interval at which it sends a keep alive message over the socket.<br>
<br>
-- <br>
Matthew Fredrickson<br>
Digium, Inc. | Engineering Manager<br>
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA<br>
<br>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a dir="ltr" href="http://www.api-digital.com" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="15">
http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a dir="ltr" href="http://lists.digium.com/mailman/listinfo/asterisk-dev" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="16">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
<br>
<br>
</div>
</div>
</div>
</body>
</html>