From: Olle Johansson Date: Wed, 15 Nov 2006 15:17:10 +0000 (+0000) Subject: Send error message if we fail to allocate sip socket, possibly caused by too few X-Git-Tag: 1.2.14~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=618dd887f11370273042107d68775f3368fdc9d8;p=thirdparty%2Fasterisk.git 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. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@47655 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 91db38a2f7..ca692d915c 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3263,6 +3263,19 @@ static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *si 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;