[sr-dev] git:4.0: modules/outbound: further improvement to the use_outbound() check

Peter Dunkley peter.dunkley at crocodile-rcs.com
Fri Mar 29 02:30:22 CET 2013


Module: sip-router
Branch: 4.0
Commit: 291900478f16272222b7c9138685ef871ece0875
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=291900478f16272222b7c9138685ef871ece0875

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Wed Mar 27 16:51:52 2013 +0000

modules/outbound: further improvement to the use_outbound() check
(cherry picked from commit a5f8f4cd4da60168fd73d7999c09181582ec5943)

---

 modules/outbound/ob_mod.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/modules/outbound/ob_mod.c b/modules/outbound/ob_mod.c
index a58fdff..3f76433 100644
--- a/modules/outbound/ob_mod.c
+++ b/modules/outbound/ob_mod.c
@@ -385,6 +385,14 @@ static int use_outbound_non_reg(struct sip_msg *msg)
 		}
 	}
 
+	/* Check there is a single Via: */
+	if (!(parse_headers(msg, HDR_VIA2_F, 0) == -1 || msg->via2 == 0
+		|| msg->via2->error != PARSE_OK))
+	{
+		LM_INFO("second Via: found - outbound not used\n");
+		return 0;
+	}
+
 	/* Look for ;ob in Contact-URIs */
 	if (msg->contact
 		|| (parse_headers(msg, HDR_CONTACT_F, 0) != -1 && msg->contact))




More information about the sr-dev mailing list