[svn-commits] oej: branch 1.2 r47655 - /branches/1.2/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Nov 15 08:17:11 MST 2006


Author: oej
Date: Wed Nov 15 09:17:10 2006
New Revision: 47655

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47655
Log:
Send error message if we fail to allocate sip socket, possibly caused by too few
file handles (wasn't possible before, but with the new way of sending temp messages, it is).

Found this bug under heavy load testing with SIPP.

Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?view=diff&rev=47655&r1=47654&r2=47655
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Wed Nov 15 09:17:10 2006
@@ -3263,6 +3263,19 @@
 		p = sip_alloc(callid, sin, 1, intended_method);
 		if (p)
 			ast_mutex_lock(&p->lock);
+		else {
+			/* We have a memory or file/socket error (can't allocate RTP sockets or something) so we're not
+				getting a dialog from sip_alloc. 
+
+				Without a dialog we can't retransmit and handle ACKs and all that, but at least
+				send an error message.
+
+				Sorry, we apologize for the inconvienience
+			*/
+			transmit_response_using_temp(callid, sin, 1, intended_method, req, "500 Server internal error");
+			if (option_debug > 3)
+				ast_log(LOG_DEBUG, "Failed allocating SIP dialog, sending 500 Server internal error and giving up\n");
+		}
 	}
 
 	return p;



More information about the svn-commits mailing list