aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2011-05-05 18:09:23 +0000
committermnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2011-05-05 18:09:23 +0000
commit240bd0cd029153c091408efa4aa91df6c7a9be3e (patch)
tree1b590daa8ae8b742579ef9b40ef3333c7d3d70cc /channels
parent2ae706d2e72829db3ed5a81fee647b7f3ff41254 (diff)
Merged revisions 317196 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r317196 | mnicholson | 2011-05-05 13:02:52 -0500 (Thu, 05 May 2011) | 8 lines Set SO_KEEPALIVE on SIP TCP sockets so that they eventually go away when a peer abruptly disappears. This mostly occurs after a successful registration. (closes issue #17544) Reported by: marcelloceschia Patches: (modified) tcptls.patch uploaded by st (license 907) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@317198 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index df9ee5119..09aec761f 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2542,6 +2542,12 @@ static void *_sip_tcp_helper_thread(struct sip_pvt *pvt, struct ast_tcptls_sessi
}
}
+ flags = 1;
+ if (setsockopt(tcptls_session->fd, SOL_SOCKET, SO_KEEPALIVE, &flags, sizeof(flags))) {
+ ast_log(LOG_ERROR, "error enabling TCP keep-alives on sip socket: %s\n", strerror(errno));
+ goto cleanup;
+ }
+
me->threadid = pthread_self();
ast_debug(2, "Starting thread for %s server\n", tcptls_session->ssl ? "SSL" : "TCP");