[Asterisk-cvs] asterisk/channels chan_sip.c,1.633,1.634

markster at lists.digium.com markster at lists.digium.com
Sun Jan 16 01:19:07 CST 2005


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

Modified Files:
	chan_sip.c 
Log Message:
Avoid duplicate 200 OK


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.633
retrieving revision 1.634
diff -u -d -r1.633 -r1.634
--- chan_sip.c	16 Jan 2005 06:01:50 -0000	1.633
+++ chan_sip.c	16 Jan 2005 07:22:34 -0000	1.634
@@ -8002,13 +8002,14 @@
 						found++;
 					}
 
-					if (found)
+					if (found){
 						transmit_response(p, "200 OK", req);
-					else {
+						ast_set_flag(p, SIP_NEEDDESTROY);	
+					} else {
 						transmit_response(p, "403 Forbidden", req);
 						ast_set_flag(p, SIP_NEEDDESTROY);	
 					}
-					
+					return 0;
 				} else
 				    p->subscribed = 1;
 				if (p->subscribed)
@@ -8022,14 +8023,14 @@
 			p->lastinvite = seqno;
 		if (p && !ast_test_flag(p, SIP_NEEDDESTROY)) {
 		    if (!(p->expiry = atoi(get_header(req, "Expires")))) {
-			transmit_response(p, "200 OK", req);
-			ast_set_flag(p, SIP_NEEDDESTROY);	
-			return 0;
+				transmit_response(p, "200 OK", req);
+				ast_set_flag(p, SIP_NEEDDESTROY);	
+				return 0;
 		    }
 		    /* The next line can be removed if the SNOM200 Expires bug is fixed */
 		    if (p->subscribed == 1) {  
-			if (p->expiry>max_expiry)
-			    p->expiry = max_expiry;
+				if (p->expiry>max_expiry)
+					p->expiry = max_expiry;
 		    }
 		    transmit_response(p, "200 OK", req);
 		    sip_scheddestroy(p, (p->expiry+10)*1000);




More information about the svn-commits mailing list