[sr-dev] git:master:0c42a848: rr: fix detecting next strict router

Daniel-Constantin Mierla miconda at gmail.com
Mon Jul 27 18:59:46 CEST 2015


Module: kamailio
Branch: master
Commit: 0c42a848258d475f57ea25458bc75e55dcee948d
URL: https://github.com/kamailio/kamailio/commit/0c42a848258d475f57ea25458bc75e55dcee948d

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-07-27T18:57:53+02:00

rr: fix detecting next strict router

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

---

Modified: modules/rr/loose.c

---

Diff:  https://github.com/kamailio/kamailio/commit/0c42a848258d475f57ea25458bc75e55dcee948d.diff
Patch: https://github.com/kamailio/kamailio/commit/0c42a848258d475f57ea25458bc75e55dcee948d.patch

---

diff --git a/modules/rr/loose.c b/modules/rr/loose.c
index de06bb3..76204c9 100644
--- a/modules/rr/loose.c
+++ b/modules/rr/loose.c
@@ -757,7 +757,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
 	int status = RR_DRIVEN;
 	str uri;
 	struct socket_info *si;
-	int uri_is_myself, next_is_strict;
+	int uri_is_myself;
 	int use_ob = 0;
 
 	hdr = _m->route;
@@ -768,11 +768,11 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
 	routed_msg_id = 0;
 
 	if (parse_uri(uri.s, uri.len, &puri) < 0) {
-		LM_ERR("failed to parse the first route URI\n");
+		LM_ERR("failed to parse the first route URI (%.*s)\n",
+				uri.len, ZSW(uri.s));
 		return RR_ERROR;
 	}
 
-	next_is_strict = is_strict(&puri.params);
 	routed_params = puri.params;
 	uri_is_myself = is_myself(&puri);
 
@@ -815,7 +815,8 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
 			/* double route may occure due different IP and port, so force as
 			 * send interface the one advertise in second Route */
 			if (parse_uri(rt->nameaddr.uri.s,rt->nameaddr.uri.len,&puri)<0) {
-				LM_ERR("failed to parse the double route URI\n");
+				LM_ERR("failed to parse the double route URI (%.*s)\n",
+						rt->nameaddr.uri.len, ZSW(rt->nameaddr.uri.s));
 				return RR_ERROR;
 			}
 
@@ -852,7 +853,8 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
 		
 		uri = rt->nameaddr.uri;
 		if (parse_uri(uri.s, uri.len, &puri) < 0) {
-			LM_ERR("failed to parse the first route URI\n");
+			LM_ERR("failed to parse the next route URI (%.*s)\n",
+					uri.len, ZSW(uri.s));
 			return RR_ERROR;
 		}
 	} else {
@@ -867,7 +869,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
 	}
 
 	LM_DBG("URI to be processed: '%.*s'\n", uri.len, ZSW(uri.s));
-	if (next_is_strict) {
+	if (is_strict(&puri.params)) {
 		LM_DBG("Next URI is a strict router\n");
 		if (handle_sr(_m, hdr, rt) < 0) {
 			LM_ERR("failed to handle strict router\n");




More information about the sr-dev mailing list