<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>the keepalive is done via sort of a trick which needs to detect:</p>
    <p>  - if one side is no longer connected to the network --
      keepalive results in retransmission timeout</p>
    <p>  - if one side is no longer knowing the dialog - so call-id,
      to-tag and from-tag values do not match -- keepalive results in
      481 Call Leg/Transaction Does Not Exist<br>
    </p>
    Any other case is not relevant for the keepalive purpose of
    detecting if a side is still in the call.<br>
    <br>
    Therefore, CSeq is intentionally set to an lower value than expected
    by each side, in order not to impact what is sent by each side.<br>
    <br>
    If you want to do nat keepalive for the duration of the dialog, that
    can be achieved by using nat_traversal. Or if you use a location
    service, usrloc+nathelper does it for the registration session.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 17.04.18 08:25, Oded Arbel wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFBa_-ortQ+VzODM6_LGopg5SyQ=NOutzYb1tOqv9OqjkBs8Ag@mail.gmail.com"><br>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Mon, Apr 16, 2018, 16:24 Dmitri Savolainen
          <<a href="mailto:savolainen@erinaco.ru"
            moz-do-not-send="true">savolainen@erinaco.ru</a>> wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div dir="ltr">
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex"><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Ideally
                I think Kamailio should send correct (i.e increasing)
                CSeq numbers.</span><br>
            </blockquote>
          </div>
          <div dir="ltr">
            <div>in my mind it can't be increased by kamailio because
              of:</div>
            <div>1. kamailio send OPTIONS with cseq+1</div>
            <div>2. media server may send some  indialog reinvite with
              cseq+1 and then kamailio have to remember that OPTIONS
              and  translate reinvite to cseq+2.</div>
          </div>
        </blockquote>
      </div>
      <div><br>
      </div>
      <div>Fair point, statelessness is important.</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div class="gmail_quote">
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div dir="ltr">
            <div>I don't know why for "<span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;background-color:rgb(255,255,255)">ka-src"
                CSeq is 0 and for "ka-dst"  the one is  equal: so may be
                it is possible to be fixed </span></div>
          </div>
        </blockquote>
      </div>
      <div><br>
      </div>
      <div>I'll investigate, under the assumption everyone agrees it's a
        bug.</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div class="gmail_quote">
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div dir="ltr">
            <div><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br>
                  </span></span></span></div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex"><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>(for
                example BYE) to be dropped by the firewall.</span></blockquote>
          </div>
          <div dir="ltr">
            <div>this may be achieved by</div>
            <div>1. usrloc pinging</div>
          </div>
        </blockquote>
      </div>
      <div><br>
      </div>
      <div>I'm not sure that is usrloc pinging, but if you mean
        nathelper's nat_ping, then that wouldn't work for me because
        it's only for MUAs that use REGISTER, which on my system does
        not always happen.</div>
      <div><br>
      </div>
      <div class="gmail_quote">
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div dir="ltr">
            <div>2. short re-registration period for endpoint (60 sec
              for ex)</div>
          </div>
        </blockquote>
      </div>
      <div><br>
      </div>
      <div>Aside from the fact that REGISTER is not guaranteed to ever
        happen, this is also a UA setting that can't be enforced by the
        server and has serious implications on battery life outside of a
        call.</div>
      <div><br>
      </div>
      <div class="gmail_quote">
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div dir="ltr">
            <div>3. let's media server send options by itself via
              kamailio</div>
          </div>
        </blockquote>
      </div>
      <div><br>
      </div>
      <div>This may or may not be possible on my setup, I'll have to
        investigate - thanks for the suggestion!</div>
      <div><br>
      </div>
      -- <br>
      <div dir="ltr" class="gmail_signature"
        data-smartmail="gmail_signature">
        <div dir="ltr">
          <p dir="ltr"><span
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">Oded
              Arbel</span></p>
          <div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px"><a
              href="mailto:oded.arbel@greenfieldtech.net"
              target="_blank" style="font-size:12.8px"
              moz-do-not-send="true">oded.arbel@greenfieldtech.net</a><br>
          </div>
          <div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px"><a
              href="http://greenfieldtech.net/" target="_blank"
              moz-do-not-send="true"><img alt="Greenfield Tech"
src="https://docs.google.com/uc?export=download&id=0B7YBJmVm7aC4QzZkNE1INkRUV1k&revid=0B7YBJmVm7aC4cjVKbHk4Qld3akpOWFJFd0dDQnRVVnROaEg0PQ"
                moz-do-not-send="true"></a></div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - April 16-18, 2018, Berlin - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>