[sr-dev] git:pd/outbound: modules_k/rr: tidied up error handling and comments relating to outbound

Peter Dunkley peter.dunkley at crocodile-rcs.com
Mon Dec 31 18:11:19 CET 2012


Module: sip-router
Branch: pd/outbound
Commit: 6141b16fc5f619938472f6f56d0fb2e0e5456aee
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6141b16fc5f619938472f6f56d0fb2e0e5456aee

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Mon Dec 31 12:55:06 2012 +0000

modules_k/rr: tidied up error handling and comments relating to outbound

---

 modules_k/rr/loose.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/modules_k/rr/loose.c b/modules_k/rr/loose.c
index fac18f3..01d95e4 100644
--- a/modules_k/rr/loose.c
+++ b/modules_k/rr/loose.c
@@ -492,6 +492,13 @@ static inline int find_rem_target(struct sip_msg* _m, struct hdr_field** _h, rr_
 #define MAX_ROUTE_URI_LEN	66
 static char uri_buf[MAX_ROUTE_URI_LEN];
 
+/*!
+ * \brief Perform outbound processing - force local socket and set destination URI
+ * \param _m SIP message
+ * \param flow_token string containing the flow token extracted from the Route: header
+ * \param dst_uri string to write the destination URI to (extracted from flow token)
+ * \return -1 on error, 0 when outbound not in use, 1 when outbound in use
+ */
 static inline int process_outbound(struct sip_msg *_m, str flow_token,
 		str *dst_uri)
 {
@@ -567,8 +574,10 @@ static inline int after_strict(struct sip_msg* _m)
 	}
 
 	next_is_strict = is_strict(&puri.params);
-	if ((use_ob = process_outbound(_m, puri.user, &uri) < 0))
+	if ((use_ob = process_outbound(_m, puri.user, &uri) < 0)) {
+		LM_ERR("processing outbound flow token\n");
 		return RR_ERROR;
+	}
 
 	if (!use_ob && enable_double_rr && is_2rr(&puri.params) && is_myself(&puri)) {
 		/* double route may occure due different IP and port, so force as
@@ -758,8 +767,10 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
 	next_is_strict = is_strict(&puri.params);
 	routed_params = puri.params;
 	uri_is_myself = is_myself(&puri);
-	if ((use_ob = process_outbound(_m, puri.user, &uri) < 0))
+	if ((use_ob = process_outbound(_m, puri.user, &uri) < 0)) {
+		LM_ERR("processing outbound flow token\n");
 		return RR_ERROR;
+	}
 
 	/* IF the URI was added by me, remove it */
 	if (uri_is_myself>0)




More information about the sr-dev mailing list