mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
Add mod_sofia support for setting socket TCP keepalive
Some OSes like linux provide a mechanism for sending TCP keepalive pings. Sofia provides its own mechanism for doing this in userspace. We shouldn't conflate these two mechanisms. FS-6104
This commit is contained in:
parent
8b7d58ddf8
commit
d3b9aaba60
@ -266,6 +266,7 @@ typedef enum {
|
|||||||
PFLAG_FIRE_MESSAGE_EVENTS,
|
PFLAG_FIRE_MESSAGE_EVENTS,
|
||||||
PFLAG_SEND_DISPLAY_UPDATE,
|
PFLAG_SEND_DISPLAY_UPDATE,
|
||||||
PFLAG_RUNNING_TRANS,
|
PFLAG_RUNNING_TRANS,
|
||||||
|
PFLAG_SOCKET_TCP_KEEPALIVE,
|
||||||
PFLAG_TCP_KEEPALIVE,
|
PFLAG_TCP_KEEPALIVE,
|
||||||
PFLAG_TCP_PINGPONG,
|
PFLAG_TCP_PINGPONG,
|
||||||
PFLAG_TCP_PING2PONG,
|
PFLAG_TCP_PING2PONG,
|
||||||
@ -695,6 +696,7 @@ struct sofia_profile {
|
|||||||
switch_port_t ws_port;
|
switch_port_t ws_port;
|
||||||
char *wss_ip;
|
char *wss_ip;
|
||||||
switch_port_t wss_port;
|
switch_port_t wss_port;
|
||||||
|
int socket_tcp_keepalive;
|
||||||
int tcp_keepalive;
|
int tcp_keepalive;
|
||||||
int tcp_pingpong;
|
int tcp_pingpong;
|
||||||
int tcp_ping2pong;
|
int tcp_ping2pong;
|
||||||
|
@ -2551,6 +2551,8 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
|||||||
TPTAG_PINGPONG(profile->tcp_ping2pong)),
|
TPTAG_PINGPONG(profile->tcp_ping2pong)),
|
||||||
TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_SRV503),
|
TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_SRV503),
|
||||||
NTATAG_SRV_503(0)),
|
NTATAG_SRV_503(0)),
|
||||||
|
TAG_IF(sofia_test_pflag(profile, PFLAG_SOCKET_TCP_KEEPALIVE),
|
||||||
|
TPTAG_KEEPALIVE(profile->socket_tcp_keepalive)),
|
||||||
TAG_IF(sofia_test_pflag(profile, PFLAG_TCP_KEEPALIVE),
|
TAG_IF(sofia_test_pflag(profile, PFLAG_TCP_KEEPALIVE),
|
||||||
TPTAG_KEEPALIVE(profile->tcp_keepalive)),
|
TPTAG_KEEPALIVE(profile->tcp_keepalive)),
|
||||||
NTATAG_DEFAULT_PROXY(profile->outbound_proxy),
|
NTATAG_DEFAULT_PROXY(profile->outbound_proxy),
|
||||||
@ -3833,6 +3835,9 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
|
|||||||
} else if (!strcasecmp(var, "sip-capture") && switch_true(val)) {
|
} else if (!strcasecmp(var, "sip-capture") && switch_true(val)) {
|
||||||
sofia_set_flag(profile, TFLAG_CAPTURE);
|
sofia_set_flag(profile, TFLAG_CAPTURE);
|
||||||
nua_set_params(profile->nua, TPTAG_CAPT(mod_sofia_globals.capture_server), TAG_END());
|
nua_set_params(profile->nua, TPTAG_CAPT(mod_sofia_globals.capture_server), TAG_END());
|
||||||
|
} else if (!strcasecmp(var, "socket-tcp-keepalive") && !zstr(val)) {
|
||||||
|
profile->socket_tcp_keepalive = atoi(val);
|
||||||
|
sofia_set_pflag(profile, PFLAG_SOCKET_TCP_KEEPALIVE);
|
||||||
} else if (!strcasecmp(var, "tcp-keepalive") && !zstr(val)) {
|
} else if (!strcasecmp(var, "tcp-keepalive") && !zstr(val)) {
|
||||||
profile->tcp_keepalive = atoi(val);
|
profile->tcp_keepalive = atoi(val);
|
||||||
sofia_set_pflag(profile, PFLAG_TCP_KEEPALIVE);
|
sofia_set_pflag(profile, PFLAG_TCP_KEEPALIVE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user