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
committed by George Joseph
parent ec7e6fe2ed
commit f61e1d902b
6 changed files with 184 additions and 10 deletions

View File

@@ -299,6 +299,14 @@ struct ast_sip_transport {
int symmetric_transport;
/*! This is a flow to another target */
int flow;
/*! Enable TCP keepalive */
int tcp_keepalive_enable;
/*! Time in seconds the connection needs to remain idle before TCP starts sending keepalive probes */
int tcp_keepalive_idle_time;
/*! The time in seconds between individual keepalive probes */
int tcp_keepalive_interval_time;
/*! The maximum number of keepalive probes TCP should send before dropping the connection */
int tcp_keepalive_probe_count;
};
#define SIP_SORCERY_DOMAIN_ALIAS_TYPE "domain_alias"