[Asterisk-cvs] asterisk/channels chan_sip.c,1.282,1.283

markster at lists.digium.com markster at lists.digium.com
Sun Jan 25 23:36:16 CST 2004


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

Modified Files:
	chan_sip.c 
Log Message:
Send 481 if call leg does not exist on CANCEL, and send 487 before 200 as per rfc3261 (bug #917)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.282
retrieving revision 1.283
diff -u -d -r1.282 -r1.283
--- chan_sip.c	25 Jan 2004 05:51:49 -0000	1.282
+++ chan_sip.c	26 Jan 2004 05:28:14 -0000	1.283
@@ -5425,8 +5425,12 @@
 			ast_queue_hangup(p->owner, 0);
 		else
 			p->needdestroy = 1;
-		transmit_response(p, "200 OK", req);
-		transmit_response_reliable(p, "487 Request Terminated", &p->initreq);
+		if (p->initreq.len > 0) {
+			transmit_response_reliable(p, "487 Request Terminated", &p->initreq);
+			transmit_response(p, "200 OK", req);
+		} else {
+			transmit_response_reliable(p, "481 Call Leg Does Not Exist", req);
+		}
 	} else if (!strcasecmp(cmd, "BYE")) {
 		copy_request(&p->initreq, req);
 		check_via(p, req);




More information about the svn-commits mailing list