Hi,

First off please forgive my lack of knowledge on how TCP works.   

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.

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 - https://kamailio.org/docs/modules/5.0.x/modules/usrloc.html#usrloc.p.handle_lost_tcp)

2) I haven testing with the following settings.
a. tcp_crlf_ping=yes
b. tcp_keepcnt = 3
c. tcp_keepidle = 5

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 https://www.kamailio.org/wiki/cookbooks/5.0.x/core#tcp_keepintvl 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.

3) For the devs on here how hard would it be to implement handle_lost_tcp for DB-Only?

TIA and a happy new year to all.

Regards,

Dovid