<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">Hello Klaus,</span></pre>
<p class="MsoNormal" style="margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';">We are using Kamailio V1.4 with TCP/TLS.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;"><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"> </span></p>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">The Kamailio is configured the TCP lifetime to the expire value of the REGISTER by using the tcp_persistent_flag parameter of Kamailio's registrar module. Note: The SIP proxy should not close the TCP connection as it is not capable of opening a new one.</span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;"> </span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">Kamailio tries to open a TLS connection to the client. The Kamailio should use the existing TCP/TLS connection that was established by the client during registration.</span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;"> </span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">We are applying NAT traversal techniques to instruct Kamailio to reuse the established TCP/TLS connection. Example: for each register call fix_nated_register(). For every other request and response call fix_nated_contact().</span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;"> </span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">I have got one SIP phone registered via TLS to kamailio-1.4.X version with Expires = 3600.</span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;"> </span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">SIP Phone1: connected via ip1:port1 and Expires = 3600.</span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;"> </span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">Example: After 15 minutes the TLS connection is closed.</span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;"> </span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">The SIP Phone opens a new TLS connection and registers via TLS to Kamailio. Thus, we have the following records on the Registrar Server (Kamailio):</span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;"> </span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">SIP Phone1: connected via ip1:port1 and Expires = 2700 [3600 – (15 min * 60 s) = 2700].</span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">SIP Phone1: connected via ip1:port2 and Expires = 3600.</span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;"> </span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">Is this the desirable behavior? Shouldn’t the Kamailio (Registrar Server) delete the below registry after closing the TLS connectio?  </span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;"> </span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">SIP Phone1: connected via ip1:port1 and Expires = 2700 [3600 – (15 min * 60 s) = 2700].</span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;"> </span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">Best regards!</span></pre>
<pre><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; font-size: 12pt;">Edson G. Leme</span></pre>
<p> </p>