[Asterisk-cvs] asterisk/channels chan_sip.c,1.389,1.390

markster at lists.digium.com markster at lists.digium.com
Sun May 16 11:49:32 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv3619/channels

Modified Files:
	chan_sip.c 
Log Message:
Improve handling of multiple CANCEL requests


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.389
retrieving revision 1.390
diff -u -d -r1.389 -r1.390
--- chan_sip.c	16 May 2004 05:53:33 -0000	1.389
+++ chan_sip.c	16 May 2004 16:01:09 -0000	1.390
@@ -6327,10 +6327,16 @@
 
 			if (gotdest) {
 				if (gotdest < 0) {
-					transmit_response(p, "404 Not Found", req);
+					if (ignore)
+						transmit_response(p, "404 Not Found", req);
+					else
+						transmit_response_reliable(p, "404 Not Found", req, 1);
 					update_user_counter(p,DEC_IN_USE);
 				} else {
-					transmit_response(p, "484 Address Incomplete", req);
+					if (ignore)
+						transmit_response(p, "484 Address Incomplete", req);
+					else
+						transmit_response_reliable(p, "484 Address Incomplete", req, 1);
 					update_user_counter(p,DEC_IN_USE);
 				}
 				p->needdestroy = 1;
@@ -6368,14 +6374,20 @@
 						ast_mutex_unlock(&p->lock);
 						ast_hangup(c);
 						ast_mutex_lock(&p->lock);
-						transmit_response_reliable(p, "503 Unavailable", req, 1);
+						if (ignore)
+							transmit_response(p, "503 Unavailable", req);
+						else
+							transmit_response_reliable(p, "503 Unavailable", req, 1);
 						c = NULL;
 					}
 				} else {
 					ast_mutex_unlock(&c->lock);
 					if (ast_pickup_call(c)) {
 						ast_log(LOG_NOTICE, "Nothing to pick up\n");
-						transmit_response_reliable(p, "503 Unavailable", req, 1);
+						if (ignore)
+							transmit_response(p, "503 Unavailable", req);
+						else
+							transmit_response_reliable(p, "503 Unavailable", req, 1);
 						p->alreadygone = 1;
 						/* Unlock locks so ast_hangup can do its magic */
 						ast_mutex_unlock(&p->lock);
@@ -6407,7 +6419,10 @@
 		} else {
 			if (p && !p->needdestroy) {
 				ast_log(LOG_NOTICE, "Unable to create/find channel\n");
-				transmit_response_reliable(p, "503 Unavailable", req, 1);
+				if (ignore)
+					transmit_response(p, "503 Unavailable", req);
+				else
+					transmit_response_reliable(p, "503 Unavailable", req, 1);
 				p->needdestroy = 1;
 			}
 		}
@@ -6464,10 +6479,11 @@
 		else
 			p->needdestroy = 1;
 		if (p->initreq.len > 0) {
-			transmit_response_reliable(p, "487 Request Terminated", &p->initreq, 1);
+			if (!ignore)
+				transmit_response_reliable(p, "487 Request Terminated", &p->initreq, 1);
 			transmit_response(p, "200 OK", req);
 		} else {
-			transmit_response_reliable(p, "481 Call Leg Does Not Exist", req, 1);
+			transmit_response(p, "481 Call Leg Does Not Exist", req);
 		}
 	} else if (!strcasecmp(cmd, "BYE")) {
 		copy_request(&p->initreq, req);




More information about the svn-commits mailing list