1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 18:41:51 +00:00

Fix SIP ALG

This commit is contained in:
Ycarus (Yannick Chabanois) 2022-08-27 07:50:12 +02:00
parent ed7d5abfdf
commit 0023879724
2 changed files with 26 additions and 1 deletions

View file

@ -181,6 +181,26 @@ start_service() {
rmmod fast_classifier 2>&1 >/dev/null
fi
if [ "$(uci -q get openmptcprouter.settings.sipalg)" = "0" ]; then
uci -q batch <<-EOF >/dev/null
set firewall.zone_lan.auto_helper='0'
set firewall.zone_wan.auto_helper='0'
set firewall.zone_vpn.auto_helper='0'
commit firewall
EOF
rmmod nf_nat_sip 2>&1 >/dev/null
rmmod nf_conntrack_sip 2>&1 >/dev/null
else
uci -q batch <<-EOF >/dev/null
set firewall.zone_lan.auto_helper='1'
set firewall.zone_wan.auto_helper='1'
set firewall.zone_vpn.auto_helper='1'
commit firewall
EOF
modprobe nf_conntrack_sip 2>&1 >/dev/null
modprobe nf_nat_sip 2>&1 >/dev/null
fi
if [ "$(uci -q get rpcd.@rpcd[0].socket)" != "/var/run/ubus/ubus.sock" ]; then
uci -q batch <<-EOF >/dev/null
set rpcd.@rpcd[0].socket='/var/run/ubus/ubus.sock'

View file

@ -242,7 +242,12 @@ uci -q batch <<-EOF >/dev/null
set firewall.@include[0].reload='1'
commit firewall
EOF
if [ "$(uci -q get openmptcprouter.settings.sipalg)" != "1" ]; then
if [ "$(uci -q get openmptcprouter.settings.sipalg)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set openmptcprouter.settings.sipalg='1'
EOF
fi
if [ "$(uci -q get openmptcprouter.settings.sipalg)" = "0" ]; then
uci -q batch <<-EOF >/dev/null
set firewall.zone_lan.auto_helper='0'
set firewall.zone_wan.auto_helper='0'