Module: sip-router Branch: 4.0 Commit: 6eb6d92af2fe55d14b255bb5c5c939cc2f78ba79 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6eb6d92a...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Fri Jun 7 11:00:51 2013 +0200
modules/rr: completely reverted after_strict() to its pre-outbound form
- backported from c9448d9657f0e5792072c6803643c8d9075d711a by Peter Dunkley
---
modules/rr/loose.c | 28 ++++++++-------------------- 1 files changed, 8 insertions(+), 20 deletions(-)
diff --git a/modules/rr/loose.c b/modules/rr/loose.c index ccd08d9..8141bd0 100644 --- a/modules/rr/loose.c +++ b/modules/rr/loose.c @@ -568,7 +568,6 @@ static inline int after_strict(struct sip_msg* _m) char* rem_off; str uri; struct socket_info *si; - int use_ob, next_is_strict;
hdr = _m->route; rt = (rr_t*)hdr->parsed; @@ -584,13 +583,7 @@ static inline int after_strict(struct sip_msg* _m) return RR_ERROR; }
- next_is_strict = is_strict(&puri.params); - if ((use_ob = process_outbound(_m, puri.user, &uri)) < 0) { - LM_ERR("processing outbound flow-token\n"); - return FLOW_TOKEN_BROKEN; - } - - if (!use_ob && enable_double_rr && is_2rr(&puri.params) && is_myself(&puri)) { + if ( enable_double_rr && is_2rr(&puri.params) && is_myself(&puri)) { /* double route may occure due different IP and port, so force as * send interface the one advertise in second Route */ si = grep_sock_info( &puri.host, puri.port_no, puri.proto); @@ -627,7 +620,6 @@ static inline int after_strict(struct sip_msg* _m) LM_ERR("failed to parse URI\n"); return RR_ERROR; } - next_is_strict = is_strict(&puri.params); }
/* set the hooks for the param @@ -636,7 +628,7 @@ static inline int after_strict(struct sip_msg* _m) routed_msg_id = _m->id; routed_params = _m->parsed_uri.params;
- if (next_is_strict) { + if (is_strict(&puri.params)) { LM_DBG("Next hop: '%.*s' is strict router\n", uri.len, ZSW(uri.s)); /* Previous hop was a strict router and the next hop is strict * router too. There is no need to save R-URI again because it @@ -647,11 +639,9 @@ static inline int after_strict(struct sip_msg* _m) * always be a strict router because endpoints don't use ;lr parameter * In this case we will simply put the URI in R-URI and forward it, * which will work perfectly */ - if (!use_ob) { - if(get_maddr_uri(&uri, &puri)!=0) { - LM_ERR("failed to check maddr\n"); - return RR_ERROR; - } + if(get_maddr_uri(&uri, &puri)!=0) { + LM_ERR("failed to check maddr\n"); + return RR_ERROR; } if (rewrite_uri(_m, &uri) < 0) { LM_ERR("failed to rewrite request URI\n"); @@ -673,11 +663,9 @@ static inline int after_strict(struct sip_msg* _m) LM_DBG("Next hop: '%.*s' is loose router\n", uri.len, ZSW(uri.s));
- if (!use_ob) { - if(get_maddr_uri(&uri, &puri)!=0) { - LM_ERR("failed to check maddr\n"); - return RR_ERROR; - } + if(get_maddr_uri(&uri, &puri)!=0) { + LM_ERR("failed to check maddr\n"); + return RR_ERROR; } if (set_dst_uri(_m, &uri) < 0) { LM_ERR("failed to set dst_uri\n");