Browse code

rr: fix detecting next strict router

- a regression after adding support for sip-outbound
- more verbose debug messages
- reported by Antonio Real, GH #267

Daniel-Constantin Mierla authored on 27/07/2015 16:57:53
Showing 1 changed files
... ...
@@ -757,7 +757,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
757 757
 	int status = RR_DRIVEN;
758 758
 	str uri;
759 759
 	struct socket_info *si;
760
-	int uri_is_myself, next_is_strict;
760
+	int uri_is_myself;
761 761
 	int use_ob = 0;
762 762
 
763 763
 	hdr = _m->route;
... ...
@@ -768,11 +768,11 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
768 768
 	routed_msg_id = 0;
769 769
 
770 770
 	if (parse_uri(uri.s, uri.len, &puri) < 0) {
771
-		LM_ERR("failed to parse the first route URI\n");
771
+		LM_ERR("failed to parse the first route URI (%.*s)\n",
772
+				uri.len, ZSW(uri.s));
772 773
 		return RR_ERROR;
773 774
 	}
774 775
 
775
-	next_is_strict = is_strict(&puri.params);
776 776
 	routed_params = puri.params;
777 777
 	uri_is_myself = is_myself(&puri);
778 778
 
... ...
@@ -815,7 +815,8 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
815 815
 			/* double route may occure due different IP and port, so force as
816 816
 			 * send interface the one advertise in second Route */
817 817
 			if (parse_uri(rt->nameaddr.uri.s,rt->nameaddr.uri.len,&puri)<0) {
818
-				LM_ERR("failed to parse the double route URI\n");
818
+				LM_ERR("failed to parse the double route URI (%.*s)\n",
819
+						rt->nameaddr.uri.len, ZSW(rt->nameaddr.uri.s));
819 820
 				return RR_ERROR;
820 821
 			}
821 822
 
... ...
@@ -852,7 +853,8 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
852 852
 		
853 853
 		uri = rt->nameaddr.uri;
854 854
 		if (parse_uri(uri.s, uri.len, &puri) < 0) {
855
-			LM_ERR("failed to parse the first route URI\n");
855
+			LM_ERR("failed to parse the next route URI (%.*s)\n",
856
+					uri.len, ZSW(uri.s));
856 857
 			return RR_ERROR;
857 858
 		}
858 859
 	} else {
... ...
@@ -867,7 +869,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
867 867
 	}
868 868
 
869 869
 	LM_DBG("URI to be processed: '%.*s'\n", uri.len, ZSW(uri.s));
870
-	if (next_is_strict) {
870
+	if (is_strict(&puri.params)) {
871 871
 		LM_DBG("Next URI is a strict router\n");
872 872
 		if (handle_sr(_m, hdr, rt) < 0) {
873 873
 			LM_ERR("failed to handle strict router\n");