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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Apr 6 14:13:34 MST 2006


Author: oej
Date: Thu Apr  6 16:13:32 2006
New Revision: 18056

URL: http://svn.digium.com/view/asterisk?rev=18056&view=rev
Log:
Small fixes to handle_request_invite

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=18056&r1=18055&r2=18056&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Apr  6 16:13:32 2006
@@ -10810,11 +10810,13 @@
 		}
 
 		/* We have a succesful authentication, process the SDP portion if there is one */
-		if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
+		if (!strcasecmp(get_header(req, "Content-Type"), "application/sdp") ) {
 			if (process_sdp(p, req)) {
 				/* Unacceptable codecs */
 				transmit_response_reliable(p, "488 Not acceptable here", req);
 				ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
+				if (option_debug)
+					ast_log(LOG_DEBUG, "No compatible codecs for this SIP call.\n");
 				return -1;
 			}
 		} else {
@@ -10834,8 +10836,7 @@
 		/* Check number of concurrent calls -vs- incoming limit HERE */
 		if (option_debug)
 			ast_log(LOG_DEBUG, "Checking SIP call limits for device %s\n", p->username);
-		res = update_call_counter(p, INC_CALL_LIMIT);
-		if (res) {
+		if ((res = update_call_counter(p, INC_CALL_LIMIT))) {
 			if (res < 0) {
 				ast_log(LOG_NOTICE, "Failed to place call for user %s, too many calls\n", p->username);
 				transmit_response_reliable(p, "480 Temporarily Unavailable (Call limit) ", req);
@@ -10926,10 +10927,10 @@
 					ast_mutex_lock(&p->lock);
 					c = NULL;
 				}
-			} else {
+			} else {	/* Pickup call in call group */
 				ast_mutex_unlock(&c->lock);
 				if (ast_pickup_call(c)) {
-					ast_log(LOG_NOTICE, "Nothing to pick up\n");
+					ast_log(LOG_NOTICE, "Nothing to pick up for %s\n", p->callid);
 					if (ignore)
 						transmit_response(p, "503 Unavailable", req);
 					else
@@ -10965,7 +10966,7 @@
 			transmit_response(p, "100 Trying", req);
 		}
 	} else {
-		if (p && !ast_test_flag(&p->flags[0], SIP_NEEDDESTROY) && !ignore) {
+		if (p && !ast_test_flag(&p->flags[0], SIP_NEEDDESTROY)) {
 			if (!p->jointcapability) {
 				if (ignore)
 					transmit_response(p, "488 Not Acceptable Here (codec error)", req);
@@ -10973,7 +10974,7 @@
 					transmit_response_reliable(p, "488 Not Acceptable Here (codec error)", req);
 				ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 			} else {
-				ast_log(LOG_NOTICE, "Unable to create/find channel\n");
+				ast_log(LOG_NOTICE, "Unable to create/find SIP channel for this INVITE\n");
 				if (ignore)
 					transmit_response(p, "503 Unavailable", req);
 				else



More information about the asterisk-commits mailing list