Hello,
yes, the dispatcher module should send an OPTIONS ping out, also over TCP. Could you maybe test what actually happens, and also look to the log output, and socket stats?
Cheers,
Henning
From: Pyry Aaltonen via sr-users sr-users@lists.kamailio.org Sent: Freitag, 11. April 2025 07:09 To: Lukas Tribus lukas@ltri.eu; Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Cc: Pyry Aaltonen pyry.aaltonen@cuuma.com Subject: [SR-Users] Re: TCP timeout
Thanks for the response,
I think the dispatcher module should be actively trying to probe with OPTIONS ping the connection, which I suppose is meaning the socket should be actively used?
Im using dispatcher ds_probing_mode with value 1 and ping interval is also seconds instead of minutes.
I checked with ss -tin dst <trunk-ip>, and with that the ESTAB connections don't have any "timeout" attribute, but I understood that it might depend on kernel version or socket config to show it there or not.
Need to think a bit how to setup strace to see what is set and signaled in the kamailio startup when it logs that 2025-03-27 12:25:18.697 { "level": "INFO", "module": "core", "file": "core/tcp_main.c", "line": 3282, "function": "tcp_init", "logprefix": "", "message": "Set TCP_USER_TIMEOUT=10000 ms" }, but will look forward to check that soon.
-Pyry
From: Lukas Tribus <lukas@ltri.eumailto:lukas@ltri.eu> Date: Friday, 4. April 2025 at 15.54 To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org>, Pyry Aaltonen <pyry.aaltonen@cuuma.commailto:pyry.aaltonen@cuuma.com> Subject: Re: [SR-Users] Re: TCP timeout On Fri, 4 Apr 2025 at 14:05, Pyry Aaltonen via sr-users <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> wrote:
I understand, yes, that it comes from the os default settings how the tcp connection is handled, but as far as I understood that the patch done in the commit is adding the TCP_USER_TIMEOUT which should somehow at least try to fix this behaviour?
I think you are misinterpreting what TCP User Timeout does.
It detects a broken TCP connection when *actively* writing to this socket. It cannot detect a broken connection in absence of any data written to the socket.
I think you are probably looking for TCP keepalives instead and Kamailio provides tcp_keepalive / tcp_keepcnt / tcp_keepidle / tcp_keepintvl options for this purpose.
In both cases (TCP User timeout vs TCP keepalives) Kamalio sets socket options advising the kernel about the configuration. I suggest you read the kernel documentation to understand more about those OS features.
If you are doubting that Kamailio sets the correct socket options I'd suggest using strace to verify.
Lukas