2
0
Эх сурвалжийг харах

sr-oob.cfg: Updated for latest sip-router code.

Updates the all-inclusiv ser-oob configuration file to work with the
latest sip-router code. Changes include:
  * Load enum module which is used by one of the route sections.
  * Replace expressions like if (@hf.value["contact"]) with
    if (@hf.value["contact"] != "")
  * When testing for an avp value, test that the avp is defined first
    with "defined".
Jan Janak 16 жил өмнө
parent
commit
89f4581214

+ 7 - 7
etc/sip-router-oob.cfg

@@ -292,7 +292,7 @@ loadmodule "db_ops"
 loadmodule "exec"
 loadmodule "cfg_rpc"
 loadmodule "eval"
-#loadmodule "enum"
+loadmodule "enum"
 #loadmodule "tls"
 
 # ----------------- Declaration of Script Flags -----------------------------
@@ -740,7 +740,7 @@ route[UAC_NAT_DETECTION]
 	# nat_uac_test for UDP to "3" or even "1".
 	if ((proto == UDP && nat_uac_test("19")) ||
 		(nat_uac_test("3")) ||
-		(@hf_value["contact"] && @contact.uri.params.maddr))
+		(@hf_value["contact"] != "" && @contact.uri.params.maddr != ""))
 	{
 		setflag(FLAG_NAT);
 		if (method == "REGISTER") {
@@ -790,7 +790,7 @@ route[UAS_NAT_DETECTION]
 	# nat_uac_test for UDP to just "1".
 	if ( (proto == UDP && nat_uac_test("33")) ||
 		(nat_uac_test("1") ||
-		(@hf_value["contact"] && @contact.uri.params.maddr)))
+		(@hf_value["contact"] != "" && @contact.uri.params.maddr != "")))
 	{
 		fix_nated_contact();
 	}
@@ -1123,7 +1123,7 @@ route[AUTHENTICATION]
 			sl_reply("400", "Bad Request");
 		}
 		else {
-			if ($digest_challenge) {
+			if (defined $digest_challenge && $digest_challenge != "") {
 				append_to_reply("%$digest_challenge");
 			}
 			sl_reply("407", "Proxy Authentication Required");
@@ -1202,7 +1202,7 @@ route[INBOUND]
 	# Check for call forwarding of the callee.
 	# Note: The forwarding target has to be full routable URI
 	#       in this example.
-	if ($tu.fwd_always_target != "") {
+	if (defined $tu.fwd_always_target && $tu.fwd_always_target != "") {
 		attr2uri("$tu.fwd_always_target");
 
 		# If we are forwarding to ourselves, don't remove
@@ -1212,7 +1212,7 @@ route[INBOUND]
 		# still be problematic -- credentials are already
 		# removed when we forward. Consider using a 3xx.
 		lookup_domain("$td", "@ruri.host");
-		if ($t.did != "") {
+		if (defined $t.did && $t.did != "") {
 			setflag(FLAG_DONT_RM_CRED);
 		}
 		route(FORWARD);
@@ -1526,7 +1526,7 @@ onsend_route
 	# This helps to stop policy bypasses (gateway IP uploaded as a
 	# forked contact, or a call-forwarding destination, or a DNS name,
 	# or a preloaded route, or something else possibly)
-	if (to_ip==$g.gw_ip && !isflagset(FLAG_PSTN_ALLOWED)
+	if (defined $g.gw_ip && to_ip==$g.gw_ip && !isflagset(FLAG_PSTN_ALLOWED)
 	    && !isflagset(FLAG_TOTAG)
 	    && method != "ACK" && method != "CANCEL")
 	{