<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thank you very much Arsen.</p>
    <p>Knowing that this was supposed to work was what I needed to know.
      I was only missing the NAT rule back to my phone system on the TLS
      port, which is where the BYE packet was being sent to.</p>
    <p>All works perfectly now.<br>
    </p>
    <div class="moz-cite-prefix">On 9/19/20 4:05 AM, Arsen Semenov
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAC3hFAp0tzCveJOWbCOX7SS81Ko=xuE0yKsSsUFRe40KjFFP7A@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div>
        <div>
          <div dir="auto">
            <div dir="auto">Hello Conrad, </div>
            <div dir="auto"><br>
            </div>
            <div dir="auto">Bit hard to say exactly without looking into
              logs/dumps but it seems like your call is long enough so
              router (if you have one) could timeout on nat tcp
              connection, thus the “bye” request can not reach uac. Just
              guessing. </div>
            <div dir="auto"><br>
            </div>
            <div dir="auto">Please check whether you have tcp keepalive
              enabled, example:</div>
            <div dir="auto">tcp_keepalive=yes</div>
            <div dir="auto">tcp_crlf_ping=yes</div>
            <div dir="auto">tcp_keepcnt=3</div>
            <div dir="auto">tcp_keepidle=30</div>
            <div dir="auto">tcp_keepintvl=30</div>
            <div dir="auto"><br>
            </div>
          </div>
        </div>
        <div dir="auto">Hope it helps.</div>
        <div dir="auto"><br>
        </div>
        <div><br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">On Sat, 19 Sep 2020 at
              8:59 AM, <a href="mailto:conradcordeiro@gmail.com"
                target="_blank" moz-do-not-send="true">conradcordeiro@gmail.com</a>
              <<a href="mailto:conradcordeiro@gmail.com"
                target="_blank" moz-do-not-send="true">conradcordeiro@gmail.com</a>>
              wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">Hello,<br>
              <br>
              <br>
              <br>
              Thank you for your reading this and for your help.<br>
              <br>
              <br>
              <br>
              I'm a Kamailio newbie and managed to set up an edge proxy,
              which works <br>
              <br>
              perfectly on UDP traffic. I'm now attempting to deploy
              TLS/SRTP and <br>
              <br>
              everything almost works perfectly. The single issue I'm
              having is that <br>
              <br>
              when either of the parties to an SRTP/TLS call disconnect,
              the other <br>
              <br>
              party's call remains active. With UDP, when one of the
              parties <br>
              <br>
              disconnects the call, the other leg of the call receives
              the BYE command <br>
              <br>
              and the call automatically disconnects.<br>
              <br>
              <br>
              <br>
              This is how I have our infrastructure set up:<br>
              <br>
              <br>
              <br>
              1. Twilio SIP Trunk with Secure Media enabled.<br>
              <br>
              <br>
              <br>
              2. Kamailio 5.4.1 set up with TLS module, set to listen on
              TLS port <br>
              <br>
              5061, SSL certificates from Let's Encrypt, route set to
              our phone system.<br>
              <br>
              <br>
              <br>
              3. Phone system is Asterisk.<br>
              <br>
              <br>
              <br>
              As per above, everything works almost perfectly with
              TLS/SRTP. The only <br>
              <br>
              issue is that calls will not disconnect when one of the
              sides hang up. <br>
              <br>
              If I disable TLS/SRTP and use UDP only, everything works.<br>
              <br>
              <br>
              <br>
              Audio is just fine with TLS/SRTP.<br>
              <br>
              <br>
              <br>
              Does anyone know why calls with SRTP/TLS will not
              disconnect <br>
              <br>
              automatically when one of the parties ends the call?<br>
              <br>
              <br>
              <br>
              Thank you,<br>
              <br>
              <br>
              <br>
              Conrad<br>
              <br>
              <br>
              <br>
              <br>
              <br>
              _______________________________________________<br>
              <br>
              Kamailio (SER) - Users Mailing List<br>
              <br>
              <a href="mailto:sr-users@lists.kamailio.org"
                target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
              <br>
              <a
                href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
              <br>
            </blockquote>
          </div>
        </div>
        <br>
        <br>
      </div>
      -- <br>
      <div dir="ltr" class="gmail_signature"
        data-smartmail="gmail_signature">Sent from Gmail Mobile</div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-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>
  </body>
</html>