summaryrefslogtreecommitdiff
path: root/net/siproxd
diff options
context:
space:
mode:
authorguidosarducci <guidosarducci@users.noreply.github.com>2017-06-18 16:04:15 -0700
committerguidosarducci <guidosarducci@users.noreply.github.com>2017-06-20 03:18:27 -0700
commit347cdf07bfdf9e80f5a0136fc63a6bb47ea5580c (patch)
treed63d3324680c7fe2a31a24111b13a2f0b02281d4 /net/siproxd
parent1f0fb2538ba6fc306198fe2a9a4b976d63adb304 (diff)
siproxd: use standard interface names by default
Support using standard interface names and make "lan"/"wan" the defaults for inbound/outbound SIP traffic. This change makes siproxd more portable but preserves backwards compatibility for upgrades. Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Diffstat (limited to 'net/siproxd')
-rw-r--r--net/siproxd/files/siproxd.config4
-rw-r--r--net/siproxd/files/siproxd.init19
2 files changed, 19 insertions, 4 deletions
diff --git a/net/siproxd/files/siproxd.config b/net/siproxd/files/siproxd.config
index b65148c..be953eb 100644
--- a/net/siproxd/files/siproxd.config
+++ b/net/siproxd/files/siproxd.config
@@ -1,3 +1,3 @@
config siproxd general
- option if_inbound lan
- option if_outbound wan
+ option interface_inbound lan
+ option interface_outbound wan
diff --git a/net/siproxd/files/siproxd.init b/net/siproxd/files/siproxd.init
index 1ad6e0f..0dbdeb0 100644
--- a/net/siproxd/files/siproxd.init
+++ b/net/siproxd/files/siproxd.init
@@ -18,9 +18,22 @@ deal_with_lists () {
start_instance() {
local cfg="$1"
+ local _int_inbound
+ local _int_outbound
+ local _dev_inbound
+ local _dev_outbound
+
+ config_get _int_inbound "$cfg" interface_inbound
+ config_get _int_outbound "$cfg" interface_outbound
+
+ scan_interfaces
+ network_get_physdev _dev_inbound $_int_inbound
+ network_get_physdev _dev_outbound $_int_outbound
+
+ config_load 'siproxd'
+ config_get if_inbound "$cfg" if_inbound $_dev_inbound
+ config_get if_outbound "$cfg" if_outbound $_dev_outbound
- config_get if_inbound "$cfg" if_inbound
- config_get if_outbound "$cfg" if_outbound
config_get host_outbound "$cfg" host_outbound
config_get hosts_allow_reg "$cfg" hosts_allow_reg
config_get hosts_allow_sip "$cfg" hosts_allow_sip
@@ -225,6 +238,8 @@ start() {
chown nobody:nogroup "$siproxd_pid_dir"
}
+ include /lib/network
+ . /lib/functions/network.sh
config_load 'siproxd'
config_foreach start_instance 'siproxd'
}