The attached patch provides TCP keepalive to OpenSIPS. During testing we found that if a TCP connection is kept idle on one direction for a long time some routers would half close it, so even if all clients usually send TCP keepalives it's also good to do it from the server side.
The patch adds 4 new core configuration options:
- tcp_keepalive (boolean): enable / disable TCP keepalive
- tcp_keepcount: number of keepalives to send before closing the connection (Linux only)
- tcp_keepidle: amount of time before OpenSIPS will start to send keepalives if the connection is idle (Linux only)
- tcp_keepinterval: interval between keepalive probes, if the previous one failed (Linux only)
Please consider the patch for inclusion, it has been running for some days now and I didn't run into issues.
PS: Code was ported from the SIP-Router project.
Saúl Ibarra Corretgé
Log in to post a comment.