<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    <div class="moz-cite-prefix">On 25/08/15 20:21, M S wrote:<br>
    </div>
    <blockquote
cite="mid:CAFZQphzxZyXHn9eXimP0mMgfQopxhr4yC9stX9+vM=yy8Coe6g@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>Hi,<br>
            <br>
          </div>
          We have a bit of confusion regarding tcp_connecton_timeout
          core parameter. </div>
      </div>
    </blockquote>
    <br>
    are you talking about tcp_connect_timeout or tcp_connection_lifetime?<br>
    <br>
    Are you using tcpops module?<br>
    <br>
    <blockquote
cite="mid:CAFZQphzxZyXHn9eXimP0mMgfQopxhr4yC9stX9+vM=yy8Coe6g@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>The documentation says,<br>
          <br>
          --<br>
          Lifetime in seconds for TCP sessions. TCP sessions which are
          inactive for longer than <strong>tcp_connection_lifetime</strong>
          will be closed by Kamailio.<br>
          --<br>
          <br>
        </div>
        <div>However we observe a strange behaviour.<br>
          <br>
          1. The connection is NOT closed by Kamailio unless we
          additionally set "close_expired_tcp" parameter in usrloc
          module,<br>
        </div>
      </div>
    </blockquote>
    <br>
    How do you monitor if the connection is still open or not? Have you
    used kamcmd to list opened connection?<br>
    <br>
    <blockquote
cite="mid:CAFZQphzxZyXHn9eXimP0mMgfQopxhr4yC9stX9+vM=yy8Coe6g@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>2. Secondly, if we set this parameter to a smaller value
          say 70 seconds while sip register expiry is 600 seconds (and
          close_expired_tcp parameter enabled in usrloc module), the
          connection still remains active (tested after keeping it idle
          for 120 seconds then sending a sip request on this connection,
          we expected the request to fail but it does not fails).<br>
        </div>
      </div>
    </blockquote>
    <br>
    How did you sent the sip request on this connection? Can you detail
    why you expected to fail? Depending on config options, the server
    can also open a new connection.<br>
    <br>
    <blockquote
cite="mid:CAFZQphzxZyXHn9eXimP0mMgfQopxhr4yC9stX9+vM=yy8Coe6g@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>3. if we set this parameter to greater then sip register
          value, e.g. 610 seconds and set close_expired_tcp parameter in
          usrloc, then we observe disconnect after about 8-10 minutes.
          Whereas we expect it to continue since user is re-registering
          every 600 seconds.<br>
        </div>
      </div>
    </blockquote>
    <br>
    A disconnect can happen from various reason. Have you watched the
    network packets to see what side closed the connection? You should
    run kamailio with debug=3 to get more verbose log messages, that
    should give more hints about what happens there.<br>
    <br>
    <blockquote
cite="mid:CAFZQphzxZyXHn9eXimP0mMgfQopxhr4yC9stX9+vM=yy8Coe6g@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>Can you guys explain why this is happening? What keeps a
          tcp connection active or makes it inactive? <br>
          <br>
          We are using websockets (which use TCP at lower layer) and we
          observe there is no websocket frame sent or received over the
          tcp connection, yet it remain active after
          tcp_connection_lifetime in case 2 above and becomes inactive
          in case 3.<br>
        </div>
      </div>
    </blockquote>
    <br>
    Note that there is also a keepalive mechanism at tcp layer.<br>
    <br>
    Your report is just listing some conclusions, we need more details
    on how you tested (some questions asked above) to be able to analyze
    properly here and be able to assist.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <blockquote
cite="mid:CAFZQphzxZyXHn9eXimP0mMgfQopxhr4yC9stX9+vM=yy8Coe6g@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>We are using Kamailio v4.3.1 SVN Rev. 4717b5 on Debian
          Wheezy 32bit OS.<br>
        </div>
        <div><br>
        </div>
        <div>Please suggest.<br>
          <br>
        </div>
        <div>Thank you.<br>
        </div>
        <div><br>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
sr-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
  </body>
</html>