[asterisk-commits] trunk r18307 - /trunk/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Apr 7 09:22:30 MST 2006


Author: oej
Date: Fri Apr  7 11:22:28 2006
New Revision: 18307

URL: http://svn.digium.com/view/asterisk?rev=18307&view=rev
Log:
- sip_alloc failures are also caused by too few available file descriptors, so we can not
  open socket for RTP (audio/video/rtcp).
  Error message change to clarify.

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=18307&r1=18306&r2=18307&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Apr  7 11:22:28 2006
@@ -3360,8 +3360,8 @@
 		}
 	}
 	ast_mutex_unlock(&iflock);
-	p = sip_alloc(callid, sin, 1, intended_method);
-	if (p)
+	/* Allocate new call */
+	if ((p = sip_alloc(callid, sin, 1, intended_method)))
 		ast_mutex_lock(&p->lock);
 	return p;
 }
@@ -5531,9 +5531,8 @@
 			r->callid_valid = TRUE;
 		}
 		/* Allocate SIP packet for registration */
-		p=sip_alloc( r->callid, NULL, 0, SIP_REGISTER);
-		if (!p) {
-			ast_log(LOG_WARNING, "Unable to allocate registration call\n");
+		if (!(p = sip_alloc( r->callid, NULL, 0, SIP_REGISTER))) {
+			ast_log(LOG_WARNING, "Unable to allocate registration transaction (memory or socket error)\n");
 			return 0;
 		}
 		if (recordhistory)
@@ -9060,9 +9059,8 @@
 		struct sip_request req;
 		struct ast_variable *var;
 
-		p = sip_alloc(NULL, NULL, 0, SIP_NOTIFY);
-		if (!p) {
-			ast_log(LOG_WARNING, "Unable to build sip pvt data for notify\n");
+		if (!(p = sip_alloc(NULL, NULL, 0, SIP_NOTIFY))) {
+			ast_log(LOG_WARNING, "Unable to build sip pvt data for notify (memory/socket error)\n");
 			return RESULT_FAILURE;
 		}
 
@@ -11752,7 +11750,7 @@
 		p = peer->mwipvt;
 	} else {
 		/* Build temporary dialog for this message */
-		if (!(p = sip_alloc(NULL, NULL, 0, SIP_NOTIFY)))
+		if (!(p = sip_alloc(NULL, NULL, 0, SIP_NOTIFY))) 
 			return -1;
 		if (create_addr_from_peer(p, peer)) {
 			/* Maybe they're not registered, etc. */
@@ -12120,7 +12118,7 @@
 		return NULL;
 	}
 	if (!(p = sip_alloc(NULL, NULL, 0, SIP_INVITE))) {
-		ast_log(LOG_ERROR, "Unable to build sip pvt data for '%s' (Out of memory)\n", (char *)data);
+		ast_log(LOG_ERROR, "Unable to build sip pvt data for '%s' (Out of memory or socket error)\n", (char *)data);
 		*cause = AST_CAUSE_SWITCH_CONGESTION;
 		return NULL;
 	}



More information about the asterisk-commits mailing list