mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Small SIP ALG fixes
This commit is contained in:
parent
0023879724
commit
58c4f6cb28
3 changed files with 3 additions and 12 deletions
|
@ -1233,16 +1233,6 @@ function settings_add()
|
||||||
-- Enable/disable SIP ALG
|
-- Enable/disable SIP ALG
|
||||||
local sipalg = luci.http.formvalue("sipalg") or "0"
|
local sipalg = luci.http.formvalue("sipalg") or "0"
|
||||||
ucic:set("openmptcprouter","settings","sipalg",sipalg)
|
ucic:set("openmptcprouter","settings","sipalg",sipalg)
|
||||||
ucic:foreach("firewall", "zone", function (section)
|
|
||||||
ucic:set("firewall",section[".name"],"auto_helper",sipalg)
|
|
||||||
end)
|
|
||||||
if sipalg == "1" then
|
|
||||||
luci.sys.call("modprobe -q nf_conntrack_sip >/dev/null 2>/dev/null")
|
|
||||||
luci.sys.call("modprobe -q nf_nat_sip >/dev/null 2>/dev/null")
|
|
||||||
else
|
|
||||||
luci.sys.call("rmmod nf_nat_sip >/dev/null 2>/dev/null")
|
|
||||||
luci.sys.call("rmmod nf_conntrack_sip >/dev/null 2>/dev/null")
|
|
||||||
end
|
|
||||||
|
|
||||||
ucic:save("openmptcprouter")
|
ucic:save("openmptcprouter")
|
||||||
ucic:commit("openmptcprouter")
|
ucic:commit("openmptcprouter")
|
||||||
|
|
|
@ -197,8 +197,8 @@ start_service() {
|
||||||
set firewall.zone_vpn.auto_helper='1'
|
set firewall.zone_vpn.auto_helper='1'
|
||||||
commit firewall
|
commit firewall
|
||||||
EOF
|
EOF
|
||||||
modprobe nf_conntrack_sip 2>&1 >/dev/null
|
modprobe -q nf_conntrack_sip 2>&1 >/dev/null
|
||||||
modprobe nf_nat_sip 2>&1 >/dev/null
|
modprobe -q nf_nat_sip 2>&1 >/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(uci -q get rpcd.@rpcd[0].socket)" != "/var/run/ubus/ubus.sock" ]; then
|
if [ "$(uci -q get rpcd.@rpcd[0].socket)" != "/var/run/ubus/ubus.sock" ]; then
|
||||||
|
|
|
@ -245,6 +245,7 @@ EOF
|
||||||
if [ "$(uci -q get openmptcprouter.settings.sipalg)" = "" ]; then
|
if [ "$(uci -q get openmptcprouter.settings.sipalg)" = "" ]; then
|
||||||
uci -q batch <<-EOF >/dev/null
|
uci -q batch <<-EOF >/dev/null
|
||||||
set openmptcprouter.settings.sipalg='1'
|
set openmptcprouter.settings.sipalg='1'
|
||||||
|
commit openmptcprouter
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
if [ "$(uci -q get openmptcprouter.settings.sipalg)" = "0" ]; then
|
if [ "$(uci -q get openmptcprouter.settings.sipalg)" = "0" ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue