[Asterisk-cvs] asterisk/channels chan_sip.c,1.510.2.40,1.510.2.41

russell at lists.digium.com russell at lists.digium.com
Mon Jan 17 13:25:54 CST 2005


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

Modified Files:
      Tag: v1-0
	chan_sip.c 
Log Message:
prevent duplicate 200 ... and some formatting


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.510.2.40
retrieving revision 1.510.2.41
diff -u -d -r1.510.2.40 -r1.510.2.41
--- chan_sip.c	17 Jan 2005 00:43:46 -0000	1.510.2.40
+++ chan_sip.c	17 Jan 2005 19:29:10 -0000	1.510.2.41
@@ -7594,13 +7594,16 @@
 						found++;
 					}
 
-					if (found)
+					if (found) {
 						transmit_response(p, "200 OK", req);
-					else {
+						p->needdestroy = 1;
+					} else {
 						transmit_response(p, "403 Forbidden", req);
 						p->needdestroy = 1;
 					}
-					
+
+					return 0;
+				
 				} else
 				    p->subscribed = 1;
 				if (p->subscribed)
@@ -7613,19 +7616,20 @@
 		if (!ignore && p)
 			p->lastinvite = seqno;
 		if (p && !p->needdestroy) {
-		    if (!(p->expiry = atoi(get_header(req, "Expires")))) {
+			if (!(p->expiry = atoi(get_header(req, "Expires")))) {
+				transmit_response(p, "200 OK", req);
+				p->needdestroy = 1;
+				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;
+				}
+			}	
 			transmit_response(p, "200 OK", req);
-			p->needdestroy = 1;
-			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;
-		    }
-		    transmit_response(p, "200 OK", req);
-		    sip_scheddestroy(p, (p->expiry+10)*1000);
-		    transmit_state_notify(p, ast_extension_state(NULL, p->context, p->exten),1);
+			sip_scheddestroy(p, (p->expiry+10)*1000);
+			transmit_state_notify(p, ast_extension_state(NULL, p->context, p->exten),1);
 		}
 	} else if (!strcasecmp(cmd, "INFO")) {
 		if (!ignore) {




More information about the svn-commits mailing list