Tune the tcp keepalive parameters to shorten the lifetime duration of these sockets -- there are couple of them, see:
* https://www.kamailio.org/wiki/cookbooks/devel/core#tcp_keepalive
Also, you can tune at OS level with sysctl. The OS value can be seen in the file:
``` /proc/sys/net/ipv4/tcp_keepalive_time ```