Przeglądaj źródła

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
Daniel-Constantin Mierla 12 lat temu
rodzic
commit
d3a0a8b15a
1 zmienionych plików z 7 dodań i 4 usunięć
  1. 7 4
      modules/uac/replace.c

+ 7 - 4
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