[sr-dev] git:pd/outbound: modules_k/rr: handle outbound failing and outbound just not being used as separate cases

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


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

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Mon Dec 31 13:44:19 2012 +0000

modules_k/rr: handle outbound failing and outbound just not being used as separate cases

---

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

diff --git a/modules_k/rr/loose.c b/modules_k/rr/loose.c
index 5be28fd..e110808 100644
--- a/modules_k/rr/loose.c
+++ b/modules_k/rr/loose.c
@@ -502,13 +502,22 @@ static char uri_buf[MAX_ROUTE_URI_LEN];
 static inline int process_outbound(struct sip_msg *_m, str flow_token,
 		str *dst_uri)
 {
+	int ret;
 	struct receive_info rcv;
 	struct socket_info *si;
 
 	if (!rr_obb.decode_flow_token)
 		return 0;
 
-	if (rr_obb.decode_flow_token(&rcv, flow_token) == 0) {
+	ret = rr_obb.decode_flow_token(&rcv, flow_token);
+
+	if (ret == -2) {
+		LM_INFO("no flow token found - outbound not in use\n");
+		return 0;
+	} else if (ret == -1) {
+		LM_ERR("failed to decode flow token\n");
+		return -1;
+	} else {
 
 		/* First, force the local socket */
 		si = find_si(&rcv.dst_ip, rcv.dst_port, rcv.proto);
@@ -539,8 +548,6 @@ static inline int process_outbound(struct sip_msg *_m, str flow_token,
 
 		return 1;
 	}
-
-	return 0;
 }
 
 /*!




More information about the sr-dev mailing list