Hi,
have you looked at tcpops module (http://kamailio.org/docs/modules/5.4.x/modules/tcpops.html)?
It allows to set several tcp keepalive parameters and to run event routes for specific socket events.
Also if you want to remove location records when the corresponding socket is closed have a look at http://www.kamailio.org/docs/modules/5.4.x/modules/usrloc.html#usrloc.p.handle_lost_tcp.

Cheers,

Federico

On Thu, Apr 1, 2021 at 9:28 AM Alexander Kudrevatykh <kudrale@yandex-team.ru> wrote:
Hi. Is there an option for tcp timeout in kamailio?
In my setup we have tcp peers and kamailio pings them every 5 seconds,
but when tcp session stucks kamailio not close this session for 15
minutes. I tried many tcp options kamailio supports, but any of them
helps. I think kamailio can use TCP_USER_TIMEOUT on linux to detect
such tcp sessions and reestablish failed connections?


_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users