mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add option to enable/disable SIP ALG
This commit is contained in:
parent
b174b3ba3e
commit
eedbfc56b7
4 changed files with 42 additions and 0 deletions
|
@ -1190,6 +1190,19 @@ function settings_add()
|
|||
local sfe_bridge = luci.http.formvalue("sfe_bridge") or "0"
|
||||
ucic:set("openmptcprouter","settings","sfe_bridge",sfe_bridge)
|
||||
|
||||
-- Enable/disable SIP ALG
|
||||
local sipalg = luci.http.formvalue("sipalg") or "0"
|
||||
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 nf_conntrack_ip >/dev/null 2>/dev/null")
|
||||
luci.sys.call("modprobe 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_ip >/dev/null 2>/dev/null")
|
||||
end
|
||||
|
||||
ucic:save("openmptcprouter")
|
||||
ucic:commit("openmptcprouter")
|
||||
|
|
|
@ -219,6 +219,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:Enable SIP ALG%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input type="checkbox" name="sipalg" class="cbi-input-checkbox" value="1" <% if luci.model.uci.cursor():get("openmptcprouter","settings","sipalg") == "1" then %>checked<% end %>>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<hr />
|
||||
<fieldset class="cbi-section" id="other">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue