Преглед изворни кода

rtp_proxy.enable configuration option is introduced, the following
values are supported:
"0" -- disable
"1" -- enable
"detect" -- detect whether the UAC or the UAS is behind NAT, and enable
the RTP Proxy when necessary

WARNING: disabling the RTP Proxy runtime may leave the RTP sessions
being proxied unmaintained.

Miklos Tirpak пре 17 година
родитељ
комит
db4a19318c
1 измењених фајлова са 21 додато и 3 уклоњено
  1. 21 3
      etc/ser-oob.cfg

+ 21 - 3
etc/ser-oob.cfg

@@ -237,6 +237,15 @@ session_timer.default = "1800" desc "default session interval (in s)"
 #
 session_timer.min_se = "90" desc "minimum session interval (in s)"
 
+# RTP Proxy options
+#
+# Whether to enable or disable the rtp proxy. Possible values are:
+# "0" -- always disable
+# "1" -- always enable regardless of whether UAC or UAS is behind NAT
+# "detect" -- detect whether the UAC or the UAS is behind NAT,
+#             and enable the rtp proxy when necessary
+#
+rtp_proxy.enable = "detect" desc "indicates whether the RTP Proxy is enabled or not (0/1/detect)"
 
 # ------------------ Module Loading -----------------------------------------
 
@@ -720,10 +729,19 @@ route[NAT_DETECTION]
 #
 route[RTPPROXY]
 {
-	# If no NAT is involved we dont have to do here anything.
-	if (!isflagset(FLAG_NAT)) {
+	if (@cfg_get.rtp_proxy.enable == "0") {
+		# RTP Proxy is disabled
 		break;
-	}
+	} else if (@cfg_get.rtp_proxy.enable == "detect") {
+		if (!isflagset(FLAG_NAT)) {
+			# If no NAT is involved we don't have to do here anything.
+			break;
+		}
+	} else if (@cfg_get.rtp_proxy.enable != "1") {
+		# This is not a valid setting
+		xlog("L_ERR", "Unknown option for rtp_proxy.enable: %@cfg_get.rtp_proxy.enable\n");
+		break;
+	} # else rtp proxy is permanently enabled
 
 	# If the message terminates a dialog turn RTP proxy off.
 	if (method == "BYE" || method == "CANCEL") {