Implement Configurable TCP Keepalive Settings in PJSIP Transports

This commit introduces configurable TCP keepalive settings for both TCP and TLS transports. The changes allow for finer control over TCP connection keepalives, enhancing stability and reliability in environments prone to connection timeouts or where intermediate devices may prematurely close idle connections. This has proven necessary and has already been tested in production in several specialized environments where access to the underlying transport is unreliable in ways invisible to the operating system directly, so these keepalive and timeout mechanisms are necessary.

Fixes #657
This commit is contained in:
Joshua Elson
2024-03-18 15:14:36 -04:00
parent cba82273ae
commit 555eb9d3d2
6 changed files with 184 additions and 10 deletions

View File

@@ -35,6 +35,15 @@
#define PJ_IOQUEUE_HAS_SAFE_UNREG 1
#define PJ_IOQUEUE_MAX_EVENTS_IN_SINGLE_POLL (16)
/*
* Increase the number of socket options available. This adjustment is necessary
* to accommodate additional TCP keepalive settings required for optimizing SIP
* transport stability, especially in environments prone to connection timeouts.
* The default limit is insufficient when configuring all desired keepalive
* parameters along with standard socket options.
*/
#define PJ_MAX_SOCKOPT_PARAMS 5
#define PJ_SCANNER_USE_BITWISE 0
#define PJ_OS_HAS_CHECK_STACK 0