[Asterisk-cvs] asterisk/channels chan_sip.c,1.349,1.350

markster at lists.digium.com markster at lists.digium.com
Thu Apr 29 23:58:23 CDT 2004


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

Modified Files:
	chan_sip.c 
Log Message:
Only clear route if we have a new one


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.349
retrieving revision 1.350
diff -u -d -r1.349 -r1.350
--- chan_sip.c	29 Apr 2004 22:27:40 -0000	1.349
+++ chan_sip.c	30 Apr 2004 04:05:22 -0000	1.350
@@ -3699,12 +3699,9 @@
 	struct sip_route *thishop, *head, *tail;
 	int start = 0;
 	int len;
+	int firstpass = 1;
 	char *rr, *contact, *c;
 
-	if (p->route) {
-		free_old_route(p->route);
-		p->route = NULL;
-	}
 	/* We build up head, then assign it to p->route when we're done */
 	head = NULL;  tail = head;
 	/* 1st we pass through all the hops in any Record-Route headers */
@@ -3712,6 +3709,13 @@
 		/* Each Record-Route header */
 		rr = __get_header(req, "Record-Route", &start);
 		if (*rr == '\0') break;
+		if (firstpass) {
+			if (p->route) {
+				free_old_route(p->route);
+				p->route = NULL;
+			}
+			firstpass = 0;
+		}
 		for (;;) {
 			/* Each route entry */
 			/* Find < */




More information about the svn-commits mailing list