[sr-dev] git:master: uac: restrict check of multiple from/ to header changes to request route blocks

Daniel-Constantin Mierla miconda at gmail.com
Wed Jul 17 20:22:09 CEST 2013


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Wed Jul 17 20:19:28 2013 +0200

uac: restrict check of multiple from/to header changes to request route blocks

- it can occur many times in due to branch route usage
- reported by Andrew Pogrebennyk, FS#323

---

 modules/uac/replace.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/modules/uac/replace.c b/modules/uac/replace.c
index 791d69b..7f1f92c 100644
--- a/modules/uac/replace.c
+++ b/modules/uac/replace.c
@@ -39,6 +39,7 @@
 #include "../../parser/parse_from.h"
 #include "../../mem/mem.h"
 #include "../../data_lump.h"
+#include "../../route.h"
 #include "../../modules/tm/h_table.h"
 #include "../../modules/tm/tm_load.h"
 #include "../rr/api.h"
@@ -251,10 +252,12 @@ int replace_uri( struct sip_msg *msg, str *display, str *uri,
 	str * dlgvar_names;
 
 	uac_flag = (hdr==msg->from)?FL_USE_UAC_FROM:FL_USE_UAC_TO;
-	if(msg->msg_flags & uac_flag)
-	{
-		LM_ERR("Called uac_replace multiple times on the message\n");
-		return -1;
+	if(get_route_type()==REQUEST_ROUTE) {
+		if(msg->msg_flags & uac_flag)
+		{
+			LM_ERR("Called uac_replace multiple times on the message\n");
+			return -1;
+		}
 	}
 
 	/* consistency check! in AUTO mode, do NOT allow URI changing




More information about the sr-dev mailing list