Przeglądaj źródła

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

Peter Dunkley 12 lat temu
rodzic
commit
291900478f
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8 0
      modules/outbound/ob_mod.c

+ 8 - 0
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 */
 	/* Look for ;ob in Contact-URIs */
 	if (msg->contact
 	if (msg->contact
 		|| (parse_headers(msg, HDR_CONTACT_F, 0) != -1 && msg->contact))
 		|| (parse_headers(msg, HDR_CONTACT_F, 0) != -1 && msg->contact))