[asterisk-commits] mnicholson: branch 1.6.2 r317195 - /branches/1.6.2/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 5 12:59:19 CDT 2011


Author: mnicholson
Date: Thu May  5 12:59:13 2011
New Revision: 317195

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=317195
Log:
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)

Modified:
    branches/1.6.2/channels/chan_sip.c

Modified: branches/1.6.2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_sip.c?view=diff&rev=317195&r1=317194&r2=317195
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Thu May  5 12:59:13 2011
@@ -3000,6 +3000,12 @@
 			(!(tcptls_session = ast_tcptls_client_start(tcptls_session)))) {
 			goto cleanup;
 		}
+	}
+
+	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();




More information about the asterisk-commits mailing list