<div dir="ltr">Hi,<div><br></div><div>First off please forgive my lack of knowledge on how TCP works.   <br><div><br></div><div>We are using Kamailio 5.0.7 and we have an issue where clients are connecting via TCP and their NAT devices are closing up. Because of this we want to send TCP keep alives every so often.</div><div><br></div><div>1) When restarting Kamailio it's sends a RST. Is this Kamailio sending it out or is it linux sending it when the application is killed? The issue we have is if say we need to do a restart 2-3 times (yes we should normally do that) then we end up with 3x registrations in the db (since when using db mode if the connection goes away it won't remove the reg from the db (as per - <a href="https://kamailio.org/docs/modules/5.0.x/modules/usrloc.html#usrloc.p.handle_lost_tcp">https://kamailio.org/docs/modules/5.0.x/modules/usrloc.html#usrloc.p.handle_lost_tcp</a>)<br><br>2) I haven testing with the following settings.<br>a. tcp_crlf_ping=yes<br>b. tcp_keepcnt = 3<br>c. tcp_keepidle = 5<br><br>With the above I see the TCP keep alives coming in every 75 seconds. If I tcp_keepintvl = 10 then I see TCP keep alives going out from Kamailio to the phone. As per <a href="https://www.kamailio.org/wiki/cookbooks/5.0.x/core#tcp_keepintvl">https://www.kamailio.org/wiki/cookbooks/5.0.x/core#tcp_keepintvl</a> it says "Time interval between keepalive probes, when the previous probe failed". Looking at my captures Kamilio sends out the TCP keep alive and gets it back. Is Kamailio not seeing it? With the above it seems to be working the way I want it but I want to make sure that I am doing it right.<br><br>3) For the devs on here how hard would it be to implement handle_lost_tcp for DB-Only?<br><br>TIA and a happy new year to all.<br><br>Regards,<br><br>Dovid<br></div></div></div>