summaryrefslogtreecommitdiff
path: root/applications
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-10-28 15:15:27 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-10-28 15:15:27 +0000
commiteda5b4becda5b681f9f0a92323c54604fc8b175d (patch)
treef37c9deb8fd5705daea7564df9ff66844fc6c151 /applications
parent94f2ebc32941d023e54b7447f32ba90a457179fc (diff)
parent33caee55e4e3657511a49105a1a34a15fe994e0a (diff)
luci-0.10: sync with trunk, drop broken and unfinished applications
Diffstat (limited to 'applications')
-rw-r--r--applications/luci-ahcp/luasrc/controller/ahcp.lua5
-rw-r--r--applications/luci-ahcp/luasrc/view/ahcp_status.htm65
-rwxr-xr-xapplications/luci-asterisk/ipkg/postinst6
-rw-r--r--applications/luci-asterisk/luasrc/asterisk.lua759
-rw-r--r--applications/luci-asterisk/luasrc/asterisk/cc_idd.lua254
-rw-r--r--applications/luci-asterisk/luasrc/controller/asterisk.lua205
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-dialplans.lua102
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-iax-connections.lua60
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-meetme.lua33
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-app.lua391
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-cdr.lua58
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-chan.lua56
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-codec.lua64
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-format.lua100
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-func.lua40
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-pbx.lua64
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-res-feature.lua111
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-res.lua88
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-sip-connections.lua109
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk-voice.lua52
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk.lua162
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk/dialplan_out.lua137
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk/dialplans.lua115
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk/dialzones.lua135
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk/meetme.lua49
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk/meetme_settings.lua28
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk/phone_sip.lua157
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk/phones.lua116
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk/trunk_sip.lua98
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk/trunks.lua106
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk/voicemail.lua59
-rw-r--r--applications/luci-asterisk/luasrc/model/cbi/asterisk/voicemail_settings.lua62
-rw-r--r--applications/luci-asterisk/luasrc/view/asterisk/cbi/cell.htm22
-rw-r--r--applications/luci-asterisk/luasrc/view/asterisk/dialplans.htm254
-rw-r--r--applications/luci-asterisk/luasrc/view/asterisk/dialzones.htm174
-rw-r--r--applications/luci-asterisk/root/etc/config/asterisk231
-rwxr-xr-xapplications/luci-asterisk/root/etc/uci-defaults/luci-asterisk11
-rw-r--r--applications/luci-coovachilli/Makefile4
-rw-r--r--applications/luci-coovachilli/luasrc/controller/coovachilli.lua29
-rw-r--r--applications/luci-coovachilli/luasrc/model/cbi/coovachilli.lua31
-rw-r--r--applications/luci-coovachilli/luasrc/model/cbi/coovachilli_auth.lua76
-rw-r--r--applications/luci-coovachilli/luasrc/model/cbi/coovachilli_network.lua67
-rw-r--r--applications/luci-coovachilli/luasrc/model/cbi/coovachilli_radius.lua67
-rw-r--r--applications/luci-coovachilli/root/etc/config/coovachilli243
-rw-r--r--applications/luci-ddns/luasrc/controller/ddns.lua12
-rw-r--r--applications/luci-diag-core/luasrc/controller/luci_diag.lua23
-rw-r--r--applications/luci-diag-devinfo/luasrc/controller/luci_diag/luci_diag_devinfo.lua26
-rw-r--r--applications/luci-ffwizard/Makefile4
-rw-r--r--applications/luci-ffwizard/luasrc/controller/ffwizard.lua30
-rw-r--r--applications/luci-ffwizard/luasrc/model/cbi/freifunk/ffwizard.lua1219
-rw-r--r--applications/luci-ffwizard/luasrc/tools/ffwizard.lua149
-rw-r--r--applications/luci-ffwizard/luasrc/view/freifunk/ffwizard_error.htm26
-rwxr-xr-xapplications/luci-ffwizard/root/etc/uci-defaults/device-defaults80
-rw-r--r--applications/luci-firewall/luasrc/controller/luci_fw/luci_fw.lua7
-rw-r--r--applications/luci-freifunk-policyrouting/luasrc/controller/freifunk/policy-routing.lua9
-rw-r--r--applications/luci-hd-idle/luasrc/controller/hd_idle.lua18
-rw-r--r--applications/luci-lqtapifoss/luasrc/controller/lqtapifoss.lua11
-rw-r--r--applications/luci-meshwizard/luasrc/controller/meshwizard.lua4
-rw-r--r--applications/luci-mmc-over-gpio/luasrc/controller/mmc_over_gpio.lua18
-rw-r--r--applications/luci-multiwan/luasrc/controller/multiwan.lua56
-rw-r--r--applications/luci-multiwan/luasrc/view/admin_status/index/multiwan.htm1
-rw-r--r--applications/luci-multiwan/luasrc/view/multiwan_status.htm71
-rw-r--r--applications/luci-ntpc/luasrc/controller/ntpc.lua14
-rw-r--r--applications/luci-olsr-services/luasrc/controller/services.lua3
-rw-r--r--applications/luci-olsr-viz/luasrc/controller/olsr-viz.lua2
-rw-r--r--applications/luci-olsr/luasrc/controller/olsr.lua25
-rw-r--r--applications/luci-olsr/luasrc/model/cbi/olsr/olsrd.lua2
-rw-r--r--applications/luci-openvpn/luasrc/controller/openvpn.lua6
-rw-r--r--applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua348
-rw-r--r--applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua4
-rw-r--r--applications/luci-openvpn/luasrc/view/openvpn/pageswitch.htm8
-rw-r--r--applications/luci-p2pblock/luasrc/controller/ff_p2pblock.lua3
-rw-r--r--applications/luci-p910nd/luasrc/controller/p910nd.lua18
-rw-r--r--applications/luci-polipo/luasrc/controller/polipo.lua10
-rw-r--r--applications/luci-qos/luasrc/controller/qos.lua10
-rw-r--r--applications/luci-radvd/luasrc/controller/radvd.lua2
-rw-r--r--applications/luci-samba/luasrc/controller/samba.lua11
-rw-r--r--applications/luci-splash/Makefile2
-rw-r--r--applications/luci-splash/luasrc/controller/splash/splash.lua15
-rw-r--r--applications/luci-splash/luasrc/model/cbi/splash/splash.lua63
-rw-r--r--applications/luci-splash/luasrc/model/cbi/splash/splashtext.lua2
-rw-r--r--applications/luci-splash/luasrc/view/admin_status/splash.htm1
-rw-r--r--applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua66
-rw-r--r--applications/luci-statistics/luasrc/model/cbi/luci_statistics/iptables.lua6
-rw-r--r--applications/luci-tinyproxy/luasrc/controller/tinyproxy.lua9
-rw-r--r--applications/luci-upnp/luasrc/controller/upnp.lua5
-rw-r--r--applications/luci-upnp/luasrc/view/upnp_status.htm71
-rw-r--r--applications/luci-ushare/luasrc/controller/ushare.lua18
-rw-r--r--applications/luci-ushare/luasrc/model/cbi/ushare.lua2
-rw-r--r--applications/luci-vnstat/luasrc/controller/vnstat.lua15
-rw-r--r--applications/luci-vnstat/luasrc/model/cbi/vnstat.lua8
-rw-r--r--applications/luci-voice-core/luasrc/controller/luci_voice.lua12
-rw-r--r--applications/luci-voice-diag/luasrc/controller/luci_voice/luci_voice_diag.lua12
-rw-r--r--applications/luci-wol/luasrc/controller/wol.lua7
-rw-r--r--applications/luci-wshaper/Makefile (renamed from applications/luci-asterisk/Makefile)2
-rw-r--r--applications/luci-wshaper/ipkg/postinst6
-rw-r--r--applications/luci-wshaper/luasrc/controller/wshaper.lua19
-rw-r--r--applications/luci-wshaper/luasrc/model/cbi/wshaper.lua55
-rw-r--r--applications/luci-wshaper/root/etc/uci-defaults/wshaper11
99 files changed, 687 insertions, 7005 deletions
diff --git a/applications/luci-ahcp/luasrc/controller/ahcp.lua b/applications/luci-ahcp/luasrc/controller/ahcp.lua
index ea73903117..5667bb532f 100644
--- a/applications/luci-ahcp/luasrc/controller/ahcp.lua
+++ b/applications/luci-ahcp/luasrc/controller/ahcp.lua
@@ -19,10 +19,7 @@ function index()
return
end
- require("luci.i18n")
- luci.i18n.loadc("ahcp")
-
- entry({"admin", "network", "ahcpd"}, cbi("ahcp"), luci.i18n.translate("AHCP Server"), 90).i18n = "ahcp"
+ entry({"admin", "network", "ahcpd"}, cbi("ahcp"), _("AHCP Server"), 90).i18n = "ahcp"
entry({"admin", "network", "ahcpd", "status"}, call("ahcp_status"))
end
diff --git a/applications/luci-ahcp/luasrc/view/ahcp_status.htm b/applications/luci-ahcp/luasrc/view/ahcp_status.htm
index bc595ce6c8..abe8879a40 100644
--- a/applications/luci-ahcp/luasrc/view/ahcp_status.htm
+++ b/applications/luci-ahcp/luasrc/view/ahcp_status.htm
@@ -1,48 +1,41 @@
<script type="text/javascript">//<![CDATA[
- var stxhr = new XHR();
- var update_status = function() {
- stxhr.get('<%=luci.dispatcher.build_url("admin", "network", "ahcpd", "status")%>', null,
- function(x, st)
+ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "ahcpd", "status")%>', null,
+ function(x, st)
+ {
+ var tb = document.getElementById('ahcpd_status_table');
+ var tx = document.getElementById('ahcpd_status_text');
+ if (st && tb && tx)
{
- var tb = document.getElementById('ahcpd_status_table');
- var tx = document.getElementById('ahcpd_status_text');
- if (st && tb && tx)
- {
- /* clear all rows */
- while( tb.rows.length > 1 )
- tb.deleteRow(1);
-
- for( var i = 0; i < st.leases.length; i++ )
- {
- var tr = tb.insertRow(-1);
- tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
+ /* clear all rows */
+ while( tb.rows.length > 1 )
+ tb.deleteRow(1);
- tr.insertCell(-1).innerHTML = st.leases[i].addr;
- tr.insertCell(-1).innerHTML = String.format('%t', st.leases[i].age);
- }
+ for( var i = 0; i < st.leases.length; i++ )
+ {
+ var tr = tb.insertRow(-1);
+ tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
- if( tb.rows.length == 1 )
- {
- var tr = tb.insertRow(-1);
- tr.className = 'cbi-section-table-row';
+ tr.insertCell(-1).innerHTML = st.leases[i].addr;
+ tr.insertCell(-1).innerHTML = String.format('%t', st.leases[i].age);
+ }
- var td = tr.insertCell(-1);
- td.colSpan = 2;
- td.innerHTML = '<em><br /><%:There are no active leases.%></em>';
- }
+ if( tb.rows.length == 1 )
+ {
+ var tr = tb.insertRow(-1);
+ tr.className = 'cbi-section-table-row';
- if( st.uid == '00:00:00:00:00:00:00:00' )
- tx.innerHTML = 'The AHCP Service is not running.';
- else
- tx.innerHTML = String.format('The AHCP Service is running with ID %s.', st.uid);
+ var td = tr.insertCell(-1);
+ td.colSpan = 2;
+ td.innerHTML = '<em><br /><%:There are no active leases.%></em>';
}
- window.setTimeout(update_status, 5000);
+ if( st.uid == '00:00:00:00:00:00:00:00' )
+ tx.innerHTML = 'The AHCP Service is not running.';
+ else
+ tx.innerHTML = String.format('The AHCP Service is running with ID %s.', st.uid);
}
- )
- };
-
- update_status();
+ }
+ );
//]]></script>
<fieldset class="cbi-section">
diff --git a/applications/luci-asterisk/ipkg/postinst b/applications/luci-asterisk/ipkg/postinst
deleted file mode 100755
index a4fae6df1d..0000000000
--- a/applications/luci-asterisk/ipkg/postinst
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-[ -n "${IPKG_INSTROOT}" ] || {
- ( . /etc/uci-defaults/luci-asterisk ) && rm -f /etc/uci-defaults/luci-asterisk
- /etc/init.d/asterisk enabled || /etc/init.d/asterisk enable
- exit 0
-}
diff --git a/applications/luci-asterisk/luasrc/asterisk.lua b/applications/luci-asterisk/luasrc/asterisk.lua
deleted file mode 100644
index 15081cc9a4..0000000000
--- a/applications/luci-asterisk/luasrc/asterisk.lua
+++ /dev/null
@@ -1,759 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-Asterisk PBX interface library
-
-Copyright 2009 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
-]]--
-
-module("luci.asterisk", package.seeall)
-require("luci.asterisk.cc_idd")
-
-local _io = require("io")
-local uci = require("luci.model.uci").cursor()
-local sys = require("luci.sys")
-local util = require("luci.util")
-
-AST_BIN = "/usr/sbin/asterisk"
-AST_FLAGS = "-r -x"
-
-
---- LuCI Asterisk - Resync uci context
-function uci_resync()
- uci = luci.model.uci.cursor()
-end
-
---- LuCI Asterisk io interface
--- Handles low level io.
--- @type module
-io = luci.util.class()
-
---- Execute command and return output
--- @param command String containing the command to execute
--- @return String containing the command output
-function io.exec(command)
- local fh = _io.popen( "%s %s %q" %{ AST_BIN, AST_FLAGS, command }, "r" )
- assert(fh, "Failed to invoke asterisk")
-
- local buffer = fh:read("*a")
- fh:close()
- return buffer
-end
-
---- Execute command and invoke given callback for each readed line
--- @param command String containing the command to execute
--- @param callback Function to call back for each line
--- @return Always true
-function io.execl(command, callback)
- local ln
- local fh = _io.popen( "%s %s %q" %{ AST_BIN, AST_FLAGS, command }, "r" )
- assert(fh, "Failed to invoke asterisk")
-
- repeat
- ln = fh:read("*l")
- callback(ln)
- until not ln
-
- fh:close()
- return true
-end
-
---- Execute command and return an iterator that returns one line per invokation
--- @param command String containing the command to execute
--- @return Iterator function
-function io.execi(command)
- local fh = _io.popen( "%s %s %q" %{ AST_BIN, AST_FLAGS, command }, "r" )
- assert(fh, "Failed to invoke asterisk")
-
- return function()
- local ln = fh:read("*l")
- if not ln then fh:close() end
- return ln
- end
-end
-
-
---- LuCI Asterisk - core status
-core = luci.util.class()
-
---- Retrive version string.
--- @return String containing the reported asterisk version
-function core.version(self)
- local version = io.exec("core show version")
- return version:gsub(" *\n", "")
-end
-
-
---- LuCI Asterisk - SIP information.
--- @type module
-sip = luci.util.class()
-
---- Get a list of known SIP peers
--- @return Table containing each SIP peer
-function sip.peers(self)
- local head = false
- local peers = { }
-
- for line in io.execi("sip show peers") do
- if not head then
- head = true
- elseif not line:match(" sip peers ") then
- local online, delay, id, uid
- local name, host, dyn, nat, acl, port, status =
- line:match("(.-) +(.-) +([D ]) ([N ]) (.) (%d+) +(.+)")
-
- if host == '(Unspecified)' then host = nil end
- if port == '0' then port = nil else port = tonumber(port) end
-
- dyn = ( dyn == 'D' and true or false )
- nat = ( nat == 'N' and true or false )
- acl = ( acl ~= ' ' and true or false )
-
- online, delay = status:match("(OK) %((%d+) ms%)")
-
- if online == 'OK' then
- online = true
- delay = tonumber(delay)
- elseif status ~= 'Unmonitored' then
- online = false
- delay = 0
- else
- online = nil
- delay = 0
- end
-
- id, uid = name:match("(.+)/(.+)")
-
- if not ( id and uid ) then
- id = name .. "..."
- uid = nil
- end
-
- peers[#peers+1] = {
- online = online,
- delay = delay,
- name = id,
- user = uid,
- dynamic = dyn,
- nat = nat,
- acl = acl,
- host = host,
- port = port
- }
- end
- end
-
- return peers
-end
-
---- Get informations of given SIP peer
--- @param peer String containing the name of the SIP peer
-function sip.peer(peer)
- local info = { }
- local keys = { }
-
- for line in io.execi("sip show peer " .. peer) do
- if #line > 0 then
- local key, val = line:match("(.-) *: +(.*)")
- if key and val then
-
- key = key:gsub("^ +",""):gsub(" +$", "")
- val = val:gsub("^ +",""):gsub(" +$", "")
-
- if key == "* Name" then
- key = "Name"
- elseif key == "Addr->IP" then
- info.address, info.port = val:match("(.+) Port (.+)")
- info.port = tonumber(info.port)
- elseif key == "Status" then
- info.online, info.delay = val:match("(OK) %((%d+) ms%)")
- if info.online == 'OK' then
- info.online = true
- info.delay = tonumber(info.delay)
- elseif status ~= 'Unmonitored' then
- info.online = false
- info.delay = 0
- else
- info.online = nil
- info.delay = 0
- end
- end
-
- if val == 'Yes' or val == 'yes' or val == '<Set>' then
- val = true
- elseif val == 'No' or val == 'no' then
- val = false
- elseif val == '<Not set>' or val == '(none)' then
- val = nil
- end
-
- keys[#keys+1] = key
- info[key] = val
- end
- end
- end
-
- return info, keys
-end
-
-
---- LuCI Asterisk - Internal helpers
--- @type module
-tools = luci.util.class()
-
---- Convert given value to a list of tokens. Split by white space.
--- @param val String or table value
--- @return Table containing tokens
-function tools.parse_list(v)
- local tokens = { }
-
- v = type(v) == "table" and v or { v }
- for _, v in ipairs(v) do
- if type(v) == "string" then
- for v in v:gmatch("(%S+)") do
- tokens[#tokens+1] = v
- end
- end
- end
-
- return tokens
-end
-
---- Convert given list to a collection of hyperlinks
--- @param list Table of tokens
--- @param url String pattern or callback function to construct urls (optional)
--- @param sep String containing the seperator (optional, default is ", ")
--- @return String containing the html fragment
-function tools.hyperlinks(list, url, sep)
- local html
-
- local function mkurl(p, t)
- if type(p) == "string" then
- return p:format(t)
- elseif type(p) == "function" then
- return p(t)
- else
- return '#'
- end
- end
-
- list = list or { }
- url = url or "%s"
- sep = sep or ", "
-
- for _, token in ipairs(list) do
- html = ( html and html .. sep or '' ) ..
- '<a href="%s">%s</a>' %{ mkurl(url, token), token }
- end
-
- return html or ''
-end
-
-
---- LuCI Asterisk - International Direct Dialing Prefixes
--- @type module
-idd = luci.util.class()
-
---- Lookup the country name for the given IDD code.
--- @param country String containing IDD code
--- @return String containing the country name
-function idd.country(c)
- for _, v in ipairs(cc_idd.CC_IDD) do
- if type(v[3]) == "table" then
- for _, v2 in ipairs(v[3]) do
- if v2 == tostring(c) then
- return v[1]
- end
- end
- elseif v[3] == tostring(c) then
- return v[1]
- end
- end
-end
-
---- Lookup the country code for the given IDD code.
--- @param country String containing IDD code
--- @return Table containing the country code(s)
-function idd.cc(c)
- for _, v in ipairs(cc_idd.CC_IDD) do
- if type(v[3]) == "table" then
- for _, v2 in ipairs(v[3]) do
- if v2 == tostring(c) then
- return type(v[2]) == "table"
- and v[2] or { v[2] }
- end
- end
- elseif v[3] == tostring(c) then
- return type(v[2]) == "table"
- and v[2] or { v[2] }
- end
- end
-end
-
---- Lookup the IDD code(s) for the given country.
--- @param idd String containing the country name
--- @return Table containing the IDD code(s)
-function idd.idd(c)
- for _, v in ipairs(cc_idd.CC_IDD) do
- if v[1]:lower():match(c:lower()) then
- return type(v[3]) == "table"
- and v[3] or { v[3] }
- end
- end
-end
-
---- Populate given CBI field with IDD codes.
--- @param field CBI option object
--- @return (nothing)
-function idd.cbifill(o)
- for i, v in ipairs(cc_idd.CC_IDD) do
- o:value("_%i" % i, util.pcdata(v[1]))
- end
-
- o.formvalue = function(...)
- local val = luci.cbi.Value.formvalue(...)
- if val:sub(1,1) == "_" then
- val = tonumber((val:gsub("^_", "")))
- if val then
- return type(cc_idd.CC_IDD[val][3]) == "table"
- and cc_idd.CC_IDD[val][3] or { cc_idd.CC_IDD[val][3] }
- end
- end
- return val
- end
-
- o.cfgvalue = function(...)
- local val = luci.cbi.Value.cfgvalue(...)
- if val then
- val = tools.parse_list(val)
- for i, v in ipairs(cc_idd.CC_IDD) do
- if type(v[3]) == "table" then
- if v[3][1] == val[1] then
- return "_%i" % i
- end
- else
- if v[3] == val[1] then
- return "_%i" % i
- end
- end
- end
- end
- return val
- end
-end
-
-
---- LuCI Asterisk - Country Code Prefixes
--- @type module
-cc = luci.util.class()
-
---- Lookup the country name for the given CC code.
--- @param country String containing CC code
--- @return String containing the country name
-function cc.country(c)
- for _, v in ipairs(cc_idd.CC_IDD) do
- if type(v[2]) == "table" then
- for _, v2 in ipairs(v[2]) do
- if v2 == tostring(c) then
- return v[1]
- end
- end
- elseif v[2] == tostring(c) then
- return v[1]
- end
- end
-end
-
---- Lookup the international dialing code for the given CC code.
--- @param cc String containing CC code
--- @return String containing IDD code
-function cc.idd(c)
- for _, v in ipairs(cc_idd.CC_IDD) do
- if type(v[2]) == "table" then
- for _, v2 in ipairs(v[2]) do
- if v2 == tostring(c) then
- return type(v[3]) == "table"
- and v[3] or { v[3] }
- end
- end
- elseif v[2] == tostring(c) then
- return type(v[3]) == "table"
- and v[3] or { v[3] }
- end
- end
-end
-
---- Lookup the CC code(s) for the given country.
--- @param country String containing the country name
--- @return Table containing the CC code(s)
-function cc.cc(c)
- for _, v in ipairs(cc_idd.CC_IDD) do
- if v[1]:lower():match(c:lower()) then
- return type(v[2]) == "table"
- and v[2] or { v[2] }
- end
- end
-end
-
---- Populate given CBI field with CC codes.
--- @param field CBI option object
--- @return (nothing)
-function cc.cbifill(o)
- for i, v in ipairs(cc_idd.CC_IDD) do
- o:value("_%i" % i, util.pcdata(v[1]))
- end
-
- o.formvalue = function(...)
- local val = luci.cbi.Value.formvalue(...)
- if val:sub(1,1) == "_" then
- val = tonumber((val:gsub("^_", "")))
- if val then
- return type(cc_idd.CC_IDD[val][2]) == "table"
- and cc_idd.CC_IDD[val][2] or { cc_idd.CC_IDD[val][2] }
- end
- end
- return val
- end
-
- o.cfgvalue = function(...)
- local val = luci.cbi.Value.cfgvalue(...)
- if val then
- val = tools.parse_list(val)
- for i, v in ipairs(cc_idd.CC_IDD) do
- if type(v[2]) == "table" then
- if v[2][1] == val[1] then
- return "_%i" % i
- end
- else
- if v[2] == val[1] then
- return "_%i" % i
- end
- end
- end
- end
- return val
- end
-end
-
-
---- LuCI Asterisk - Dialzone
--- @type module
-dialzone = luci.util.class()
-
---- Parse a dialzone section
--- @param zone Table containing the zone info
--- @return Table with parsed information
-function dialzone.parse(z)
- if z['.name'] then
- return {
- trunks = tools.parse_list(z.uses),
- name = z['.name'],
- description = z.description or z['.name'],
- addprefix = z.addprefix,
- matches = tools.parse_list(z.match),
- intlmatches = tools.parse_list(z.international),
- countrycode = z.countrycode,
- localzone = z.localzone,
- localprefix = z.localprefix
- }
- end
-end
-
---- Get a list of known dial zones
--- @return Associative table of zones and table of zone names
-function dialzone.zones()
- local zones = { }
- local znames = { }
- uci:foreach("asterisk", "dialzone",
- function(z)
- zones[z['.name']] = dialzone.parse(z)
- znames[#znames+1] = z['.name']
- end)
- return zones, znames
-end
-
---- Get a specific dial zone
--- @param name Name of the dial zone
--- @return Table containing zone information
-function dialzone.zone(n)
- local zone
- uci:foreach("asterisk", "dialzone",
- function(z)
- if z['.name'] == n then
- zone = dialzone.parse(z)
- end
- end)
- return zone
-end
-
---- Find uci section hash for given zone number
--- @param idx Zone number
--- @return String containing the uci hash pointing to the section
-function dialzone.ucisection(i)
- local hash
- local index = 1
- i = tonumber(i)
- uci:foreach("asterisk", "dialzone",
- function(z)
- if not hash and index == i then
- hash = z['.name']
- end
- index = index + 1
- end)
- return hash
-end
-
-
---- LuCI Asterisk - Voicemailbox
--- @type module
-voicemail = luci.util.class()
-
---- Parse a voicemail section
--- @param zone Table containing the mailbox info
--- @return Table with parsed information
-function voicemail.parse(z)
- if z.number and #z.number > 0 then
- local v = {
- id = '%s@%s' %{ z.number, z.context or 'default' },
- number = z.number,
- context = z.context or 'default',
- name = z.name or z['.name'] or 'OpenWrt',
- zone = z.zone or 'homeloc',
- password = z.password or '0000',
- email = z.email or '',
- page = z.page or '',
- dialplans = { }
- }
-
- uci:foreach("asterisk", "dialplanvoice",
- function(s)
- if s.dialplan and #s.dialplan > 0 and
- s.voicebox == v.number
- then
- v.dialplans[#v.dialplans+1] = s.dialplan
- end
- end)
-
- return v
- end
-end
-
---- Get a list of known voicemail boxes
--- @return Associative table of boxes and table of box numbers
-function voicemail.boxes()
- local vboxes = { }
- local vnames = { }
- uci:foreach("asterisk", "voicemail",
- function(z)
- local v = voicemail.parse(z)
- if v then
- local n = '%s@%s' %{ v.number, v.context }
- vboxes[n] = v
- vnames[#vnames+1] = n
- end
- end)
- return vboxes, vnames
-end
-
---- Get a specific voicemailbox
--- @param number Number of the voicemailbox
--- @return Table containing mailbox information
-function voicemail.box(n)
- local box
- n = n:gsub("@.+$","")
- uci:foreach("asterisk", "voicemail",
- function(z)
- if z.number == tostring(n) then
- box = voicemail.parse(z)
- end
- end)
- return box
-end
-
---- Find all voicemailboxes within the given dialplan
--- @param plan Dialplan name or table
--- @return Associative table containing extensions mapped to mailbox info
-function voicemail.in_dialplan(p)
- local plan = type(p) == "string" and p or p.name
- local boxes = { }
- uci:foreach("asterisk", "dialplanvoice",
- function(s)
- if s.extension and #s.extension > 0 and s.dialplan == plan then
- local box = voicemail.box(s.voicebox)
- if box then
- boxes[s.extension] = box
- end
- end
- end)
- return boxes
-end
-
---- Remove voicemailbox and associated extensions from config
--- @param box Voicemailbox number or table
--- @param ctx UCI context to use (optional)
--- @return Boolean indicating success
-function voicemail.remove(v, ctx)
- ctx = ctx or uci
- local box = type(v) == "string" and v or v.number
- local ok1 = ctx:delete_all("asterisk", "voicemail", {number=box})
- local ok2 = ctx:delete_all("asterisk", "dialplanvoice", {voicebox=box})
- return ( ok1 or ok2 ) and true or false
-end
-
-
---- LuCI Asterisk - MeetMe Conferences
--- @type module
-meetme = luci.util.class()
-
---- Parse a meetme section
--- @param room Table containing the room info
--- @return Table with parsed information
-function meetme.parse(r)
- if r.room and #r.room > 0 then
- local v = {
- room = r.room,
- pin = r.pin or '',
- adminpin = r.adminpin or '',
- description = r._description or '',
- dialplans = { }
- }
-
- uci:foreach("asterisk", "dialplanmeetme",
- function(s)
- if s.dialplan and #s.dialplan > 0 and s.room == v.room then
- v.dialplans[#v.dialplans+1] = s.dialplan
- end
- end)
-
- return v
- end
-end
-
---- Get a list of known meetme rooms
--- @return Associative table of rooms and table of room numbers
-function meetme.rooms()
- local mrooms = { }
- local mnames = { }
- uci:foreach("asterisk", "meetme",
- function(r)
- local v = meetme.parse(r)
- if v then
- mrooms[v.room] = v
- mnames[#mnames+1] = v.room
- end
- end)
- return mrooms, mnames
-end
-
---- Get a specific meetme room
--- @param number Number of the room
--- @return Table containing room information
-function meetme.room(n)
- local room
- uci:foreach("asterisk", "meetme",
- function(r)
- if r.room == tostring(n) then
- room = meetme.parse(r)
- end
- end)
- return room
-end
-
---- Find all meetme rooms within the given dialplan
--- @param plan Dialplan name or table
--- @return Associative table containing extensions mapped to room info
-function meetme.in_dialplan(p)
- local plan = type(p) == "string" and p or p.name
- local rooms = { }
- uci:foreach("asterisk", "dialplanmeetme",
- function(s)
- if s.extension and #s.extension > 0 and s.dialplan == plan then
- local room = meetme.room(s.room)
- if room then
- rooms[s.extension] = room
- end
- end
- end)
- return rooms
-end
-
---- Remove meetme room and associated extensions from config
--- @param room Voicemailbox number or table
--- @param ctx UCI context to use (optional)
--- @return Boolean indicating success
-function meetme.remove(v, ctx)
- ctx = ctx or uci
- local room = type(v) == "string" and v or v.number
- local ok1 = ctx:delete_all("asterisk", "meetme", {room=room})
- local ok2 = ctx:delete_all("asterisk", "dialplanmeetme", {room=room})
- return ( ok1 or ok2 ) and true or false
-end
-
-
---- LuCI Asterisk - Dialplan
--- @type module
-dialplan = luci.util.class()
-
---- Parse a dialplan section
--- @param plan Table containing the plan info
--- @return Table with parsed information
-function dialplan.parse(z)
- if z['.name'] then
- local plan = {
- zones = { },
- name = z['.name'],
- description = z.description or z['.name']
- }
-
- -- dialzones
- for _, name in ipairs(tools.parse_list(z.include)) do
- local zone = dialzone.zone(name)
- if zone then
- plan.zones[#plan.zones+1] = zone
- end
- end
-
- -- voicemailboxes
- plan.voicemailboxes = voicemail.in_dialplan(plan)
-
- -- meetme conferences
- plan.meetmerooms = meetme.in_dialplan(plan)
-
- return plan
- end
-end
-
---- Get a list of known dial plans
--- @return Associative table of plans and table of plan names
-function dialplan.plans()
- local plans = { }
- local pnames = { }
- uci:foreach("asterisk", "dialplan",
- function(p)
- plans[p['.name']] = dialplan.parse(p)
- pnames[#pnames+1] = p['.name']
- end)
- return plans, pnames
-end
-
---- Get a specific dial plan
--- @param name Name of the dial plan
--- @return Table containing plan information
-function dialplan.plan(n)
- local plan
- uci:foreach("asterisk", "dialplan",
- function(p)
- if p['.name'] == n then
- plan = dialplan.parse(p)
- end
- end)
- return plan
-end
diff --git a/applications/luci-asterisk/luasrc/asterisk/cc_idd.lua b/applications/luci-asterisk/luasrc/asterisk/cc_idd.lua
deleted file mode 100644
index b209b11397..0000000000
--- a/applications/luci-asterisk/luasrc/asterisk/cc_idd.lua
+++ /dev/null
@@ -1,254 +0,0 @@
---[[
-LuCI - Asterisk - International Direct Dialing Prefixes and Country Codes
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-]]--
-
-module "luci.asterisk.cc_idd"
-
-CC_IDD = {
--- Country, CC, IDD
- { "Afghanistan", "93", "00" },
- { "Albania", "355", "00" },
- { "Algeria", "213", "00" },
- { "American Samoa", "684", "00" },
- { "Andorra", "376", "00" },
- { "Angola", "244", "00" },
- { "Anguilla", "264", "011" },
- { "Antarctica", "672", "" },
- { "Antigua", "268", "011" },
- { "Argentina", "54", "00" },
- { "Armenia", "374", "00" },
- { "Aruba", "297", "00" },
- { "Ascension Island", "247", "00" },
- { "Australia", "61", "0011" },
- { "Austria", "43", "00" },
- { "Azberbaijan", "994", "00" },
- { "Bahamas", "242", "011" },
- { "Bahrain", "973", "00" },
- { "Bangladesh", "880", "00" },
- { "Barbados", "246", "011" },
- { "Barbuda", "268", "011" },
- { "Belarus", "375", "810" },
- { "Belgium", "32", "00" },
- { "Belize", "501", "00" },
- { "Benin", "229", "00" },
- { "Bermuda", "441", "011" },
- { "Bhutan", "975", "00" },
- { "Bolivia", "591", "00" },
- { "Bosnia", "387", "00" },
- { "Botswana", "267", "00" },
- { "Brazil", "55", "00" },
- { "British Virgin Islands", "284", "011" },
- { "Brunei", "673", "00" },
- { "Bulgaria", "359", "00" },
- { "Burkina Faso", "226", "00" },
- { "Burma (Myanmar)", "95", "00" },
- { "Burundi", "257", "00" },
- { "Cambodia", "855", "001" },
- { "Cameroon", "237", "00" },
- { "Canada", "1", "011" },
- { "Cape Verde Islands", "238", "0" },
- { "Cayman Islands", "345", "011" },
- { "Central African Rep.", "236", "00" },
- { "Chad", "235", "15" },
- { "Chile", "56", "00" },
- { "China", "86", "00" },
- { "Christmas Island", "61", "0011" },
- { "Cocos Islands", "61", "0011" },
- { "Colombia", "57", "00" },
- { "Comoros", "269", "00" },
- { "Congo", "242", "00" },
- { "Congo, Dem. Rep. of", "243", "00" },
- { "Cook Islands", "682", "00" },
- { "Costa Rica", "506", "00" },
- { "Croatia", "385", "00" },
- { "Cuba", "53", "119" },
- { "Cyprus", "357", "00" },
- { "Czech Republic", "420", "00" },
- { "Denmark", "45", "00" },
- { "Diego Garcia", "246", "00" },
- { "Djibouti", "253", "00" },
- { "Dominica", "767", "011" },
- { "Dominican Rep.", "809", "011" },
- { "Ecuador", "593", "00" },
- { "Egypt", "20", "00" },
- { "El Salvador", "503", "00" },
- { "Equatorial Guinea", "240", "00" },
- { "Eritrea", "291", "00" },
- { "Estonia", "372", "00" },
- { "Ethiopia", "251", "00" },
- { "Faeroe Islands", "298", "00" },
- { "Falkland Islands", "500", "00" },
- { "Fiji Islands", "679", "00" },
- { "Finland", "358", "00" },
- { "France", "33", "00" },
- { "French Antilles", "596", "00" },
- { "French Guiana", "594", "00" },
- { "French Polynesia", "689", "00" },
- { "Gabon", "241", "00" },
- { "Gambia", "220", "00" },
- { "Georgia", "995", "810" },
- { "Germany", "49", "00" },
- { "Ghana", "233", "00" },
- { "Gibraltar", "350", "00" },
- { "Greece", "30", "00" },
- { "Greenland", "299", "00" },
- { "Grenada", "473", "011" },
- { "Guadeloupe", "590", "00" },
- { "Guam", "671", "011" },
- { "Guantanamo Bay", "5399", "00" },
- { "Guatemala", "502", "00" },
- { "Guinea", "224", "00" },
- { "Guinea Bissau", "245", "00" },
- { "Guyana", "592", "001" },
- { "Haiti", "509", "00" },
- { "Honduras", "504", "00" },
- { "Hong Kong", "852", "001" },
- { "Hungary", "36", "00" },
- { "Iceland", "354", "00" },
- { "India", "91", "00" },
- { "Indonesia", "62", { "001", "008" } },
- { "Iran", "98", "00" },
- { "Iraq", "964", "00" },
- { "Ireland", "353", "00" },
- { "Israel", "972", "00" },
- { "Italy", "39", "00" },
- { "Ivory Coast", "225", "00" },
- { "Jamaica", "876", "011" },
- { "Japan", "81", "001" },
- { "Jordan", "962", "00" },
- { "Kazakhstan", "7", "810" },
- { "Kenya", "254", "000" },
- { "Kiribati", "686", "00" },
- { "Korea, North", "850", "00" },
- { "Korea, South", "82", "001" },
- { "Kuwait", "965", "00" },
- { "Kyrgyzstan", "996", "00" },
- { "Laos", "856", "00" },
- { "Latvia", "371", "00" },
- { "Lebanon", "961", "00" },
- { "Lesotho", "266", "00" },
- { "Liberia", "231", "00" },
- { "Libya", "218", "00" },
- { "Liechtenstein", "423", "00" },
- { "Lithuania", "370", "00" },
- { "Luxembourg", "352", "00" },
- { "Macau", "853", "00" },
- { "Macedonia", "389", "00" },
- { "Madagascar", "261", "00" },
- { "Malawi", "265", "00" },
- { "Malaysia", "60", "00" },
- { "Maldives", "960", "00" },
- { "Mali", "223", "00" },
- { "Malta", "356", "00" },
- { "Mariana Islands", "670", "011" },
- { "Marshall Islands", "692", "011" },
- { "Martinique", "596", "00" },
- { "Mauritania", "222", "00" },
- { "Mauritius", "230", "00" },
- { "Mayotte Islands", "269", "00" },
- { "Mexico", "52", "00" },
- { "Micronesia", "691", "011" },
- { "Midway Island", "808", "011" },
- { "Moldova", "373", "00" },
- { "Monaco", "377", "00" },
- { "Mongolia", "976", "001" },
- { "Montserrat", "664", "011" },
- { "Morocco", "212", "00" },
- { "Mozambique", "258", "00" },
- { "Myanmar (Burma)", "95", "00" },
- { "Namibia", "264", "00" },
- { "Nauru", "674", "00" },
- { "Nepal", "977", "00" },
- { "Netherlands", "31", "00" },
- { "Netherlands Antilles", "599", "00" },
- { "Nevis", "869", "011" },
- { "New Caledonia", "687", "00" },
- { "New Zealand", "64", "00" },
- { "Nicaragua", "505", "00" },
- { "Niger", "227", "00" },
- { "Nigeria", "234", "009" },
- { "Niue", "683", "00" },
- { "Norfolk Island", "672", "00" },
- { "Norway", "47", "00" },
- { "Oman", "968", "00" },
- { "Pakistan", "92", "00" },
- { "Palau", "680", "011" },
- { "Palestine", "970", "00" },
- { "Panama", "507", "00" },
- { "Papua New Guinea", "675", "05" },
- { "Paraguay", "595", "002" },
- { "Peru", "51", "00" },
- { "Philippines", "63", "00" },
- { "Poland", "48", "00" },
- { "Portugal", "351", "00" },
- { "Puerto Rico", { "787", "939" }, "011" },
- { "Qatar", "974", "00" },
- { "Reunion Island", "262", "00" },
- { "Romania", "40", "00" },
- { "Russia", "7", "810" },
- { "Rwanda", "250", "00" },
- { "St. Helena", "290", "00" },
- { "St. Kitts", "869", "011" },
- { "St. Lucia", "758", "011" },
- { "St. Perre & Miquelon", "508", "00" },
- { "St. Vincent", "784", "011" },
- { "San Marino", "378", "00" },
- { "Sao Tome & Principe", "239", "00" },
- { "Saudi Arabia", "966", "00" },
- { "Senegal", "221", "00" },
- { "Serbia", "381", "99" },
- { "Seychelles", "248", "00" },
- { "Sierra Leone", "232", "00" },
- { "Singapore", "65", "001" },
- { "Slovakia", "421", "00" },
- { "Slovenia", "386", "00" },
- { "Solomon Islands", "677", "00" },
- { "Somalia", "252", "00" },
- { "South Africa", "27", "09" },
- { "Spain", "34", "00" },
- { "Sri Lanka", "94", "00" },
- { "Sudan", "249", "00" },
- { "Suriname", "597", "00" },
- { "Swaziland", "268", "00" },
- { "Sweden", "46", "00" },
- { "Switzerland", "41", "00" },
- { "Syria", "963", "00" },
- { "Taiwan", "886", "002" },
- { "Tajikistan", "992", "810" },
- { "Tanzania", "255", "00" },
- { "Thailand", "66", "001" },
- { "Togo", "228", "00" },
- { "Tonga", "676", "00" },
- { "Trinidad & Tobago", "868", "011" },
- { "Tunisia", "216", "00" },
- { "Turkey", "90", "00" },
- { "Turkmenistan", "993", "810" },
- { "Turks & Caicos", "649", "011" },
- { "Tuvalu", "688", "00" },
- { "Uganda", "256", "000" },
- { "Ukraine", "380", "810" },
- { "United Arab Emirates", "971", "00" },
- { "United Kingdom", "44", "00" },
- { "Uruguay", "598", "00" },
- { "USA", "1", "011" },
- { "US Virgin Islands", "340", "011" },
- { "Uzbekistan", "998", "810" },
- { "Vanuatu", "678", "00" },
- { "Vatican City", "39", "00" },
- { "Venezuela", "58", "00" },
- { "Vietnam", "84", "00" },
- { "Wake Island", "808", "00" },
- { "Wallis & Futuna", "681", "19" },
- { "Western Samoa", "685", "00" },
- { "Yemen", "967", "00" },
- { "Yugoslavia", "381", "99" },
- { "Zambia", "260", "00" },
- { "Zimbabwe", "263", "00" }
-}
diff --git a/applications/luci-asterisk/luasrc/controller/asterisk.lua b/applications/luci-asterisk/luasrc/controller/asterisk.lua
deleted file mode 100644
index ab053397da..0000000000
--- a/applications/luci-asterisk/luasrc/controller/asterisk.lua
+++ /dev/null
@@ -1,205 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-module("luci.controller.asterisk", package.seeall)
-
-function index()
-
- entry({"admin", "services", "asterisk"}, cbi("asterisk"), "Asterisk", 80).i18n = "asterisk"
-
- entry({"admin", "services", "asterisk", "voice"}, cbi("asterisk-voice"), "Voice Functions", 1)
- entry({"admin", "services", "asterisk", "meetme"}, cbi("asterisk-meetme"), "Meetme Conferences", 2)
-
- entry({"admin", "services", "asterisk", "iax-conns"}, cbi("asterisk-iax-connections"), "IAX Connections", 3)
- entry({"admin", "services", "asterisk", "sip-conns"}, cbi("asterisk-sip-connections"), "SIP Connections", 4)
-
- entry({"admin", "services", "asterisk", "dialplans"}, cbi("asterisk-dialplans"), "Dial Plans", 5)
-
- entry({"admin", "services", "asterisk", "mod"}, cbi("asterisk-mod-app"), "Modules", 4)
- entry({"admin", "services", "asterisk", "mod", "app"}, cbi("asterisk-mod-app"), "Applications", 1)
- entry({"admin", "services", "asterisk", "mod", "cdr"}, cbi("asterisk-mod-cdr"), "Call Detail Records", 2)
- entry({"admin", "services", "asterisk", "mod", "chan"}, cbi("asterisk-mod-chan"), "Channels", 3)
- entry({"admin", "services", "asterisk", "mod", "codec"}, cbi("asterisk-mod-codec"), "Codecs", 4)
- entry({"admin", "services", "asterisk", "mod", "format"}, cbi("asterisk-mod-format"), "Format", 5)
- entry({"admin", "services", "asterisk", "mod", "func"}, cbi("asterisk-mod-func"), "Functions", 6)
- entry({"admin", "services", "asterisk", "mod", "pbx"}, cbi("asterisk-mod-pbx"), "PBX", 7)
- entry({"admin", "services", "asterisk", "mod", "res"}, cbi("asterisk-mod-res"), "Resources", 8)
- entry({"admin", "services", "asterisk", "mod", "res", "feature"},
- cbi("asterisk-mod-res-feature"), "Feature Module Configuration", 9 )
-
-
- entry({"admin", "asterisk"}, cbi("asterisk/main"), "Asterisk", 99).i18n = "asterisk"
-
- entry({"admin", "asterisk", "phones"}, cbi("asterisk/phones"), "Phones", 1)
- entry({"admin", "asterisk", "phones", "sip"}, cbi("asterisk/phone_sip"), nil, 1).leaf = true
- --entry({"admin", "asterisk", "phones", "exten"}, cbi("asterisk/phone_exten"), "Extensions", 2).leaf = true
-
- entry({"admin", "asterisk", "trunks"}, cbi("asterisk/trunks"), "Trunks", 2)
- entry({"admin", "asterisk", "trunks", "sip"}, cbi("asterisk/trunk_sip"), nil, 1).leaf = true
-
- entry({"admin", "asterisk", "voicemail"}, cbi("asterisk/voicemail"), "Voicemail", 3)
- entry({"admin", "asterisk", "voicemail", "mailboxes"}, cbi("asterisk/voicemail"), "Mailboxes", 1)
- entry({"admin", "asterisk", "voicemail", "settings"}, cbi("asterisk/voicemail_settings"), "Settings", 2)
-
- entry({"admin", "asterisk", "meetme"}, cbi("asterisk/meetme"), "MeetMe", 4)
- entry({"admin", "asterisk", "meetme", "rooms"}, cbi("asterisk/meetme"), "Rooms", 1)
- entry({"admin", "asterisk", "meetme", "settings"}, cbi("asterisk/meetme_settings"), "Settings", 2)
-
- entry({"admin", "asterisk", "dialplans"}, call("handle_dialplan"), "Call Routing", 5)
- entry({"admin", "asterisk", "dialplans", "out"}, cbi("asterisk/dialplan_out"), nil, 1).leaf = true
- entry({"admin", "asterisk", "dialplans", "zones"}, call("handle_dialzones"), "Dial Zones", 2).leaf = true
-
-end
-
-
-function handle_dialplan()
- local uci = luci.model.uci.cursor()
- local ast = require "luci.asterisk"
- local err = false
-
- for k, v in pairs(luci.http.formvaluetable("delzone")) do
- local plan = ast.dialplan.plan(k)
- if #v > 0 and plan then
- local newinc = { }
-
- for _, z in ipairs(plan.zones) do
- if z.name ~= v then
- newinc[#newinc+1] = z.name
- end
- end
-
- uci:delete("asterisk", plan.name, "include")
-
- if #newinc > 0 then
- uci:set("asterisk", plan.name, "include", newinc)
- end
- end
- end
-
- for k, v in pairs(luci.http.formvaluetable("addzone")) do
- local plan = ast.dialplan.plan(k)
- local zone = ast.dialzone.zone(v)
- if #v > 0 and plan and zone then
- local newinc = { zone.name }
-
- for _, z in ipairs(plan.zones) do
- newinc[#newinc+1] = z.name
- end
-
- uci:delete("asterisk", plan.name, "include")
-
- if #newinc > 0 then
- uci:set("asterisk", plan.name, "include", newinc)
- end
- end
- end
-
- for k, v in pairs(luci.http.formvaluetable("delvbox")) do
- local plan = ast.dialplan.plan(k)
- if #v > 0 and plan then
- uci:delete_all("asterisk", "dialplanvoice",
- { extension=v, dialplan=plan.name })
- end
- end
-
- for k, v in pairs(luci.http.formvaluetable("addvbox")) do
- local plan = ast.dialplan.plan(k)
- local vbox = ast.voicemail.box(v)
- if plan and vbox then
- local vext = luci.http.formvalue("addvboxext.%s" % plan.name)
- vext = ( vext and #vext > 0 ) and vext or vbox.number
- uci:section("asterisk", "dialplanvoice", nil, {
- dialplan = plan.name,
- extension = vext,
- voicebox = vbox.number,
- voicecontext = vbox.context
- })
- end
- end
-
- for k, v in pairs(luci.http.formvaluetable("delmeetme")) do
- local plan = ast.dialplan.plan(k)
- if #v > 0 and plan then
- uci:delete_all("asterisk", "dialplanmeetme",
- { extension=v, dialplan=plan.name })
- end
- end
-
- for k, v in pairs(luci.http.formvaluetable("addmeetme")) do
- local plan = ast.dialplan.plan(k)
- local meetme = ast.meetme.room(v)
- if plan and meetme then
- local mext = luci.http.formvalue("addmeetmeext.%s" % plan.name)
- mext = ( mext and #mext > 0 ) and mext or meetme.room
- uci:section("asterisk", "dialplanmeetme", nil, {
- dialplan = plan.name,
- extension = mext,
- room = meetme.room
- })
- end
- end
-
- local aname = luci.http.formvalue("addplan")
- if aname and #aname > 0 then
- if aname:match("^[a-zA-Z0-9_]+$") then
- uci:section("asterisk", "dialplan", aname, { })
- else
- err = true
- end
- end
-
- local dname = luci.http.formvalue("delplan")
- if dname and #dname > 0 then
- if uci:get("asterisk", dname) == "dialplan" then
- uci:delete("asterisk", dname)
- uci:delete_all("asterisk", "dialplanvoice", { dialplan=dname })
- uci:delete_all("asterisk", "dialplanmeetme", { dialplan=dname })
- end
- end
-
- uci:save("asterisk")
- ast.uci_resync()
-
- luci.template.render("asterisk/dialplans", { create_error = err })
-end
-
-function handle_dialzones()
- local ast = require "luci.asterisk"
- local uci = luci.model.uci.cursor()
- local err = false
-
- if luci.http.formvalue("newzone") then
- local name = luci.http.formvalue("newzone_name")
- if name and name:match("^[a-zA-Z0-9_]+$") then
- uci:section("asterisk", "dialzone", name, {
- uses = ast.tools.parse_list(luci.http.formvalue("newzone_uses") or {}),
- match = ast.tools.parse_list(luci.http.formvalue("newzone_match") or {})
- })
- uci:save("asterisk")
- else
- err = true
- end
- end
-
- if luci.http.formvalue("delzone") then
- local name = luci.http.formvalue("delzone")
- if uci:get("asterisk", name) == "dialzone" then
- uci:delete("asterisk", name)
- uci:save("asterisk")
- end
- end
-
- luci.template.render("asterisk/dialzones", { create_error = err })
-end
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-dialplans.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-dialplans.lua
deleted file mode 100644
index 4e4dce06bc..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-dialplans.lua
+++ /dev/null
@@ -1,102 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-dialplan = cbimap:section(TypedSection, "dialplan", "Section dialplan", "")
-dialplan.addremove = true
-dialplan.dynamic = true
-
-include = dialplan:option(MultiValue, "include", "Include zones and plans", "")
-cbimap.uci:foreach( "asterisk", "dialplan", function(s) include:value(s['.name']) end )
-cbimap.uci:foreach( "asterisk", "dialzone", function(s) include:value(s['.name']) end )
-
-dialplanexten = cbimap:section(TypedSection, "dialplanexten", "Dialplan Extension", "")
-dialplanexten.anonymous = true
-dialplanexten.addremove = true
-dialplanexten.dynamic = true
-
-
-dialplangeneral = cbimap:section(TypedSection, "dialplangeneral", "Dialplan General Options", "")
-dialplangeneral.anonymous = true
-dialplangeneral.addremove = true
-
-allowtransfer = dialplangeneral:option(Flag, "allowtransfer", "Allow transfer", "")
-allowtransfer.rmempty = true
-
-canreinvite = dialplangeneral:option(ListValue, "canreinvite", "Reinvite/redirect media connections", "")
-canreinvite:value("yes", "Yes")
-canreinvite:value("nonat", "Yes when not behind NAT")
-canreinvite:value("update", "Use UPDATE rather than INVITE for path redirection")
-canreinvite:value("no", "No")
-canreinvite.rmempty = true
-
-clearglobalvars = dialplangeneral:option(Flag, "clearglobalvars", "Clear global vars", "")
-clearglobalvars.rmempty = true
-
-
-dialplangoto = cbimap:section(TypedSection, "dialplangoto", "Dialplan Goto", "")
-dialplangoto.anonymous = true
-dialplangoto.addremove = true
-dialplangoto.dynamic = true
-
-
-dialplanmeetme = cbimap:section(TypedSection, "dialplanmeetme", "Dialplan Conference", "")
-dialplanmeetme.anonymous = true
-dialplanmeetme.addremove = true
-dialplanmeetme.dynamic = true
-
-
-dialplansaytime = cbimap:section(TypedSection, "dialplansaytime", "Dialplan Time", "")
-dialplansaytime.anonymous = true
-dialplansaytime.addremove = true
-dialplansaytime.dynamic = true
-
-
-dialplanvoice = cbimap:section(TypedSection, "dialplanvoice", "Dialplan Voicemail", "")
-dialplanvoice.anonymous = true
-dialplanvoice.addremove = true
-dialplanvoice.dynamic = true
-
-
-dialzone = cbimap:section(TypedSection, "dialzone", "Dial Zones for Dialplan", "")
-dialzone.addremove = true
-dialzone.template = "cbi/tblsection"
-
-addprefix = dialzone:option(Value, "addprefix", "Prefix to add matching dialplans", "")
-addprefix.rmempty = true
-
---international = dialzone:option(DynamicList, "international", "Match International prefix", "")
-international = dialzone:option(Value, "international", "Match International prefix", "")
-international.rmempty = true
-
-localprefix = dialzone:option(Value, "localprefix", "Prefix (0) to add/remove to/from intl. numbers", "")
-localprefix.rmempty = true
-
-localzone = dialzone:option(Value, "localzone", "Dialzone for intl. numbers matched as local", "")
-localzone.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
-cbimap.uci:foreach( "asterisk", "dialplan", function(s) localzone:value(s['.name']) end )
-cbimap.uci:foreach( "asterisk", "dialzone", function(s) localzone:value(s['.name']) end )
-
-match = dialzone:option(Value, "match", "Match plan", "")
-match.rmempty = true
-
-uses = dialzone:option(ListValue, "uses", "Connection to use", "")
-uses.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "sip-conns" )
-cbimap.uci:foreach( "asterisk", "sip", function(s) uses:value('SIP/'..s['.name']) end )
-cbimap.uci:foreach( "asterisk", "iax", function(s) uses:value('IAX/'..s['.name']) end )
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-iax-connections.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-iax-connections.lua
deleted file mode 100644
index 0102c1b937..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-iax-connections.lua
+++ /dev/null
@@ -1,60 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-iax = cbimap:section(TypedSection, "iax", "IAX Connection", "")
-iax.addremove = true
-
-alwaysinternational = iax:option(Flag, "alwaysinternational", "Always Dial International", "")
-alwaysinternational.optional = true
-
-context = iax:option(ListValue, "context", "Context to use", "")
-context.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
-cbimap.uci:foreach( "asterisk", "dialplan", function(s) context:value(s['.name']) end )
-cbimap.uci:foreach( "asterisk", "dialzone", function(s) context:value(s['.name']) end )
-
-countrycode = iax:option(Value, "countrycode", "Country Code for connection", "")
-countrycode.optional = true
-
-extension = iax:option(Value, "extension", "Add as Extension", "")
-extension.optional = true
-
-host = iax:option(Value, "host", "Host name (or blank)", "")
-host.optional = true
-
-internationalprefix = iax:option(Value, "internationalprefix", "International Dial Prefix", "")
-internationalprefix.optional = true
-
-prefix = iax:option(Value, "prefix", "Dial Prefix (for external line)", "")
-prefix.optional = true
-
-secret = iax:option(Value, "secret", "Secret", "")
-secret.optional = true
-
-timeout = iax:option(Value, "timeout", "Dial Timeout (sec)", "")
-timeout.optional = true
-
-type = iax:option(ListValue, "type", "Option type", "")
-type:value("friend", "Friend (outbound/inbound)")
-type:value("user", "User (inbound - authenticate by \"from\")")
-type:value("peer", "Peer (outbound - match by host)")
-type.optional = true
-
-username = iax:option(Value, "username", "User name", "")
-username.optional = true
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-meetme.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-meetme.lua
deleted file mode 100644
index 0817445989..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-meetme.lua
+++ /dev/null
@@ -1,33 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-meetmegeneral = cbimap:section(TypedSection, "meetmegeneral", "Meetme Conference General Options", "")
-
-audiobuffers = meetmegeneral:option(Value, "audiobuffers", "Number of 20ms audio buffers to be used", "")
-
-
-meetme = cbimap:section(TypedSection, "meetme", "Meetme Conference", "")
-meetme.addremove = true
-
-adminpin = meetme:option(Value, "adminpin", "Admin PIN", "")
-adminpin.password = true
-
-pin = meetme:option(Value, "pin", "Meeting PIN", "")
-pin.password = true
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-app.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-app.lua
deleted file mode 100644
index 0a0a2d512e..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-app.lua
+++ /dev/null
@@ -1,391 +0,0 @@
-cbimap = Map("asterisk", "asterisk", "")
-
-module = cbimap:section(TypedSection, "module", "Modules", "")
-module.anonymous = true
-
-app_alarmreceiver = module:option(ListValue, "app_alarmreceiver", "Alarm Receiver Application", "")
-app_alarmreceiver:value("yes", "Load")
-app_alarmreceiver:value("no", "Do Not Load")
-app_alarmreceiver:value("auto", "Load as Required")
-app_alarmreceiver.rmempty = true
-
-app_authenticate = module:option(ListValue, "app_authenticate", "Authentication Application", "")
-app_authenticate:value("yes", "Load")
-app_authenticate:value("no", "Do Not Load")
-app_authenticate:value("auto", "Load as Required")
-app_authenticate.rmempty = true
-
-app_cdr = module:option(ListValue, "app_cdr", "Make sure asterisk doesnt save CDR", "")
-app_cdr:value("yes", "Load")
-app_cdr:value("no", "Do Not Load")
-app_cdr:value("auto", "Load as Required")
-app_cdr.rmempty = true
-
-app_chanisavail = module:option(ListValue, "app_chanisavail", "Check if channel is available", "")
-app_chanisavail:value("yes", "Load")
-app_chanisavail:value("no", "Do Not Load")
-app_chanisavail:value("auto", "Load as Required")
-app_chanisavail.rmempty = true
-
-app_chanspy = module:option(ListValue, "app_chanspy", "Listen in on any channel", "")
-app_chanspy:value("yes", "Load")
-app_chanspy:value("no", "Do Not Load")
-app_chanspy:value("auto", "Load as Required")
-app_chanspy.rmempty = true
-
-app_controlplayback = module:option(ListValue, "app_controlplayback", "Control Playback Application", "")
-app_controlplayback:value("yes", "Load")
-app_controlplayback:value("no", "Do Not Load")
-app_controlplayback:value("auto", "Load as Required")
-app_controlplayback.rmempty = true
-
-app_cut = module:option(ListValue, "app_cut", "Cuts up variables", "")
-app_cut:value("yes", "Load")
-app_cut:value("no", "Do Not Load")
-app_cut:value("auto", "Load as Required")
-app_cut.rmempty = true
-
-app_db = module:option(ListValue, "app_db", "Database access functions", "")
-app_db:value("yes", "Load")
-app_db:value("no", "Do Not Load")
-app_db:value("auto", "Load as Required")
-app_db.rmempty = true
-
-app_dial = module:option(ListValue, "app_dial", "Dialing Application", "")
-app_dial:value("yes", "Load")
-app_dial:value("no", "Do Not Load")
-app_dial:value("auto", "Load as Required")
-app_dial.rmempty = true
-
-app_dictate = module:option(ListValue, "app_dictate", "Virtual Dictation Machine Application", "")
-app_dictate:value("yes", "Load")
-app_dictate:value("no", "Do Not Load")
-app_dictate:value("auto", "Load as Required")
-app_dictate.rmempty = true
-
-app_directed_pickup = module:option(ListValue, "app_directed_pickup", "Directed Call Pickup Support", "")
-app_directed_pickup:value("yes", "Load")
-app_directed_pickup:value("no", "Do Not Load")
-app_directed_pickup:value("auto", "Load as Required")
-app_directed_pickup.rmempty = true
-
-app_directory = module:option(ListValue, "app_directory", "Extension Directory", "")
-app_directory:value("yes", "Load")
-app_directory:value("no", "Do Not Load")
-app_directory:value("auto", "Load as Required")
-app_directory.rmempty = true
-
-app_disa = module:option(ListValue, "app_disa", "DISA (Direct Inward System Access) Application", "")
-app_disa:value("yes", "Load")
-app_disa:value("no", "Do Not Load")
-app_disa:value("auto", "Load as Required")
-app_disa.rmempty = true
-
-app_dumpchan = module:option(ListValue, "app_dumpchan", "Dump channel variables Application", "")
-app_dumpchan:value("yes", "Load")
-app_dumpchan:value("no", "Do Not Load")
-app_dumpchan:value("auto", "Load as Required")
-app_dumpchan.rmempty = true
-
-app_echo = module:option(ListValue, "app_echo", "Simple Echo Application", "")
-app_echo:value("yes", "Load")
-app_echo:value("no", "Do Not Load")
-app_echo:value("auto", "Load as Required")
-app_echo.rmempty = true
-
-app_enumlookup = module:option(ListValue, "app_enumlookup", "ENUM Lookup", "")
-app_enumlookup:value("yes", "Load")
-app_enumlookup:value("no", "Do Not Load")
-app_enumlookup:value("auto", "Load as Required")
-app_enumlookup.rmempty = true
-
-app_eval = module:option(ListValue, "app_eval", "Reevaluates strings", "")
-app_eval:value("yes", "Load")
-app_eval:value("no", "Do Not Load")
-app_eval:value("auto", "Load as Required")
-app_eval.rmempty = true
-
-app_exec = module:option(ListValue, "app_exec", "Executes applications", "")
-app_exec:value("yes", "Load")
-app_exec:value("no", "Do Not Load")
-app_exec:value("auto", "Load as Required")
-app_exec.rmempty = true
-
-app_externalivr = module:option(ListValue, "app_externalivr", "External IVR application interface", "")
-app_externalivr:value("yes", "Load")
-app_externalivr:value("no", "Do Not Load")
-app_externalivr:value("auto", "Load as Required")
-app_externalivr.rmempty = true
-
-app_forkcdr = module:option(ListValue, "app_forkcdr", "Fork The CDR into 2 seperate entities", "")
-app_forkcdr:value("yes", "Load")
-app_forkcdr:value("no", "Do Not Load")
-app_forkcdr:value("auto", "Load as Required")
-app_forkcdr.rmempty = true
-
-app_getcpeid = module:option(ListValue, "app_getcpeid", "Get ADSI CPE ID", "")
-app_getcpeid:value("yes", "Load")
-app_getcpeid:value("no", "Do Not Load")
-app_getcpeid:value("auto", "Load as Required")
-app_getcpeid.rmempty = true
-
-app_groupcount = module:option(ListValue, "app_groupcount", "Group Management Routines", "")
-app_groupcount:value("yes", "Load")
-app_groupcount:value("no", "Do Not Load")
-app_groupcount:value("auto", "Load as Required")
-app_groupcount.rmempty = true
-
-app_ices = module:option(ListValue, "app_ices", "Encode and Stream via icecast and ices", "")
-app_ices:value("yes", "Load")
-app_ices:value("no", "Do Not Load")
-app_ices:value("auto", "Load as Required")
-app_ices.rmempty = true
-
-app_image = module:option(ListValue, "app_image", "Image Transmission Application", "")
-app_image:value("yes", "Load")
-app_image:value("no", "Do Not Load")
-app_image:value("auto", "Load as Required")
-app_image.rmempty = true
-
-app_lookupblacklist = module:option(ListValue, "app_lookupblacklist", "Look up Caller*ID name/number from black", "")
-app_lookupblacklist:value("yes", "Load")
-app_lookupblacklist:value("no", "Do Not Load")
-app_lookupblacklist:value("auto", "Load as Required")
-app_lookupblacklist.rmempty = true
-
-app_lookupcidname = module:option(ListValue, "app_lookupcidname", "Look up CallerID Name from local databas", "")
-app_lookupcidname:value("yes", "Load")
-app_lookupcidname:value("no", "Do Not Load")
-app_lookupcidname:value("auto", "Load as Required")
-app_lookupcidname.rmempty = true
-
-app_macro = module:option(ListValue, "app_macro", "Extension Macros", "")
-app_macro:value("yes", "Load")
-app_macro:value("no", "Do Not Load")
-app_macro:value("auto", "Load as Required")
-app_macro.rmempty = true
-
-app_math = module:option(ListValue, "app_math", "A simple math Application", "")
-app_math:value("yes", "Load")
-app_math:value("no", "Do Not Load")
-app_math:value("auto", "Load as Required")
-app_math.rmempty = true
-
-app_md5 = module:option(ListValue, "app_md5", "MD5 checksum Application", "")
-app_md5:value("yes", "Load")
-app_md5:value("no", "Do Not Load")
-app_md5:value("auto", "Load as Required")
-app_md5.rmempty = true
-
-app_milliwatt = module:option(ListValue, "app_milliwatt", "Digital Milliwatt (mu-law) Test Application", "")
-app_milliwatt:value("yes", "Load")
-app_milliwatt:value("no", "Do Not Load")
-app_milliwatt:value("auto", "Load as Required")
-app_milliwatt.rmempty = true
-
-app_mixmonitor = module:option(ListValue, "app_mixmonitor", "Record a call and mix the audio during the recording", "")
-app_mixmonitor:value("yes", "Load")
-app_mixmonitor:value("no", "Do Not Load")
-app_mixmonitor:value("auto", "Load as Required")
-app_mixmonitor.rmempty = true
-
-app_parkandannounce = module:option(ListValue, "app_parkandannounce", "Call Parking and Announce Application", "")
-app_parkandannounce:value("yes", "Load")
-app_parkandannounce:value("no", "Do Not Load")
-app_parkandannounce:value("auto", "Load as Required")
-app_parkandannounce.rmempty = true
-
-app_playback = module:option(ListValue, "app_playback", "Trivial Playback Application", "")
-app_playback:value("yes", "Load")
-app_playback:value("no", "Do Not Load")
-app_playback:value("auto", "Load as Required")
-app_playback.rmempty = true
-
-app_privacy = module:option(ListValue, "app_privacy", "Require phone number to be entered", "")
-app_privacy:value("yes", "Load")
-app_privacy:value("no", "Do Not Load")
-app_privacy:value("auto", "Load as Required")
-app_privacy.rmempty = true
-
-app_queue = module:option(ListValue, "app_queue", "True Call Queueing", "")
-app_queue:value("yes", "Load")
-app_queue:value("no", "Do Not Load")
-app_queue:value("auto", "Load as Required")
-app_queue.rmempty = true
-
-app_random = module:option(ListValue, "app_random", "Random goto", "")
-app_random:value("yes", "Load")
-app_random:value("no", "Do Not Load")
-app_random:value("auto", "Load as Required")
-app_random.rmempty = true
-
-app_read = module:option(ListValue, "app_read", "Read Variable Application", "")
-app_read:value("yes", "Load")
-app_read:value("no", "Do Not Load")
-app_read:value("auto", "Load as Required")
-app_read.rmempty = true
-
-app_readfile = module:option(ListValue, "app_readfile", "Read in a file", "")
-app_readfile:value("yes", "Load")
-app_readfile:value("no", "Do Not Load")
-app_readfile:value("auto", "Load as Required")
-app_readfile.rmempty = true
-
-app_realtime = module:option(ListValue, "app_realtime", "Realtime Data Lookup/Rewrite", "")
-app_realtime:value("yes", "Load")
-app_realtime:value("no", "Do Not Load")
-app_realtime:value("auto", "Load as Required")
-app_realtime.rmempty = true
-
-app_record = module:option(ListValue, "app_record", "Trivial Record Application", "")
-app_record:value("yes", "Load")
-app_record:value("no", "Do Not Load")
-app_record:value("auto", "Load as Required")
-app_record.rmempty = true
-
-app_sayunixtime = module:option(ListValue, "app_sayunixtime", "Say time", "")
-app_sayunixtime:value("yes", "Load")
-app_sayunixtime:value("no", "Do Not Load")
-app_sayunixtime:value("auto", "Load as Required")
-app_sayunixtime.rmempty = true
-
-app_senddtmf = module:option(ListValue, "app_senddtmf", "Send DTMF digits Application", "")
-app_senddtmf:value("yes", "Load")
-app_senddtmf:value("no", "Do Not Load")
-app_senddtmf:value("auto", "Load as Required")
-app_senddtmf.rmempty = true
-
-app_sendtext = module:option(ListValue, "app_sendtext", "Send Text Applications", "")
-app_sendtext:value("yes", "Load")
-app_sendtext:value("no", "Do Not Load")
-app_sendtext:value("auto", "Load as Required")
-app_sendtext.rmempty = true
-
-app_setcallerid = module:option(ListValue, "app_setcallerid", "Set CallerID Application", "")
-app_setcallerid:value("yes", "Load")
-app_setcallerid:value("no", "Do Not Load")
-app_setcallerid:value("auto", "Load as Required")
-app_setcallerid.rmempty = true
-
-app_setcdruserfield = module:option(ListValue, "app_setcdruserfield", "CDR user field apps", "")
-app_setcdruserfield:value("yes", "Load")
-app_setcdruserfield:value("no", "Do Not Load")
-app_setcdruserfield:value("auto", "Load as Required")
-app_setcdruserfield.rmempty = true
-
-app_setcidname = module:option(ListValue, "app_setcidname", "load => .so ; Set CallerID Name", "")
-app_setcidname:value("yes", "Load")
-app_setcidname:value("no", "Do Not Load")
-app_setcidname:value("auto", "Load as Required")
-app_setcidname.rmempty = true
-
-app_setcidnum = module:option(ListValue, "app_setcidnum", "load => .so ; Set CallerID Number", "")
-app_setcidnum:value("yes", "Load")
-app_setcidnum:value("no", "Do Not Load")
-app_setcidnum:value("auto", "Load as Required")
-app_setcidnum.rmempty = true
-
-app_setrdnis = module:option(ListValue, "app_setrdnis", "Set RDNIS Number", "")
-app_setrdnis:value("yes", "Load")
-app_setrdnis:value("no", "Do Not Load")
-app_setrdnis:value("auto", "Load as Required")
-app_setrdnis.rmempty = true
-
-app_settransfercapability = module:option(ListValue, "app_settransfercapability", "Set ISDN Transfer Capability", "")
-app_settransfercapability:value("yes", "Load")
-app_settransfercapability:value("no", "Do Not Load")
-app_settransfercapability:value("auto", "Load as Required")
-app_settransfercapability.rmempty = true
-
-app_sms = module:option(ListValue, "app_sms", "SMS/PSTN handler", "")
-app_sms:value("yes", "Load")
-app_sms:value("no", "Do Not Load")
-app_sms:value("auto", "Load as Required")
-app_sms.rmempty = true
-
-app_softhangup = module:option(ListValue, "app_softhangup", "Hangs up the requested channel", "")
-app_softhangup:value("yes", "Load")
-app_softhangup:value("no", "Do Not Load")
-app_softhangup:value("auto", "Load as Required")
-app_softhangup.rmempty = true
-
-app_stack = module:option(ListValue, "app_stack", "Stack Routines", "")
-app_stack:value("yes", "Load")
-app_stack:value("no", "Do Not Load")
-app_stack:value("auto", "Load as Required")
-app_stack.rmempty = true
-
-app_system = module:option(ListValue, "app_system", "Generic System() application", "")
-app_system:value("yes", "Load")
-app_system:value("no", "Do Not Load")
-app_system:value("auto", "Load as Required")
-app_system.rmempty = true
-
-app_talkdetect = module:option(ListValue, "app_talkdetect", "Playback with Talk Detection", "")
-app_talkdetect:value("yes", "Load")
-app_talkdetect:value("no", "Do Not Load")
-app_talkdetect:value("auto", "Load as Required")
-app_talkdetect.rmempty = true
-
-app_test = module:option(ListValue, "app_test", "Interface Test Application", "")
-app_test:value("yes", "Load")
-app_test:value("no", "Do Not Load")
-app_test:value("auto", "Load as Required")
-app_test.rmempty = true
-
-app_transfer = module:option(ListValue, "app_transfer", "Transfer", "")
-app_transfer:value("yes", "Load")
-app_transfer:value("no", "Do Not Load")
-app_transfer:value("auto", "Load as Required")
-app_transfer.rmempty = true
-
-app_txtcidname = module:option(ListValue, "app_txtcidname", "TXTCIDName", "")
-app_txtcidname:value("yes", "Load")
-app_txtcidname:value("no", "Do Not Load")
-app_txtcidname:value("auto", "Load as Required")
-app_txtcidname.rmempty = true
-
-app_url = module:option(ListValue, "app_url", "Send URL Applications", "")
-app_url:value("yes", "Load")
-app_url:value("no", "Do Not Load")
-app_url:value("auto", "Load as Required")
-app_url.rmempty = true
-
-app_userevent = module:option(ListValue, "app_userevent", "Custom User Event Application", "")
-app_userevent:value("yes", "Load")
-app_userevent:value("no", "Do Not Load")
-app_userevent:value("auto", "Load as Required")
-app_userevent.rmempty = true
-
-app_verbose = module:option(ListValue, "app_verbose", "Send verbose output", "")
-app_verbose:value("yes", "Load")
-app_verbose:value("no", "Do Not Load")
-app_verbose:value("auto", "Load as Required")
-app_verbose.rmempty = true
-
-app_voicemail = module:option(ListValue, "app_voicemail", "Voicemail", "")
-app_voicemail:value("yes", "Load")
-app_voicemail:value("no", "Do Not Load")
-app_voicemail:value("auto", "Load as Required")
-app_voicemail.rmempty = true
-
-app_waitforring = module:option(ListValue, "app_waitforring", "Waits until first ring after time", "")
-app_waitforring:value("yes", "Load")
-app_waitforring:value("no", "Do Not Load")
-app_waitforring:value("auto", "Load as Required")
-app_waitforring.rmempty = true
-
-app_waitforsilence = module:option(ListValue, "app_waitforsilence", "Wait For Silence Application", "")
-app_waitforsilence:value("yes", "Load")
-app_waitforsilence:value("no", "Do Not Load")
-app_waitforsilence:value("auto", "Load as Required")
-app_waitforsilence.rmempty = true
-
-app_while = module:option(ListValue, "app_while", "While Loops and Conditional Execution", "")
-app_while:value("yes", "Load")
-app_while:value("no", "Do Not Load")
-app_while:value("auto", "Load as Required")
-app_while.rmempty = true
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-cdr.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-cdr.lua
deleted file mode 100644
index ee1960d1ba..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-cdr.lua
+++ /dev/null
@@ -1,58 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-module = cbimap:section(TypedSection, "module", "Modules", "")
-module.anonymous = true
-
-cdr_csv = module:option(ListValue, "cdr_csv", "Comma Separated Values CDR Backend", "")
-cdr_csv:value("yes", "Load")
-cdr_csv:value("no", "Do Not Load")
-cdr_csv:value("auto", "Load as Required")
-cdr_csv.rmempty = true
-
-cdr_custom = module:option(ListValue, "cdr_custom", "Customizable Comma Separated Values CDR Backend", "")
-cdr_custom:value("yes", "Load")
-cdr_custom:value("no", "Do Not Load")
-cdr_custom:value("auto", "Load as Required")
-cdr_custom.rmempty = true
-
-cdr_manager = module:option(ListValue, "cdr_manager", "Asterisk Call Manager CDR Backend", "")
-cdr_manager:value("yes", "Load")
-cdr_manager:value("no", "Do Not Load")
-cdr_manager:value("auto", "Load as Required")
-cdr_manager.rmempty = true
-
-cdr_mysql = module:option(ListValue, "cdr_mysql", "MySQL CDR Backend", "")
-cdr_mysql:value("yes", "Load")
-cdr_mysql:value("no", "Do Not Load")
-cdr_mysql:value("auto", "Load as Required")
-cdr_mysql.rmempty = true
-
-cdr_pgsql = module:option(ListValue, "cdr_pgsql", "PostgreSQL CDR Backend", "")
-cdr_pgsql:value("yes", "Load")
-cdr_pgsql:value("no", "Do Not Load")
-cdr_pgsql:value("auto", "Load as Required")
-cdr_pgsql.rmempty = true
-
-cdr_sqlite = module:option(ListValue, "cdr_sqlite", "SQLite CDR Backend", "")
-cdr_sqlite:value("yes", "Load")
-cdr_sqlite:value("no", "Do Not Load")
-cdr_sqlite:value("auto", "Load as Required")
-cdr_sqlite.rmempty = true
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-chan.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-chan.lua
deleted file mode 100644
index 835cbdcfae..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-chan.lua
+++ /dev/null
@@ -1,56 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-
-module = cbimap:section(TypedSection, "module", "Modules", "")
-module.anonymous = true
-
-chan_agent = module:option(ListValue, "chan_agent", "Agent Proxy Channel", "")
-chan_agent:value("yes", "Load")
-chan_agent:value("no", "Do Not Load")
-chan_agent:value("auto", "Load as Required")
-chan_agent.rmempty = true
-
-chan_alsa = module:option(ListValue, "chan_alsa", "Channel driver for GTalk", "")
-chan_alsa:value("yes", "Load")
-chan_alsa:value("no", "Do Not Load")
-chan_alsa:value("auto", "Load as Required")
-chan_alsa.rmempty = true
-
-chan_gtalk = module:option(ListValue, "chan_gtalk", "Channel driver for GTalk", "")
-chan_gtalk:value("yes", "Load")
-chan_gtalk:value("no", "Do Not Load")
-chan_gtalk:value("auto", "Load as Required")
-chan_gtalk.rmempty = true
-
-chan_iax2 = module:option(Flag, "chan_iax2", "Option chan_iax2", "")
-chan_iax2.rmempty = true
-
-chan_local = module:option(ListValue, "chan_local", "Local Proxy Channel", "")
-chan_local:value("yes", "Load")
-chan_local:value("no", "Do Not Load")
-chan_local:value("auto", "Load as Required")
-chan_local.rmempty = true
-
-chan_sip = module:option(ListValue, "chan_sip", "Session Initiation Protocol (SIP)", "")
-chan_sip:value("yes", "Load")
-chan_sip:value("no", "Do Not Load")
-chan_sip:value("auto", "Load as Required")
-chan_sip.rmempty = true
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-codec.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-codec.lua
deleted file mode 100644
index 3c8d95840e..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-codec.lua
+++ /dev/null
@@ -1,64 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-module = cbimap:section(TypedSection, "module", "Modules", "")
-module.anonymous = true
-
-codec_a_mu = module:option(ListValue, "codec_a_mu", "A-law and Mulaw direct Coder/Decoder", "")
-codec_a_mu:value("yes", "Load")
-codec_a_mu:value("no", "Do Not Load")
-codec_a_mu:value("auto", "Load as Required")
-codec_a_mu.rmempty = true
-
-codec_adpcm = module:option(ListValue, "codec_adpcm", "Adaptive Differential PCM Coder/Decoder", "")
-codec_adpcm:value("yes", "Load")
-codec_adpcm:value("no", "Do Not Load")
-codec_adpcm:value("auto", "Load as Required")
-codec_adpcm.rmempty = true
-
-codec_alaw = module:option(ListValue, "codec_alaw", "A-law Coder/Decoder", "")
-codec_alaw:value("yes", "Load")
-codec_alaw:value("no", "Do Not Load")
-codec_alaw:value("auto", "Load as Required")
-codec_alaw.rmempty = true
-
-codec_g726 = module:option(ListValue, "codec_g726", "ITU G.726-32kbps G726 Transcoder", "")
-codec_g726:value("yes", "Load")
-codec_g726:value("no", "Do Not Load")
-codec_g726:value("auto", "Load as Required")
-codec_g726.rmempty = true
-
-codec_gsm = module:option(ListValue, "codec_gsm", "GSM/PCM16 (signed linear) Codec Translation", "")
-codec_gsm:value("yes", "Load")
-codec_gsm:value("no", "Do Not Load")
-codec_gsm:value("auto", "Load as Required")
-codec_gsm.rmempty = true
-
-codec_speex = module:option(ListValue, "codec_speex", "Speex/PCM16 (signed linear) Codec Translator", "")
-codec_speex:value("yes", "Load")
-codec_speex:value("no", "Do Not Load")
-codec_speex:value("auto", "Load as Required")
-codec_speex.rmempty = true
-
-codec_ulaw = module:option(ListValue, "codec_ulaw", "Mu-law Coder/Decoder", "")
-codec_ulaw:value("yes", "Load")
-codec_ulaw:value("no", "Do Not Load")
-codec_ulaw:value("auto", "Load as Required")
-codec_ulaw.rmempty = true
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-format.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-format.lua
deleted file mode 100644
index da3989b2d4..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-format.lua
+++ /dev/null
@@ -1,100 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-module = cbimap:section(TypedSection, "module", "Modules", "")
-module.anonymous = true
-
-format_au = module:option(ListValue, "format_au", "Sun Microsystems AU format (signed linear)", "")
-format_au:value("yes", "Load")
-format_au:value("no", "Do Not Load")
-format_au:value("auto", "Load as Required")
-format_au.rmempty = true
-
-format_g723 = module:option(ListValue, "format_g723", "G.723.1 Simple Timestamp File Format", "")
-format_g723:value("yes", "Load")
-format_g723:value("no", "Do Not Load")
-format_g723:value("auto", "Load as Required")
-format_g723.rmempty = true
-
-format_g726 = module:option(ListValue, "format_g726", "Raw G.726 (16/24/32/40kbps) data", "")
-format_g726:value("yes", "Load")
-format_g726:value("no", "Do Not Load")
-format_g726:value("auto", "Load as Required")
-format_g726.rmempty = true
-
-format_g729 = module:option(ListValue, "format_g729", "Raw G729 data", "")
-format_g729:value("yes", "Load")
-format_g729:value("no", "Do Not Load")
-format_g729:value("auto", "Load as Required")
-format_g729.rmempty = true
-
-format_gsm = module:option(ListValue, "format_gsm", "Raw GSM data", "")
-format_gsm:value("yes", "Load")
-format_gsm:value("no", "Do Not Load")
-format_gsm:value("auto", "Load as Required")
-format_gsm.rmempty = true
-
-format_h263 = module:option(ListValue, "format_h263", "Raw h263 data", "")
-format_h263:value("yes", "Load")
-format_h263:value("no", "Do Not Load")
-format_h263:value("auto", "Load as Required")
-format_h263.rmempty = true
-
-format_jpeg = module:option(ListValue, "format_jpeg", "JPEG (Joint Picture Experts Group) Image", "")
-format_jpeg:value("yes", "Load")
-format_jpeg:value("no", "Do Not Load")
-format_jpeg:value("auto", "Load as Required")
-format_jpeg.rmempty = true
-
-format_pcm = module:option(ListValue, "format_pcm", "Raw uLaw 8khz Audio support (PCM)", "")
-format_pcm:value("yes", "Load")
-format_pcm:value("no", "Do Not Load")
-format_pcm:value("auto", "Load as Required")
-format_pcm.rmempty = true
-
-format_pcm_alaw = module:option(ListValue, "format_pcm_alaw", "load => .so ; Raw aLaw 8khz PCM Audio support", "")
-format_pcm_alaw:value("yes", "Load")
-format_pcm_alaw:value("no", "Do Not Load")
-format_pcm_alaw:value("auto", "Load as Required")
-format_pcm_alaw.rmempty = true
-
-format_sln = module:option(ListValue, "format_sln", "Raw Signed Linear Audio support (SLN)", "")
-format_sln:value("yes", "Load")
-format_sln:value("no", "Do Not Load")
-format_sln:value("auto", "Load as Required")
-format_sln.rmempty = true
-
-format_vox = module:option(ListValue, "format_vox", "Dialogic VOX (ADPCM) File Format", "")
-format_vox:value("yes", "Load")
-format_vox:value("no", "Do Not Load")
-format_vox:value("auto", "Load as Required")
-format_vox.rmempty = true
-
-format_wav = module:option(ListValue, "format_wav", "Microsoft WAV format (8000hz Signed Line", "")
-format_wav:value("yes", "Load")
-format_wav:value("no", "Do Not Load")
-format_wav:value("auto", "Load as Required")
-format_wav.rmempty = true
-
-format_wav_gsm = module:option(ListValue, "format_wav_gsm", "Microsoft WAV format (Proprietary GSM)", "")
-format_wav_gsm:value("yes", "Load")
-format_wav_gsm:value("no", "Do Not Load")
-format_wav_gsm:value("auto", "Load as Required")
-format_wav_gsm.rmempty = true
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-func.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-func.lua
deleted file mode 100644
index 7d80641f30..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-func.lua
+++ /dev/null
@@ -1,40 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-module = cbimap:section(TypedSection, "module", "Modules", "")
-module.anonymous = true
-
-func_callerid = module:option(ListValue, "func_callerid", "Caller ID related dialplan functions", "")
-func_callerid:value("yes", "Load")
-func_callerid:value("no", "Do Not Load")
-func_callerid:value("auto", "Load as Required")
-func_callerid.rmempty = true
-
-func_enum = module:option(ListValue, "func_enum", "ENUM Functions", "")
-func_enum:value("yes", "Load")
-func_enum:value("no", "Do Not Load")
-func_enum:value("auto", "Load as Required")
-func_enum.rmempty = true
-
-func_uri = module:option(ListValue, "func_uri", "URI encoding / decoding functions", "")
-func_uri:value("yes", "Load")
-func_uri:value("no", "Do Not Load")
-func_uri:value("auto", "Load as Required")
-func_uri.rmempty = true
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-pbx.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-pbx.lua
deleted file mode 100644
index 8b22b5cb2d..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-pbx.lua
+++ /dev/null
@@ -1,64 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-module = cbimap:section(TypedSection, "module", "Modules", "")
-module.anonymous = true
-
-pbx_ael = module:option(ListValue, "pbx_ael", "Asterisk Extension Language Compiler", "")
-pbx_ael:value("yes", "Load")
-pbx_ael:value("no", "Do Not Load")
-pbx_ael:value("auto", "Load as Required")
-pbx_ael.rmempty = true
-
-pbx_config = module:option(ListValue, "pbx_config", "Text Extension Configuration", "")
-pbx_config:value("yes", "Load")
-pbx_config:value("no", "Do Not Load")
-pbx_config:value("auto", "Load as Required")
-pbx_config.rmempty = true
-
-pbx_functions = module:option(ListValue, "pbx_functions", "load => .so ; Builtin dialplan functions", "")
-pbx_functions:value("yes", "Load")
-pbx_functions:value("no", "Do Not Load")
-pbx_functions:value("auto", "Load as Required")
-pbx_functions.rmempty = true
-
-pbx_loopback = module:option(ListValue, "pbx_loopback", "Loopback Switch", "")
-pbx_loopback:value("yes", "Load")
-pbx_loopback:value("no", "Do Not Load")
-pbx_loopback:value("auto", "Load as Required")
-pbx_loopback.rmempty = true
-
-pbx_realtime = module:option(ListValue, "pbx_realtime", "Realtime Switch", "")
-pbx_realtime:value("yes", "Load")
-pbx_realtime:value("no", "Do Not Load")
-pbx_realtime:value("auto", "Load as Required")
-pbx_realtime.rmempty = true
-
-pbx_spool = module:option(ListValue, "pbx_spool", "Outgoing Spool Support", "")
-pbx_spool:value("yes", "Load")
-pbx_spool:value("no", "Do Not Load")
-pbx_spool:value("auto", "Load as Required")
-pbx_spool.rmempty = true
-
-pbx_wilcalu = module:option(ListValue, "pbx_wilcalu", "Wil Cal U (Auto Dialer)", "")
-pbx_wilcalu:value("yes", "Load")
-pbx_wilcalu:value("no", "Do Not Load")
-pbx_wilcalu:value("auto", "Load as Required")
-pbx_wilcalu.rmempty = true
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-res-feature.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-res-feature.lua
deleted file mode 100644
index 35c5d47607..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-res-feature.lua
+++ /dev/null
@@ -1,111 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-featuremap = cbimap:section(TypedSection, "featuremap", "Feature Key maps", "")
-featuremap.anonymous = true
-featuremap.addremove = true
-
-atxfer = featuremap:option(Value, "atxfer", "Attended transfer key", "")
-atxfer.rmempty = true
-
-blindxfer = featuremap:option(Value, "blindxfer", "Blind transfer key", "")
-blindxfer.rmempty = true
-
-disconnect = featuremap:option(Value, "disconnect", "Key to Disconnect call", "")
-disconnect.rmempty = true
-
-parkcall = featuremap:option(Value, "parkcall", "Key to Park call", "")
-parkcall.rmempty = true
-
-
-featurepark = cbimap:section(TypedSection, "featurepark", "Parking Feature", "")
-featurepark.anonymous = true
-
-parkenabled = featurepark:option(Flag, "parkenabled", "Enable Parking", "")
-
-adsipark = featurepark:option(Flag, "adsipark", "ADSI Park", "")
-adsipark.rmempty = true
-adsipark:depends({ parkenabled = "1" })
-
-atxfernoanswertimeout = featurepark:option(Value, "atxfernoanswertimeout", "Attended transfer timeout (sec)", "")
-atxfernoanswertimeout.rmempty = true
-atxfernoanswertimeout:depends({ parkenabled = "1" })
-
-automon = featurepark:option(Value, "automon", "One touch record key", "")
-automon.rmempty = true
-automon:depends({ parkenabled = "1" })
-
-context = featurepark:option(Value, "context", "Name of call context for parking", "")
-context.rmempty = true
-context:depends({ parkenabled = "1" })
-
-courtesytone = featurepark:option(Value, "courtesytone", "Sound file to play to parked caller", "")
-courtesytone.rmempty = true
-courtesytone:depends({ parkenabled = "1" })
-
-featuredigittimeout = featurepark:option(Value, "featuredigittimeout", "Max time (ms) between digits for feature activation", "")
-featuredigittimeout.rmempty = true
-featuredigittimeout:depends({ parkenabled = "1" })
-
-findslot = featurepark:option(ListValue, "findslot", "Method to Find Parking slot", "")
-findslot:value("first", "First available slot")
-findslot:value("next", "Next free parking space")
-findslot.rmempty = true
-findslot:depends({ parkenabled = "1" })
-
-parkedmusicclass = featurepark:option(ListValue, "parkedmusicclass", "Music on Hold class for the parked channel", "")
-parkedmusicclass.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk" )
-parkedmusicclass:depends({ parkenabled = "1" })
-cbimap.uci:foreach( "asterisk", "moh", function(s) parkedmusicclass:value(s['.name']) end )
-
-parkedplay = featurepark:option(ListValue, "parkedplay", "Play courtesy tone to", "")
-parkedplay:value("caller", "Caller")
-parkedplay:value("parked", "Parked user")
-parkedplay:value("both", "Both")
-parkedplay.rmempty = true
-parkedplay:depends({ parkenabled = "1" })
-
-parkext = featurepark:option(Value, "parkext", "Extension to dial to park", "")
-parkext.rmempty = true
-parkext:depends({ parkenabled = "1" })
-
-parkingtime = featurepark:option(Value, "parkingtime", "Parking time (secs)", "")
-parkingtime.rmempty = true
-parkingtime:depends({ parkenabled = "1" })
-
-parkpos = featurepark:option(Value, "parkpos", "Range of extensions for call parking", "")
-parkpos.rmempty = true
-parkpos:depends({ parkenabled = "1" })
-
-pickupexten = featurepark:option(Value, "pickupexten", "Pickup extension", "")
-pickupexten.rmempty = true
-pickupexten:depends({ parkenabled = "1" })
-
-transferdigittimeout = featurepark:option(Value, "transferdigittimeout", "Seconds to wait bewteen digits when transferring", "")
-transferdigittimeout.rmempty = true
-transferdigittimeout:depends({ parkenabled = "1" })
-
-xferfailsound = featurepark:option(Value, "xferfailsound", "sound when attended transfer is complete", "")
-xferfailsound.rmempty = true
-xferfailsound:depends({ parkenabled = "1" })
-
-xfersound = featurepark:option(Value, "xfersound", "Sound when attended transfer fails", "")
-xfersound.rmempty = true
-xfersound:depends({ parkenabled = "1" })
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-res.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-res.lua
deleted file mode 100644
index 5ef6bddd49..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-res.lua
+++ /dev/null
@@ -1,88 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-module = cbimap:section(TypedSection, "module", "Modules", "")
-module.anonymous = true
-
-res_config_mysql = module:option(ListValue, "res_config_mysql", "MySQL Config Resource", "")
-res_config_mysql:value("yes", "Load")
-res_config_mysql:value("no", "Do Not Load")
-res_config_mysql:value("auto", "Load as Required")
-res_config_mysql.rmempty = true
-
-res_config_odbc = module:option(ListValue, "res_config_odbc", "ODBC Config Resource", "")
-res_config_odbc:value("yes", "Load")
-res_config_odbc:value("no", "Do Not Load")
-res_config_odbc:value("auto", "Load as Required")
-res_config_odbc.rmempty = true
-
-res_config_pgsql = module:option(ListValue, "res_config_pgsql", "PGSQL Module", "")
-res_config_pgsql:value("yes", "Load")
-res_config_pgsql:value("no", "Do Not Load")
-res_config_pgsql:value("auto", "Load as Required")
-res_config_pgsql.rmempty = true
-
-res_crypto = module:option(ListValue, "res_crypto", "Cryptographic Digital Signatures", "")
-res_crypto:value("yes", "Load")
-res_crypto:value("no", "Do Not Load")
-res_crypto:value("auto", "Load as Required")
-res_crypto.rmempty = true
-
-res_features = module:option(ListValue, "res_features", "Call Parking Resource", "")
-res_features:value("yes", "Load")
-res_features:value("no", "Do Not Load")
-res_features:value("auto", "Load as Required")
-res_features.rmempty = true
-
-res_indications = module:option(ListValue, "res_indications", "Indications Configuration", "")
-res_indications:value("yes", "Load")
-res_indications:value("no", "Do Not Load")
-res_indications:value("auto", "Load as Required")
-res_indications.rmempty = true
-
-res_monitor = module:option(ListValue, "res_monitor", "Call Monitoring Resource", "")
-res_monitor:value("yes", "Load")
-res_monitor:value("no", "Do Not Load")
-res_monitor:value("auto", "Load as Required")
-res_monitor.rmempty = true
-
-res_musiconhold = module:option(ListValue, "res_musiconhold", "Music On Hold Resource", "")
-res_musiconhold:value("yes", "Load")
-res_musiconhold:value("no", "Do Not Load")
-res_musiconhold:value("auto", "Load as Required")
-res_musiconhold.rmempty = true
-
-res_odbc = module:option(ListValue, "res_odbc", "ODBC Resource", "")
-res_odbc:value("yes", "Load")
-res_odbc:value("no", "Do Not Load")
-res_odbc:value("auto", "Load as Required")
-res_odbc.rmempty = true
-
-res_smdi = module:option(ListValue, "res_smdi", "SMDI Module", "")
-res_smdi:value("yes", "Load")
-res_smdi:value("no", "Do Not Load")
-res_smdi:value("auto", "Load as Required")
-res_smdi.rmempty = true
-
-res_snmp = module:option(ListValue, "res_snmp", "SNMP Module", "")
-res_snmp:value("yes", "Load")
-res_snmp:value("no", "Do Not Load")
-res_snmp:value("auto", "Load as Required")
-res_snmp.rmempty = true
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-sip-connections.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-sip-connections.lua
deleted file mode 100644
index efb84a01f7..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-sip-connections.lua
+++ /dev/null
@@ -1,109 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-sip = cbimap:section(TypedSection, "sip", "SIP Connection", "")
-sip.addremove = true
-
-alwaysinternational = sip:option(Flag, "alwaysinternational", "Always Dial International", "")
-alwaysinternational.optional = true
-
-canreinvite = sip:option(ListValue, "canreinvite", "Reinvite/redirect media connections", "")
-canreinvite:value("yes", "Yes")
-canreinvite:value("nonat", "Yes when not behind NAT")
-canreinvite:value("update", "Use UPDATE rather than INVITE for path redirection")
-canreinvite:value("no", "No")
-canreinvite.optional = true
-
-context = sip:option(ListValue, "context", "Context to use", "")
-context.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
-cbimap.uci:foreach( "asterisk", "dialplan", function(s) context:value(s['.name']) end )
-cbimap.uci:foreach( "asterisk", "dialzone", function(s) context:value(s['.name']) end )
-
-countrycode = sip:option(Value, "countrycode", "Country Code for connection", "")
-countrycode.optional = true
-
-dtmfmode = sip:option(ListValue, "dtmfmode", "DTMF mode", "")
-dtmfmode:value("info", "Use RFC2833 or INFO for the BudgeTone")
-dtmfmode:value("rfc2833", "Use RFC2833 for the BudgeTone")
-dtmfmode:value("inband", "Use Inband (only with ulaw/alaw)")
-dtmfmode.optional = true
-
-extension = sip:option(Value, "extension", "Add as Extension", "")
-extension.optional = true
-
-fromdomain = sip:option(Value, "fromdomain", "Primary domain identity for From: headers", "")
-fromdomain.optional = true
-
-fromuser = sip:option(Value, "fromuser", "From user (required by many SIP providers)", "")
-fromuser.optional = true
-
-host = sip:option(Value, "host", "Host name (or blank)", "")
-host.optional = true
-
-incoming = sip:option(DynamicList, "incoming", "Ring on incoming dialplan contexts", "")
-incoming.optional = true
-
-insecure = sip:option(ListValue, "insecure", "Allow Insecure for", "")
-insecure:value("port", "Allow mismatched port number")
-insecure:value("invite", "Do not require auth of incoming INVITE")
-insecure:value("port,invite", "Allow mismatched port and Do not require auth of incoming INVITE")
-insecure.optional = true
-
-internationalprefix = sip:option(Value, "internationalprefix", "International Dial Prefix", "")
-internationalprefix.optional = true
-
-mailbox = sip:option(Value, "mailbox", "Mailbox for MWI", "")
-mailbox.optional = true
-
-nat = sip:option(Flag, "nat", "NAT between phone and Asterisk", "")
-nat.optional = true
-
-pedantic = sip:option(Flag, "pedantic", "Check tags in headers", "")
-pedantic.optional = true
-
-port = sip:option(Value, "port", "SIP Port", "")
-port.optional = true
-
-prefix = sip:option(Value, "prefix", "Dial Prefix (for external line)", "")
-prefix.optional = true
-
-qualify = sip:option(Value, "qualify", "Reply Timeout (ms) for down connection", "")
-qualify.optional = true
-
-register = sip:option(Flag, "register", "Register connection", "")
-register.optional = true
-
-secret = sip:option(Value, "secret", "Secret", "")
-secret.optional = true
-
-selfmailbox = sip:option(Flag, "selfmailbox", "Dial own extension for mailbox", "")
-selfmailbox.optional = true
-
-timeout = sip:option(Value, "timeout", "Dial Timeout (sec)", "")
-timeout.optional = true
-
-type = sip:option(ListValue, "type", "Client Type", "")
-type:value("friend", "Friend (outbound/inbound)")
-type:value("user", "User (inbound - authenticate by \"from\")")
-type:value("peer", "Peer (outbound - match by host)")
-type.optional = true
-
-username = sip:option(Value, "username", "Username", "")
-username.optional = true
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk-voice.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk-voice.lua
deleted file mode 100644
index af0259549a..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk-voice.lua
+++ /dev/null
@@ -1,52 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-voicegeneral = cbimap:section(TypedSection, "voicegeneral", "Voicemail general options", "")
-
-serveremail = voicegeneral:option(Value, "serveremail", "From Email address of server", "")
-
-
-voicemail = cbimap:section(TypedSection, "voicemail", "Voice Mail boxes", "")
-voicemail.addremove = true
-
-attach = voicemail:option(Flag, "attach", "Email contains attachment", "")
-attach.rmempty = true
-
-email = voicemail:option(Value, "email", "Email", "")
-email.rmempty = true
-
-name = voicemail:option(Value, "name", "Display Name", "")
-name.rmempty = true
-
-password = voicemail:option(Value, "password", "Password", "")
-password.rmempty = true
-
-zone = voicemail:option(ListValue, "zone", "Voice Zone", "")
-cbimap.uci:foreach( "asterisk", "voicezone", function(s) zone:value(s['.name']) end )
-
-
-voicezone = cbimap:section(TypedSection, "voicezone", "Voice Zone settings", "")
-voicezone.addremove = true
-
-message = voicezone:option(Value, "message", "Message Format", "")
-message.rmempty = true
-
-zone = voicezone:option(Value, "zone", "Time Zone", "")
-zone.rmempty = true
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk.lua
deleted file mode 100644
index 7580f22ecc..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk.lua
+++ /dev/null
@@ -1,162 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "asterisk", "")
-
-asterisk = cbimap:section(TypedSection, "asterisk", "Asterisk General Options", "")
-asterisk.anonymous = true
-
-agidir = asterisk:option(Value, "agidir", "AGI directory", "")
-agidir.rmempty = true
-
-cache_record_files = asterisk:option(Flag, "cache_record_files", "Cache recorded sound files during recording", "")
-cache_record_files.rmempty = true
-
-debug = asterisk:option(Value, "debug", "Debug Level", "")
-debug.rmempty = true
-
-dontwarn = asterisk:option(Flag, "dontwarn", "Disable some warnings", "")
-dontwarn.rmempty = true
-
-dumpcore = asterisk:option(Flag, "dumpcore", "Dump core on crash", "")
-dumpcore.rmempty = true
-
-highpriority = asterisk:option(Flag, "highpriority", "High Priority", "")
-highpriority.rmempty = true
-
-initcrypto = asterisk:option(Flag, "initcrypto", "Initialise Crypto", "")
-initcrypto.rmempty = true
-
-internal_timing = asterisk:option(Flag, "internal_timing", "Use Internal Timing", "")
-internal_timing.rmempty = true
-
-logdir = asterisk:option(Value, "logdir", "Log directory", "")
-logdir.rmempty = true
-
-maxcalls = asterisk:option(Value, "maxcalls", "Maximum number of calls allowed", "")
-maxcalls.rmempty = true
-
-maxload = asterisk:option(Value, "maxload", "Maximum load to stop accepting new calls", "")
-maxload.rmempty = true
-
-nocolor = asterisk:option(Flag, "nocolor", "Disable console colors", "")
-nocolor.rmempty = true
-
-record_cache_dir = asterisk:option(Value, "record_cache_dir", "Sound files Cache directory", "")
-record_cache_dir.rmempty = true
-record_cache_dir:depends({ ["cache_record_files"] = "true" })
-
-rungroup = asterisk:option(Flag, "rungroup", "The Group to run as", "")
-rungroup.rmempty = true
-
-runuser = asterisk:option(Flag, "runuser", "The User to run as", "")
-runuser.rmempty = true
-
-spooldir = asterisk:option(Value, "spooldir", "Voicemail Spool directory", "")
-spooldir.rmempty = true
-
-systemname = asterisk:option(Value, "systemname", "Prefix UniquID with system name", "")
-systemname.rmempty = true
-
-transcode_via_sln = asterisk:option(Flag, "transcode_via_sln", "Build transcode paths via SLINEAR, not directly", "")
-transcode_via_sln.rmempty = true
-
-transmit_silence_during_record = asterisk:option(Flag, "transmit_silence_during_record", "Transmit SLINEAR silence while recording a channel", "")
-transmit_silence_during_record.rmempty = true
-
-verbose = asterisk:option(Value, "verbose", "Verbose Level", "")
-verbose.rmempty = true
-
-zone = asterisk:option(Value, "zone", "Time Zone", "")
-zone.rmempty = true
-
-
-hardwarereboot = cbimap:section(TypedSection, "hardwarereboot", "Reload Hardware Config", "")
-
-method = hardwarereboot:option(ListValue, "method", "Reboot Method", "")
-method:value("web", "Web URL (wget)")
-method:value("system", "program to run")
-method.rmempty = true
-
-param = hardwarereboot:option(Value, "param", "Parameter", "")
-param.rmempty = true
-
-
-iaxgeneral = cbimap:section(TypedSection, "iaxgeneral", "IAX General Options", "")
-iaxgeneral.anonymous = true
-iaxgeneral.addremove = true
-
-allow = iaxgeneral:option(MultiValue, "allow", "Allow Codecs", "")
-allow:value("alaw", "alaw")
-allow:value("gsm", "gsm")
-allow:value("g726", "g726")
-allow.rmempty = true
-
-canreinvite = iaxgeneral:option(ListValue, "canreinvite", "Reinvite/redirect media connections", "")
-canreinvite:value("yes", "Yes")
-canreinvite:value("nonat", "Yes when not behind NAT")
-canreinvite:value("update", "Use UPDATE rather than INVITE for path redirection")
-canreinvite:value("no", "No")
-canreinvite.rmempty = true
-
-static = iaxgeneral:option(Flag, "static", "Static", "")
-static.rmempty = true
-
-writeprotect = iaxgeneral:option(Flag, "writeprotect", "Write Protect", "")
-writeprotect.rmempty = true
-
-
-sipgeneral = cbimap:section(TypedSection, "sipgeneral", "Section sipgeneral", "")
-sipgeneral.anonymous = true
-sipgeneral.addremove = true
-
-allow = sipgeneral:option(MultiValue, "allow", "Allow codecs", "")
-allow:value("ulaw", "ulaw")
-allow:value("alaw", "alaw")
-allow:value("gsm", "gsm")
-allow:value("g726", "g726")
-allow.rmempty = true
-
-port = sipgeneral:option(Value, "port", "SIP Port", "")
-port.rmempty = true
-
-realm = sipgeneral:option(Value, "realm", "SIP realm", "")
-realm.rmempty = true
-
-
-moh = cbimap:section(TypedSection, "moh", "Music On Hold", "")
-
-application = moh:option(Value, "application", "Application", "")
-application.rmempty = true
-application:depends({ ["asterisk.moh.mode"] = "custom" })
-
-directory = moh:option(Value, "directory", "Directory of Music", "")
-directory.rmempty = true
-
-mode = moh:option(ListValue, "mode", "Option mode", "")
-mode:value("system", "program to run")
-mode:value("files", "Read files from directory")
-mode:value("quietmp3", "Quite MP3")
-mode:value("mp3", "Loud MP3")
-mode:value("mp3nb", "unbuffered MP3")
-mode:value("quietmp3nb", "Quiet Unbuffered MP3")
-mode:value("custom", "Run a custom application")
-mode.rmempty = true
-
-random = moh:option(Flag, "random", "Random Play", "")
-random.rmempty = true
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk/dialplan_out.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk/dialplan_out.lua
deleted file mode 100644
index 3115e10d6b..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk/dialplan_out.lua
+++ /dev/null
@@ -1,137 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
-]]--
-
-local ast = require("luci.asterisk")
-
-local function find_outgoing_contexts(uci)
- local c = { }
- local h = { }
-
--- uci:foreach("asterisk", "dialplan",
--- function(s)
--- if not h[s['.name']] then
--- c[#c+1] = { s['.name'], "Dialplan: %s" % s['.name'] }
--- h[s['.name']] = true
--- end
--- end)
-
- uci:foreach("asterisk", "dialzone",
- function(s)
- if not h[s['.name']] then
- c[#c+1] = { s['.name'], "Dialzone: %s" % s['.name'] }
- h[s['.name']] = true
- end
- end)
-
- return c
-end
-
-local function find_incoming_contexts(uci)
- local c = { }
- local h = { }
-
- uci:foreach("asterisk", "sip",
- function(s)
- if s.context and not h[s.context] and
- uci:get_bool("asterisk", s['.name'], "provider")
- then
- c[#c+1] = { s.context, "Incoming: %s" % s['.name'] or s.context }
- h[s.context] = true
- end
- end)
-
- return c
-end
-
-local function find_trunks(uci)
- local t = { }
-
- uci:foreach("asterisk", "sip",
- function(s)
- if uci:get_bool("asterisk", s['.name'], "provider") then
- t[#t+1] = {
- "SIP/%s" % s['.name'],
- "SIP: %s" % s['.name']
- }
- end
- end)
-
- uci:foreach("asterisk", "iax",
- function(s)
- t[#t+1] = {
- "IAX/%s" % s['.name'],
- "IAX: %s" % s.extension or s['.name']
- }
- end)
-
- return t
-end
-
---[[
-
-dialzone {name} - Outgoing zone.
- uses - Outgoing line to use: TYPE/Name
- match (list) - Number to match
- countrycode - The effective country code of this dialzone
- international (list) - International prefix to match
- localzone - dialzone for local numbers
- addprefix - Prexix required to dial out.
- localprefix - Prefix for a local call
-
-]]
-
-
---
--- SIP dialzone configuration
---
-if arg[1] then
- cbimap = Map("asterisk", "Edit Dialplan Entry")
-
- entry = cbimap:section(NamedSection, arg[1])
-
- back = entry:option(DummyValue, "_overview", "Back to dialplan overview")
- back.value = ""
- back.titleref = luci.dispatcher.build_url("admin", "asterisk", "dialplans")
-
- desc = entry:option(Value, "description", "Description")
- function desc.cfgvalue(self, s, ...)
- return Value.cfgvalue(self, s, ...) or s
- end
-
- match = entry:option(DynamicList, "match", "Number matches")
-
- intl = entry:option(DynamicList, "international", "Intl. prefix matches (optional)")
-
- trunk = entry:option(MultiValue, "uses", "Used trunk")
- for _, v in ipairs(find_trunks(cbimap.uci)) do
- trunk:value(unpack(v))
- end
-
- aprefix = entry:option(Value, "addprefix", "Add prefix to dial out (optional)")
- --ast.idd.cbifill(aprefix)
-
- ccode = entry:option(Value, "countrycode", "Effective countrycode (optional)")
- ast.cc.cbifill(ccode)
-
- lzone = entry:option(ListValue, "localzone", "Dialzone for local numbers")
- lzone:value("", "no special treatment of local numbers")
- for _, v in ipairs(find_outgoing_contexts(cbimap.uci)) do
- lzone:value(unpack(v))
- end
-
- lprefix = entry:option(Value, "localprefix", "Prefix for local calls (optional)")
-
- return cbimap
-end
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk/dialplans.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk/dialplans.lua
deleted file mode 100644
index 3a993da456..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk/dialplans.lua
+++ /dev/null
@@ -1,115 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
-]]--
-
-local ast = require("luci.asterisk")
-
-cbimap = Map("asterisk", "Registered Trunks")
-cbimap.pageaction = false
-
-local sip_peers = { }
-cbimap.uci:foreach("asterisk", "sip",
- function(s)
- if s.type == "peer" then
- s.name = s['.name']
- s.info = ast.sip.peer(s.name)
- sip_peers[s.name] = s
- end
- end)
-
-
-sip_table = cbimap:section(TypedSection, "sip", "SIP Trunks")
-sip_table.template = "cbi/tblsection"
-sip_table.extedit = luci.dispatcher.build_url("admin", "asterisk", "trunks", "sip", "%s")
-sip_table.addremove = true
-sip_table.sectionhead = "Extension"
-
-function sip_table.filter(self, s)
- return s and (
- cbimap.uci:get("asterisk", s, "type") == nil or
- cbimap.uci:get_bool("asterisk", s, "provider")
- )
-end
-
-function sip_table.create(self, section)
- if TypedSection.create(self, section) then
- created = section
- else
- self.invalid_cts = true
- end
-end
-
-function sip_table.parse(self, ...)
- TypedSection.parse(self, ...)
- if created then
- cbimap.uci:tset("asterisk", created, {
- type = "friend",
- qualify = "yes",
- provider = "yes"
- })
-
- cbimap.uci:save("asterisk")
- luci.http.redirect(luci.dispatcher.build_url(
- "admin", "asterisk", "trunks", "sip", created
- ))
- end
-end
-
-
-user = sip_table:option(DummyValue, "username", "Username")
-
-host = sip_table:option(DummyValue, "host", "Hostname")
-function host.cfgvalue(self, s)
- if sip_peers[s] and sip_peers[s].info.address then
- return "%s:%i" %{ sip_peers[s].info.address, sip_peers[s].info.port }
- else
- return "n/a"
- end
-end
-
-context = sip_table:option(DummyValue, "context", "Dialplan")
-context.href = luci.dispatcher.build_url("admin", "asterisk", "dialplan")
-function context.cfgvalue(...)
- return AbstractValue.cfgvalue(...) or "(default)"
-end
-
-online = sip_table:option(DummyValue, "online", "Registered")
-function online.cfgvalue(self, s)
- if sip_peers[s] and sip_peers[s].info.online == nil then
- return "n/a"
- else
- return sip_peers[s] and sip_peers[s].info.online
- and "yes" or "no (%s)" %{
- sip_peers[s] and sip_peers[s].info.Status:lower() or "unknown"
- }
- end
-end
-
-delay = sip_table:option(DummyValue, "delay", "Delay")
-function delay.cfgvalue(self, s)
- if sip_peers[s] and sip_peers[s].info.online then
- return "%i ms" % sip_peers[s].info.delay
- else
- return "n/a"
- end
-end
-
-info = sip_table:option(Button, "_info", "Info")
-function info.write(self, s)
- luci.http.redirect(luci.dispatcher.build_url(
- "admin", "asterisk", "trunks", "sip", s, "info"
- ))
-end
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk/dialzones.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk/dialzones.lua
deleted file mode 100644
index 4867911c54..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk/dialzones.lua
+++ /dev/null
@@ -1,135 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id: trunks.lua 4025 2009-01-11 23:37:21Z jow $
-
-]]--
-
-local ast = require("luci.asterisk")
-local uci = require("luci.model.uci").cursor()
-
---[[
- Dialzone overview table
-]]
-
-if not arg[1] then
- zonemap = Map("asterisk", "Dial Zones", [[
- Dial zones hold patterns of dialed numbers to match.
- Each zone has one or more trunks assigned. If the first trunk is
- congested, Asterisk will try to use the next available connection.
- If all trunks fail, then the following zones in the parent dialplan
- are tried.
- ]])
-
- local zones, znames = ast.dialzone.zones()
-
- zonetbl = zonemap:section(Table, zones, "Zone Overview")
- zonetbl.sectionhead = "Zone"
- zonetbl.addremove = true
- zonetbl.anonymous = false
- zonetbl.extedit = luci.dispatcher.build_url(
- "admin", "asterisk", "dialplans", "zones", "%s"
- )
-
- function zonetbl.cfgsections(self)
- return znames
- end
-
- function zonetbl.parse(self)
- for k, v in pairs(self.map:formvaluetable(
- luci.cbi.REMOVE_PREFIX .. self.config
- ) or {}) do
- if k:sub(-2) == ".x" then k = k:sub(1, #k - 2) end
- uci:delete("asterisk", k)
- uci:save("asterisk")
- self.data[k] = nil
- for i = 1,#znames do
- if znames[i] == k then
- table.remove(znames, i)
- break
- end
- end
- end
-
- Table.parse(self)
- end
-
- zonetbl:option(DummyValue, "description", "Description")
- zonetbl:option(DummyValue, "addprefix")
-
- match = zonetbl:option(DummyValue, "matches")
- function match.cfgvalue(self, s)
- return table.concat(zones[s].matches, ", ")
- end
-
- trunks = zonetbl:option(DummyValue, "trunk")
- trunks.template = "asterisk/cbi/cell"
- function trunks.cfgvalue(self, s)
- return ast.tools.hyperlinks(zones[s].trunks)
- end
-
- return zonemap
-
---[[
- Zone edit form
-]]
-
-else
- zoneedit = Map("asterisk", "Edit Dialzone")
-
- entry = zoneedit:section(NamedSection, arg[1])
- entry.title = "Zone %q" % arg[1];
-
- back = entry:option(DummyValue, "_overview", "Back to dialzone overview")
- back.value = ""
- back.titleref = luci.dispatcher.build_url(
- "admin", "asterisk", "dialplans", "zones"
- )
-
- desc = entry:option(Value, "description", "Description")
- function desc.cfgvalue(self, s, ...)
- return Value.cfgvalue(self, s, ...) or s
- end
-
- trunks = entry:option(MultiValue, "uses", "Used trunks")
- trunks.widget = "checkbox"
- uci:foreach("asterisk", "sip",
- function(s)
- if s.provider == "yes" then
- trunks:value(
- "SIP/%s" % s['.name'],
- "SIP/%s (%s)" %{ s['.name'], s.host or 'n/a' }
- )
- end
- end)
-
-
- match = entry:option(DynamicList, "match", "Number matches")
-
- intl = entry:option(DynamicList, "international", "Intl. prefix matches (optional)")
-
- aprefix = entry:option(Value, "addprefix", "Add prefix to dial out (optional)")
- ccode = entry:option(Value, "countrycode", "Effective countrycode (optional)")
-
- lzone = entry:option(ListValue, "localzone", "Dialzone for local numbers")
- lzone:value("", "no special treatment of local numbers")
- for _, z in ipairs(ast.dialzone.zones()) do
- lzone:value(z.name, "%q (%s)" %{ z.name, z.description })
- end
- --for _, v in ipairs(find_outgoing_contexts(zoneedit.uci)) do
- -- lzone:value(unpack(v))
- --end
-
- lprefix = entry:option(Value, "localprefix", "Prefix for local calls (optional)")
-
- return zoneedit
-
-end
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk/meetme.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk/meetme.lua
deleted file mode 100644
index b02a8f6120..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk/meetme.lua
+++ /dev/null
@@ -1,49 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2009 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-local ast = require "luci.asterisk"
-
-cbimap = Map("asterisk", "MeetMe - Rooms")
-
-meetme = cbimap:section(TypedSection, "meetme", "MeetMe Rooms")
-meetme.addremove = true
-meetme.anonymous = true
-meetme.template = "cbi/tblsection"
-meetme:option(Value, "_description", "Description", "Short room description")
-
-room = meetme:option(Value, "room", "Room Number", "Unique room identifier")
-
-function room.write(self, s, val)
- if val and #val > 0 then
- local old = self:cfgvalue(s)
- self.map.uci:foreach("asterisk", "dialplanmeetme",
- function(v)
- if v.room == old then
- self.map:set(v['.name'], "room", val)
- end
- end)
- Value.write(self, s, val)
- end
-end
-
-
-meetme:option(Value, "pin", "PIN", "PIN required to access")
-meetme:option(Value, "adminpin", "Admin PIN", "PIN required for administration")
-
-function meetme.remove(self, s)
- return ast.meetme.remove(self.map:get(s, "room"), self.map.uci)
-end
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk/meetme_settings.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk/meetme_settings.lua
deleted file mode 100644
index 511d7a71a7..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk/meetme_settings.lua
+++ /dev/null
@@ -1,28 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2009 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-cbimap = Map("asterisk", "MeetMe - Common Settings",
- "Common settings for MeetMe phone conferences.")
-
-meetme = cbimap:section(TypedSection, "meetmegeneral", "General MeetMe Options")
-meetme.addremove = false
-meetme.anonymous = true
-
-audiobuffers = meetme:option(ListValue, "audiobuffers",
- "Number of 20ms audio buffers to use for conferences")
-
-for i = 2, 32 do audiobuffers:value(i) end
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk/phone_sip.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk/phone_sip.lua
deleted file mode 100644
index 49d3a07763..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk/phone_sip.lua
+++ /dev/null
@@ -1,157 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
-]]--
-
-local ast = require("luci.asterisk")
-
-local function find_outgoing_contexts(uci)
- local c = { }
- local h = { }
-
- uci:foreach("asterisk", "dialplan",
- function(s)
- if not h[s['.name']] then
- c[#c+1] = { s['.name'], "Dialplan: %s" % s['.name'] }
- h[s['.name']] = true
- end
- end)
-
- return c
-end
-
-local function find_incoming_contexts(uci)
- local c = { }
- local h = { }
-
- uci:foreach("asterisk", "sip",
- function(s)
- if s.context and not h[s.context] and
- uci:get_bool("asterisk", s['.name'], "provider")
- then
- c[#c+1] = { s.context, "Incoming: %s" % s['.name'] or s.context }
- h[s.context] = true
- end
- end)
-
- return c
-end
-
-
---
--- SIP phone info
---
-if arg[2] == "info" then
- form = SimpleForm("asterisk", "SIP Phone Information")
- form.reset = false
- form.submit = "Back to overview"
-
- local info, keys = ast.sip.peer(arg[1])
- local data = { }
-
- for _, key in ipairs(keys) do
- data[#data+1] = {
- key = key,
- val = type(info[key]) == "boolean"
- and ( info[key] and "yes" or "no" )
- or ( info[key] == nil or #info[key] == 0 )
- and "(none)"
- or tostring(info[key])
- }
- end
-
- itbl = form:section(Table, data, "SIP Phone %q" % arg[1])
- itbl:option(DummyValue, "key", "Key")
- itbl:option(DummyValue, "val", "Value")
-
- function itbl.parse(...)
- luci.http.redirect(
- luci.dispatcher.build_url("admin", "asterisk", "phones")
- )
- end
-
- return form
-
---
--- SIP phone configuration
---
-elseif arg[1] then
- cbimap = Map("asterisk", "Edit SIP Client")
-
- peer = cbimap:section(NamedSection, arg[1])
- peer.hidden = {
- type = "friend",
- qualify = "yes",
- host = "dynamic",
- nat = "no",
- canreinvite = "no"
- }
-
- back = peer:option(DummyValue, "_overview", "Back to phone overview")
- back.value = ""
- back.titleref = luci.dispatcher.build_url("admin", "asterisk", "phones")
-
- active = peer:option(Flag, "disable", "Account enabled")
- active.enabled = "yes"
- active.disabled = "no"
- function active.cfgvalue(...)
- return AbstractValue.cfgvalue(...) or "yes"
- end
-
- exten = peer:option(Value, "extension", "Extension Number")
- cbimap.uci:foreach("asterisk", "dialplanexten",
- function(s)
- exten:value(
- s.extension,
- "%s (via %s/%s)" %{ s.extension, s.type:upper(), s.target }
- )
- end)
-
- display = peer:option(Value, "callerid", "Display Name")
-
- username = peer:option(Value, "username", "Authorization ID")
- password = peer:option(Value, "secret", "Authorization Password")
- password.password = true
-
- regtimeout = peer:option(Value, "registertimeout", "Registration Time Value")
- function regtimeout.cfgvalue(...)
- return AbstractValue.cfgvalue(...) or "60"
- end
-
- sipport = peer:option(Value, "port", "SIP Port")
- function sipport.cfgvalue(...)
- return AbstractValue.cfgvalue(...) or "5060"
- end
-
- linekey = peer:option(ListValue, "_linekey", "Linekey Mode (broken)")
- linekey:value("", "Off")
- linekey:value("trunk", "Trunk Appearance")
- linekey:value("call", "Call Appearance")
-
- dialplan = peer:option(ListValue, "context", "Assign Dialplan")
- dialplan.titleref = luci.dispatcher.build_url("admin", "asterisk", "dialplans")
- for _, v in ipairs(find_outgoing_contexts(cbimap.uci)) do
- dialplan:value(unpack(v))
- end
-
- incoming = peer:option(StaticList, "incoming", "Receive incoming calls from")
- for _, v in ipairs(find_incoming_contexts(cbimap.uci)) do
- incoming:value(unpack(v))
- end
-
- --function incoming.cfgvalue(...)
- --error(table.concat(MultiValue.cfgvalue(...),"."))
- --end
-
- return cbimap
-end
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk/phones.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk/phones.lua
deleted file mode 100644
index 7c8f03f000..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk/phones.lua
+++ /dev/null
@@ -1,116 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
-]]--
-
-local ast = require("luci.asterisk")
-
-cbimap = Map("asterisk", "Registered Phones")
-cbimap.pageaction = false
-
-local sip_peers = { }
-cbimap.uci:foreach("asterisk", "sip",
- function(s)
- if s.type ~= "peer" then
- s.name = s['.name']
- s.info = ast.sip.peer(s.name)
- sip_peers[s.name] = s
- end
- end)
-
-
-sip_table = cbimap:section(TypedSection, "sip", "SIP Phones")
-sip_table.template = "cbi/tblsection"
-sip_table.extedit = luci.dispatcher.build_url("admin", "asterisk", "phones", "sip", "%s")
-sip_table.addremove = true
-
-function sip_table.filter(self, s)
- return s and not cbimap.uci:get_bool("asterisk", s, "provider")
-end
-
-function sip_table.create(self, section)
- if TypedSection.create(self, section) then
- created = section
- cbimap.uci:tset("asterisk", section, {
- type = "friend",
- qualify = "yes",
- provider = "no",
- host = "dynamic",
- nat = "no",
- canreinvite = "no",
- extension = section:match("^%d+$") and section or "",
- username = section:match("^%d+$") and section or ""
- })
- else
- self.invalid_cts = true
- end
-end
-
-function sip_table.parse(self, ...)
- TypedSection.parse(self, ...)
- if created then
- cbimap.uci:save("asterisk")
- luci.http.redirect(luci.dispatcher.build_url(
- "admin", "asterisk", "phones", "sip", created
- ))
- end
-end
-
-
-user = sip_table:option(DummyValue, "username", "Username")
-function user.cfgvalue(self, s)
- return sip_peers[s] and sip_peers[s].callerid or
- AbstractValue.cfgvalue(self, s)
-end
-
-host = sip_table:option(DummyValue, "host", "Hostname")
-function host.cfgvalue(self, s)
- if sip_peers[s] and sip_peers[s].info.address then
- return "%s:%i" %{ sip_peers[s].info.address, sip_peers[s].info.port }
- else
- return "n/a"
- end
-end
-
-context = sip_table:option(DummyValue, "context", "Dialplan")
-context.href = luci.dispatcher.build_url("admin", "asterisk", "dialplan")
-
-online = sip_table:option(DummyValue, "online", "Registered")
-function online.cfgvalue(self, s)
- if sip_peers[s] and sip_peers[s].info.online == nil then
- return "n/a"
- else
- return sip_peers[s] and sip_peers[s].info.online
- and "yes" or "no (%s)" % {
- sip_peers[s] and sip_peers[s].info.Status:lower() or "unknown"
- }
- end
-end
-
-delay = sip_table:option(DummyValue, "delay", "Delay")
-function delay.cfgvalue(self, s)
- if sip_peers[s] and sip_peers[s].info.online then
- return "%i ms" % sip_peers[s].info.delay
- else
- return "n/a"
- end
-end
-
-info = sip_table:option(Button, "_info", "Info")
-function info.write(self, s)
- luci.http.redirect(luci.dispatcher.build_url(
- "admin", "asterisk", "phones", "sip", s, "info"
- ))
-end
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk/trunk_sip.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk/trunk_sip.lua
deleted file mode 100644
index e2e73eefbe..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk/trunk_sip.lua
+++ /dev/null
@@ -1,98 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
-]]--
-
-local ast = require("luci.asterisk")
-
---
--- SIP trunk info
---
-if arg[2] == "info" then
- form = SimpleForm("asterisk", "SIP Trunk Information")
- form.reset = false
- form.submit = "Back to overview"
-
- local info, keys = ast.sip.peer(arg[1])
- local data = { }
-
- for _, key in ipairs(keys) do
- data[#data+1] = {
- key = key,
- val = type(info[key]) == "boolean"
- and ( info[key] and "yes" or "no" )
- or ( info[key] == nil or #info[key] == 0 )
- and "(none)"
- or tostring(info[key])
- }
- end
-
- itbl = form:section(Table, data, "SIP Trunk %q" % arg[1])
- itbl:option(DummyValue, "key", "Key")
- itbl:option(DummyValue, "val", "Value")
-
- function itbl.parse(...)
- luci.http.redirect(
- luci.dispatcher.build_url("admin", "asterisk", "trunks")
- )
- end
-
- return form
-
---
--- SIP trunk config
---
-elseif arg[1] then
- cbimap = Map("asterisk", "Edit SIP Trunk")
-
- peer = cbimap:section(NamedSection, arg[1])
- peer.hidden = {
- type = "peer",
- qualify = "yes",
- }
-
- back = peer:option(DummyValue, "_overview", "Back to trunk overview")
- back.value = ""
- back.titleref = luci.dispatcher.build_url("admin", "asterisk", "trunks")
-
- sipdomain = peer:option(Value, "host", "SIP Domain")
- sipport = peer:option(Value, "port", "SIP Port")
- function sipport.cfgvalue(...)
- return AbstractValue.cfgvalue(...) or "5060"
- end
-
- username = peer:option(Value, "username", "Authorization ID")
- password = peer:option(Value, "secret", "Authorization Password")
- password.password = true
-
- outboundproxy = peer:option(Value, "outboundproxy", "Outbound Proxy")
- outboundport = peer:option(Value, "outboundproxyport", "Outbound Proxy Port")
-
- register = peer:option(Flag, "register", "Register with peer")
- register.enabled = "yes"
- register.disabled = "no"
-
- regext = peer:option(Value, "registerextension", "Extension to register (optional)")
- regext:depends({register="1"})
-
- didval = peer:option(ListValue, "_did", "Number of assigned DID numbers")
- didval:value("", "(none)")
- for i=1,24 do didval:value(i) end
-
- dialplan = peer:option(ListValue, "context", "Dialplan Context")
- dialplan:value(arg[1] .. "_inbound", "(default)")
- cbimap.uci:foreach("asterisk", "dialplan",
- function(s) dialplan:value(s['.name']) end)
-
- return cbimap
-end
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk/trunks.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk/trunks.lua
deleted file mode 100644
index 85527c297c..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk/trunks.lua
+++ /dev/null
@@ -1,106 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
-]]--
-
-local ast = require("luci.asterisk")
-
-cbimap = Map("asterisk", "Trunks")
-cbimap.pageaction = false
-
-local sip_peers = { }
-cbimap.uci:foreach("asterisk", "sip",
- function(s)
- if s.type == "peer" then
- s.name = s['.name']
- s.info = ast.sip.peer(s.name)
- sip_peers[s.name] = s
- end
- end)
-
-
-sip_table = cbimap:section(TypedSection, "sip", "SIP Trunks")
-sip_table.template = "cbi/tblsection"
-sip_table.extedit = luci.dispatcher.build_url("admin", "asterisk", "trunks", "sip", "%s")
-sip_table.addremove = true
-sip_table.sectionhead = "Extension"
-
-function sip_table.filter(self, s)
- return s and (
- cbimap.uci:get("asterisk", s, "type") == nil or
- cbimap.uci:get_bool("asterisk", s, "provider")
- )
-end
-
-function sip_table.create(self, section)
- if TypedSection.create(self, section) then
- created = section
- else
- self.invalid_cts = true
- end
-end
-
-function sip_table.parse(self, ...)
- TypedSection.parse(self, ...)
- if created then
- cbimap.uci:tset("asterisk", created, {
- type = "friend",
- qualify = "yes",
- provider = "yes"
- })
-
- cbimap.uci:save("asterisk")
- luci.http.redirect(luci.dispatcher.build_url(
- "admin", "asterisk", "trunks", "sip", created
- ))
- end
-end
-
-
-user = sip_table:option(DummyValue, "username", "Username")
-
-context = sip_table:option(DummyValue, "context", "Dialplan")
-context.href = luci.dispatcher.build_url("admin", "asterisk", "dialplan")
-function context.cfgvalue(...)
- return AbstractValue.cfgvalue(...) or "(default)"
-end
-
-online = sip_table:option(DummyValue, "online", "Registered")
-function online.cfgvalue(self, s)
- if sip_peers[s] and sip_peers[s].info.online == nil then
- return "n/a"
- else
- return sip_peers[s] and sip_peers[s].info.online
- and "yes" or "no (%s)" %{
- sip_peers[s] and sip_peers[s].info.Status:lower() or "unknown"
- }
- end
-end
-
-delay = sip_table:option(DummyValue, "delay", "Delay")
-function delay.cfgvalue(self, s)
- if sip_peers[s] and sip_peers[s].info.online then
- return "%i ms" % sip_peers[s].info.delay
- else
- return "n/a"
- end
-end
-
-info = sip_table:option(Button, "_info", "Info")
-function info.write(self, s)
- luci.http.redirect(luci.dispatcher.build_url(
- "admin", "asterisk", "trunks", "sip", s, "info"
- ))
-end
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk/voicemail.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk/voicemail.lua
deleted file mode 100644
index 5d0de756b3..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk/voicemail.lua
+++ /dev/null
@@ -1,59 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2009 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-local ast = require "luci.asterisk"
-
-cbimap = Map("asterisk", "Voicemail - Mailboxes")
-
-voicemail = cbimap:section(TypedSection, "voicemail", "Voicemail Boxes")
-voicemail.addremove = true
-voicemail.anonymous = true
-voicemail.template = "cbi/tblsection"
-
-context = voicemail:option(ListValue, "context", "Context")
-context:value("default")
-
-number = voicemail:option(Value, "number",
- "Mailbox Number", "Unique mailbox identifier")
-
-function number.write(self, s, val)
- if val and #val > 0 then
- local old = self:cfgvalue(s)
- self.map.uci:foreach("asterisk", "dialplanvoice",
- function(v)
- if v.voicebox == old then
- self.map:set(v['.name'], "voicebox", val)
- end
- end)
- Value.write(self, s, val)
- end
-end
-
-
-voicemail:option(Value, "name", "Ownername", "Human readable display name")
-voicemail:option(Value, "password", "Password", "Access protection")
-voicemail:option(Value, "email", "eMail", "Where to send voice messages")
-voicemail:option(Value, "page", "Pager", "Pager number")
-
-zone = voicemail:option(ListValue, "zone", "Timezone", "Used time format")
-zone.titleref = luci.dispatcher.build_url("admin/asterisk/voicemail/settings")
-cbimap.uci:foreach("asterisk", "voicezone",
- function(s) zone:value(s['.name']) end)
-
-function voicemail.remove(self, s)
- return ast.voicemail.remove(self.map:get(s, "number"), self.map.uci)
-end
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/model/cbi/asterisk/voicemail_settings.lua b/applications/luci-asterisk/luasrc/model/cbi/asterisk/voicemail_settings.lua
deleted file mode 100644
index cad2adb95f..0000000000
--- a/applications/luci-asterisk/luasrc/model/cbi/asterisk/voicemail_settings.lua
+++ /dev/null
@@ -1,62 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2009 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-require "luci.sys.zoneinfo"
-
-
-cbimap = Map("asterisk", "Voicemail - Common Settings")
-
-voicegeneral = cbimap:section(TypedSection, "voicegeneral",
- "General Voicemail Options", "Common settings for all mailboxes are " ..
- "defined here. Most of them are optional. The storage format should " ..
- "never be changed once set.")
-
-voicegeneral.anonymous = true
-voicegeneral.addremove = false
-
-format = voicegeneral:option(MultiValue, "Used storage formats")
-format.widget = "checkbox"
-format:value("wav49")
-format:value("gsm")
-format:value("wav")
-
-voicegeneral:option(Flag, "sendvoicemail", "Enable sending of emails")
-voicegeneral:option(Flag, "attach", "Attach voice messages to emails")
-voicegeneral:option(Value, "serveremail", "Used email sender address")
-voicegeneral:option(Value, "emaildateformat", "Date format used in emails").optional = true
-voicegeneral:option(Value, "maxlogins", "Max. failed login attempts").optional = true
-voicegeneral:option(Value, "maxmsg", "Max. allowed messages per mailbox").optional = true
-voicegeneral:option(Value, "minmessage", "Min. number of seconds for voicemail").optional = true
-voicegeneral:option(Value, "maxmessage", "Max. number of seconds for voicemail").optional = true
-voicegeneral:option(Value, "maxsilence", "Seconds of silence until stop recording").optional = true
-voicegeneral:option(Value, "maxgreet", "Max. number of seconds for greetings").optional = true
-voicegeneral:option(Value, "skipms", "Milliseconds to skip for rew./ff.").optional = true
-voicegeneral:option(Value, "silencethreshold", "Threshold to detect silence").optional = true
-
-
-voicezone = cbimap:section(TypedSection, "voicezone", "Time Zones",
- "Time zones define how dates and times are expressen when used in " ..
- "an voice mails. Refer to the asterisk manual for placeholder values.")
-
-voicezone.addremove = true
-voicezone.sectionhead = "Name"
-voicezone.template = "cbi/tblsection"
-
-tz = voicezone:option(ListValue, "zone", "Location")
-for _, z in ipairs(luci.sys.zoneinfo.TZ) do tz:value(z[1]) end
-
-voicezone:option(Value, "message", "Date Format")
-
-
-return cbimap
diff --git a/applications/luci-asterisk/luasrc/view/asterisk/cbi/cell.htm b/applications/luci-asterisk/luasrc/view/asterisk/cbi/cell.htm
deleted file mode 100644
index b5d618ff95..0000000000
--- a/applications/luci-asterisk/luasrc/view/asterisk/cbi/cell.htm
+++ /dev/null
@@ -1,22 +0,0 @@
-<%#
-LuCI - Lua Configuration Interface
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id: dvalue.htm 3367 2008-09-19 10:42:02Z Cyrus $
-
--%>
-
-<%+cbi/valueheader%>
-<% if self.href then %><a href="<%=self.href%>"><% end -%>
- <%=self:cfgvalue(section)%>
-<%- if self.href then %></a><%end%>
-&#160;
-<input type="hidden" id="<%=cbid%>" value="<%=luci.util.pcdata(self:cfgvalue(section))%>" />
-<%+cbi/valuefooter%>
diff --git a/applications/luci-asterisk/luasrc/view/asterisk/dialplans.htm b/applications/luci-asterisk/luasrc/view/asterisk/dialplans.htm
deleted file mode 100644
index a46a8db179..0000000000
--- a/applications/luci-asterisk/luasrc/view/asterisk/dialplans.htm
+++ /dev/null
@@ -1,254 +0,0 @@
-<%#
-LuCI - Lua Configuration Interface
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
--%>
-
-<%+header%>
-
-<%
- local uci = luci.model.uci.cursor_state()
- local ast = require "luci.asterisk"
-
- function digit_pattern(s,t)
- return "<code style='padding: 2px; border:1px solid #CCCCCC; background-color: #FFFFFF'%s>%s</code>"
- %{ t and " title='" .. t .. "'" or "", s }
- end
-
- function rowstyle(i)
- return "cbi-rowstyle-%i" %{
- ( i % 2 ) == 0 and 2 or 1
- }
- end
-
- function format_matches(z)
- local html = { }
-
- if type(z) ~= "table" then
- z = { matches = { z } }
- end
-
- if z.localprefix then
- for _, m in ipairs(z.matches) do
- html[#html+1] =
- digit_pattern(z.localprefix, "local prefix") .. " " ..
- digit_pattern(m)
- end
- end
-
- if z.intlmatches and #z.intlmatches > 0 then
- for _, i in ipairs(z.intlmatches) do
- for _, m in ipairs(z.matches) do
- html[#html+1] = "%s %s" %{
- digit_pattern("(%s)" % i, "intl. prefix"),
- digit_pattern(m)
- }
- end
- end
- else
- for _, m in ipairs(z.matches) do
- html[#html+1] = digit_pattern(m)
- end
- end
-
- return table.concat(html, "; ")
- end
-%>
-
-
-<form method="post" action="<%=luci.dispatcher.build_url("admin", "asterisk", "dialplans")%>" enctype="multipart/form-data">
- <div>
- <script type="text/javascript" src="/luci-static/resources/cbi.js"></script>
- <input type="hidden" name="cbi.submit" value="1" />
- <input type="submit" value="Save" class="hidden" />
- </div>
-
-<div class="cbi-map" id="cbi-asterisk">
- <h2><a id="content" name="content">Outgoing Call Routing</a></h2>
- <div class="cbi-map-descr">
- Here you can manage your dial plans which are used to route outgoing calls from your local extensions.<br /><br />
- Related tasks:<br />
- <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans/zones')%>" class="cbi-title-ref">Manage dialzones</a> |
- <a href="<%=luci.dispatcher.build_url('admin/asterisk/voicemail/mailboxes')%>" class="cbi-title-ref">Manage voicemail boxes</a> |
- <a href="<%=luci.dispatcher.build_url('admin/asterisk/meetme/rooms')%>" class="cbi-title-ref">Manage meetme rooms</a>
- </div>
- <!-- tblsection -->
- <fieldset class="cbi-section" id="cbi-asterisk-sip">
- <!--<legend>Dialplans</legend>-->
- <div class="cbi-section-descr"></div>
-
- <% for i, plan in pairs(ast.dialplan.plans()) do %>
- <div class="cbi-section-node">
- <table class="cbi-section-table">
- <tr class="cbi-section-table-titles">
- <th style="text-align: left; padding: 3px" class="cbi-section-table-cell">
- <big>Dialplan <em><%=plan.name%></em></big>
- </th>
- <td>
- <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans')%>?delplan=<%=plan.name%>">
- <img style="border:none" alt="Remove this dialplan" title="Remove this dialplan" src="/luci-static/resources/cbi/remove.gif" />
- </a>
- </td>
- </tr>
-
- <!-- dialzones -->
- <% local zones_used = { }; local row = 0 %>
- <% for i, zone in ipairs(plan.zones) do zones_used[zone.name] = true %>
- <tr class="cbi-section-table-row <%=rowstyle(row)%>">
- <td style="text-align: left; padding: 3px" class="cbi-section-table-cell">
- <strong>&#x2514; Dialzone <em><%=zone.name%></em></strong> (<%=zone.description%>)
- <p style="padding-left: 1em; margin-bottom:0">
- Lines:
- <%=ast.tools.hyperlinks(
- zone.trunks, function(v)
- return luci.dispatcher.build_url("admin", "asterisk", "trunks", "%s") % v:lower()
- end
- )%><br />
- Matches:
- <%=format_matches(zone)%>
- </p>
- </td>
- <td style="width:5%" class="cbi-value-field">
- <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans/out', zone.name)%>">
- <img style="border:none" alt="Edit dialzone" title="Edit dialzone" src="/luci-static/resources/cbi/edit.gif" />
- </a>
- <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans')%>?delzone.<%=plan.name%>=<%=zone.name%>">
- <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" />
- </a>
- </td>
- </tr>
- <% row = row + 1; end %>
- <!-- /dialzones -->
-
- <!-- voicemail -->
- <% local boxes_used = { } %>
- <% for ext, box in luci.util.kspairs(plan.voicemailboxes) do boxes_used[box.id] = true %>
- <tr class="cbi-section-table-row <%=rowstyle(row)%>">
- <td style="text-align: left; padding: 3px" class="cbi-section-table-cell">
- <strong>&#x2514; Voicemailbox <em><%=box.id%></em></strong> (<%=box.name%>)
- <p style="padding-left: 1em; margin-bottom:0">
- Owner: <%=box.name%> |
- eMail: <%=#box.email > 0 and box.email or 'n/a'%> |
- Pager: <%=#box.page > 0 and box.page or 'n/a'%><br />
- Matches: <%=format_matches(ext)%>
- </p>
- </td>
- <td style="width:5%" class="cbi-value-field">
- <a href="<%=luci.dispatcher.build_url('admin/asterisk/voicemail/mailboxes')%>">
- <img style="border:none" alt="Manage mailboxes ..." title="Manage mailboxes ..." src="/luci-static/resources/cbi/edit.gif" />
- </a>
- <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans')%>?delvbox.<%=plan.name%>=<%=ext%>">
- <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" />
- </a>
- </td>
- </tr>
- <% row = row + 1; end %>
- <!-- /voicemail -->
-
- <!-- meetme -->
- <% local rooms_used = { } %>
- <% for ext, room in luci.util.kspairs(plan.meetmerooms) do rooms_used[room.room] = true %>
- <tr class="cbi-section-table-row <%=rowstyle(row)%>">
- <td style="text-align: left; padding: 3px" class="cbi-section-table-cell">
- <strong>&#x2514; MeetMe Room <em><%=room.room%></em></strong>
- <% if room.description and #room.description > 0 then %> (<%=room.description%>)<% end %>
- <p style="padding-left: 1em; margin-bottom:0">
- Matches: <%=format_matches(ext)%>
- </p>
- </td>
- <td style="width:5%" class="cbi-value-field">
- <a href="<%=luci.dispatcher.build_url('admin/asterisk/meetme/rooms')%>">
- <img style="border:none" alt="Manage conferences ..." title="Manage conferences ..." src="/luci-static/resources/cbi/edit.gif" />
- </a>
- <a href="<%=luci.dispatcher.build_url('admin/asterisk/dialplans')%>?delmeetme.<%=plan.name%>=<%=ext%>">
- <img style="border:none" alt="Remove from this dialplan" title="Remove from this dialplan" src="/luci-static/resources/cbi/remove.gif" />
- </a>
- </td>
- </tr>
- <% row = row + 1; end %>
- <!-- /meetme -->
-
- <tr class="cbi-section-table-row">
- <td style="text-align: left; padding: 3px" class="cbi-section-table-cell" colspan="2">
- <hr style="margin-bottom:0.5em; border-width:0 0 1px 0" />
-
- Add Dialzone:<br />
- <select style="width:30%" name="addzone.<%=plan.name%>">
- <option value="">-- please select --</option>
- <% for _, zone in luci.util.kspairs(ast.dialzone.zones()) do %>
- <% if not zones_used[zone.name] then %>
- <option value="<%=zone.name%>"><%=zone.name%> (<%=zone.description%>)</option>
- <% end %>
- <% end %>
- </select>
- <br /><br />
-
- Add Voicemailbox:<br />
- <select style="width:20%" name="addvbox.<%=plan.name%>" onchange="this.form['addvboxext.<%=plan.name%>'].value=this.options[this.selectedIndex].value.split('@')[0]">
- <option value="">-- please select --</option>
- <% for ext, box in luci.util.kspairs(ast.voicemail.boxes()) do %>
- <% if not boxes_used[box.id] then %>
- <option value="<%=box.id%>"><%=box.id%> (<%=box.name%>)</option>
- <% end %>
- <% end %>
- </select>
- as extension
- <input type="text" style="width:5%" name="addvboxext.<%=plan.name%>" />
- <br /><br />
-
- Add MeetMe Conference:<br />
- <select style="width:20%" name="addmeetme.<%=plan.name%>" onchange="this.form['addmeetmeext.<%=plan.name%>'].value=this.options[this.selectedIndex].value">
- <option value="">-- please select --</option>
- <% for ext, room in luci.util.kspairs(ast.meetme.rooms()) do %>
- <%# if not rooms_used[room.room] then %>
- <option value="<%=room.room%>">
- <%=room.room%>
- <% if room.description and #room.description > 0 then %>(<%=room.description%>)<% end %>
- </option>
- <%# end %>
- <% end %>
- </select>
- as extension
- <input type="text" style="width:5%" name="addmeetmeext.<%=plan.name%>" />
- <br /><br />
-
- <input type="submit" class="cbi-button cbi-button-add" value="Add item &raquo;" title="Add item ..."/>
- </td>
- </tr>
-
- </table>
-
- <div class="cbi-section-create cbi-tblsection-create"></div>
- </div>
- <br />
- <% end %>
-
- <div class="cbi-section-node">
- <div class="cbi-section-create cbi-tblsection-create" style="padding: 3px">
- <h3>Create a new dialplan</h3>
- The name is required and must be unique. It may only contain the characters A-Z, a-z, 0-9 and _ .<br />
-
- <%- if create_error then %>
- <br /><span style="color:red">Invalid name given!</span><br />
- <% end -%>
-
- <br />
- <input type="text" class="cbi-section-create-name" name="addplan" style="width:200px" />
- <input type="submit" class="cbi-button cbi-button-add" value="Add dialplan" title="Add dialplan"/>
- </div>
- </div>
-
- </fieldset>
-</div>
-</form>
-<div class="clear"></div>
-<%+footer%>
diff --git a/applications/luci-asterisk/luasrc/view/asterisk/dialzones.htm b/applications/luci-asterisk/luasrc/view/asterisk/dialzones.htm
deleted file mode 100644
index f93496df8b..0000000000
--- a/applications/luci-asterisk/luasrc/view/asterisk/dialzones.htm
+++ /dev/null
@@ -1,174 +0,0 @@
-<%#
-LuCI - Lua Configuration Interface
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
--%>
-
-<%+header%>
-
-<%
- local uci = luci.model.uci.cursor_state()
- local ast = require("luci.asterisk")
-
- function digit_pattern(s)
- return "<code style='padding: 2px; border:1px solid #CCCCCC; background-color: #FFFFFF'>%s</code>" % s
- end
-
- function rowstyle(i)
- return "cbi-rowstyle-%i" %{
- ( i % 2 ) == 0 and 2 or 1
- }
- end
-
- local function find_trunks()
- local t = { }
-
- uci:foreach("asterisk", "sip",
- function(s)
- if uci:get_bool("asterisk", s['.name'], "provider") then
- t[#t+1] = {
- "SIP/%s" % s['.name'],
- "SIP: %s" % s['.name']
- }
- end
- end)
-
- uci:foreach("asterisk", "iax",
- function(s)
- t[#t+1] = {
- "IAX/%s" % s['.name'],
- "IAX: %s" % s.extension or s['.name']
- }
- end)
-
- return t
- end
-
-%>
-
-
-<form method="post" action="<%=luci.dispatcher.build_url("admin", "asterisk", "dialplans", "zones")%>" enctype="multipart/form-data">
- <div>
- <script type="text/javascript" src="/luci-static/resources/cbi.js"></script>
- <input type="hidden" name="cbi.submit" value="1" />
- <input type="submit" value="Save" class="hidden" />
- </div>
-
-<div class="cbi-map" id="cbi-asterisk">
- <h2><a id="content" name="content">Dial Zone Management</a></h2>
- <div class="cbi-map-descr">
- <a href="<%=luci.dispatcher.build_url("admin/asterisk/dialplans")%>" class="cbi-title-ref">Back to dialplan overview</a><br /><br />
- Here you can manage your dial zones. The zones are used to route outgoing calls to the destination.
- Each zone groups multiple trunks and number matches to represent a logical destination. Zones can
- also be used to enforce certain dial restrictions on selected extensions.
- </div>
-
- <!-- tblsection -->
- <fieldset class="cbi-section" id="cbi-asterisk-sip">
- <div class="cbi-section-node">
- <table class="cbi-section-table">
- <tr class="cbi-section-table-titles">
- <th style="text-align: left; padding: 3px" class="cbi-section-table-cell" colspan="6">
- <h3>Dialzone Overview</h3>
- </th>
- </tr>
-
- <tr class="cbi-section-table-descr">
- <th style="width: 5%; text-align:right" class="cbi-section-table-cell">Name</th>
- <th style="width: 5%; text-align:right" class="cbi-section-table-cell">Prepend</th>
- <th style="width: 20%; text-align:left" class="cbi-section-table-cell">- Match</th>
- <th style="text-align:left" class="cbi-section-table-cell">Trunk</th>
- <th style="width: 35%; text-align:left" class="cbi-section-table-cell">Description</th>
- <th style="width: 4%; text-align:left" class="cbi-section-table-cell"></th>
- </tr>
-
- <% for i, rule in pairs(ast.dialzone.zones()) do %>
- <tr class="cbi-section-table-row <%=rowstyle(i)%>">
- <td style="text-align:right" class="cbi-value-field">
- <%=rule.name%>
- </td>
- <td style="text-align:right" class="cbi-value-field">
- <% for _ in ipairs(rule.matches) do %>
- <%=rule.addprefix and digit_pattern(rule.addprefix)%>&#160;<br />
- <% end %>
- </td>
- <td style="text-align:left" class="cbi-value-field">
- <% for _, m in ipairs(rule.matches) do %>
- <%=rule.localprefix and "%s " % digit_pattern(rule.localprefix)%>
- <%=digit_pattern(m)%><br />
- <% end %>
- </td>
- <td style="text-align:left" class="cbi-value-field">
- <%=ast.tools.hyperlinks(
- rule.trunks, function(v)
- return luci.dispatcher.build_url("admin", "asterisk", "trunks", "%s") % v:lower()
- end
- )%>
- </td>
- <td style="text-align:left" class="cbi-value-field">
- <%=rule.description or rule.name%>
- </td>
- <td style="text-align:left" class="cbi-value-field">
- <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans', 'out', rule.name)%>">
- <img style="border:none" alt="Edit entry" title="Edit entry" src="/luci-static/resources/cbi/edit.gif" />
- </a>
- <a href="<%=luci.dispatcher.build_url('admin', 'asterisk', 'dialplans', 'zones')%>?delzone=<%=rule.name%>">
- <img style="border:none" alt="Delete entry" title="Delete entry" src="/luci-static/resources/cbi/remove.gif" />
- </a>
- </td>
- </tr>
- <% end %>
- </table>
- <div class="cbi-section-create cbi-tblsection-create"></div>
- </div>
- <br />
-
- <div class="cbi-section-node">
- <div class="cbi-section-create cbi-tblsection-create" style="padding: 3px">
- <h3>Create a new dialzone</h3>
- The name is required and must be unique. It may only contain the characters A-Z, a-z, 0-9 and _ .<br />
- You can specifiy multiple number matches by separating them with spaces.<br />
-
- <%- if create_error then %>
- <br /><span style="color:red">Invalid name given!</span><br />
- <% end -%>
-
- <table>
- <tr>
- <td style="padding:3px">
- <label for="create1">1) Name</label><br />
- <input type="text" class="cbi-section-create-name" id="create1" name="newzone_name" style="width:200px" />
- <br /><br />
-
- <label for="create2">2) Number Match</label><br />
- <input type="text" class="cbi-section-create-name" id="create2" name="newzone_match" style="width:200px" />
- </td>
- <td style="padding:3px">
- <label for="create3">3) Trunks</label><br />
- <select class="cbi-input-select" multiple="multiple" id="create3" name="newzone_uses" size="4" style="width:200px">
- <% for i, t in ipairs(find_trunks()) do %>
- <option value="<%=t[1]%>"><%=t[2]%></option>
- <% end %>
- </select>
- </td>
- </tr>
- </table>
- <br />
-
- <input type="submit" class="cbi-button cbi-button-add" name="newzone" value="Add entry" title="Add entry"/>
- </div>
- </div>
- </fieldset>
-</div>
-</form>
-<div class="clear"></div>
-<%+footer%>
diff --git a/applications/luci-asterisk/root/etc/config/asterisk b/applications/luci-asterisk/root/etc/config/asterisk
deleted file mode 100644
index 248409793c..0000000000
--- a/applications/luci-asterisk/root/etc/config/asterisk
+++ /dev/null
@@ -1,231 +0,0 @@
-config 'asterisk'
- option 'verbose' 3
- option 'debug' 3
- option 'zone' 'Australia/Perth'
-
-config 'hardware' 'reboot'
- option 'method' 'web'
- option 'param' 'http://ata.lan/admin/reboot'
-
-config 'feature' 'park'
- option 'parkenabled' 'yes'
- option 'parkext' '700'
- option 'parkpos' '701-720'
- option 'context' 'parkedcalls'
- option 'parkingtime' '45'
- option 'courtesytone' 'beep'
- option 'parkedplay' 'caller'
- option 'adsipark' 'yes'
- option 'findslot' 'first'
- option 'parkedmusicclass' 'default'
- option 'transferdigittimeout' '3'
- option 'xfersound' 'beep'
- option 'xferfailsound' 'beeperr'
- option 'pickupexten' '"*8"'
- option 'featuredigittimeout' '500'
- option 'atxfernoanswertimeout' '15'
-
-config 'feature' 'map'
- option 'blindxfer' '#1'
- option 'disconnect' '*0'
- option 'automon' '*1'
- option 'atxfer' '#2'
- option 'parkcall' '#30'
-
-config 'sipgeneral'
- option 'realm' 'sip.mydomain.net'
- option 'allow' 'alaw'
- option 'extension' '102'
-
-config 'module'
- option 'res_config_mysql' 'no'
- option 'res_crypto' 'auto'
- option 'chan_iax2' 'yes'
-
-config 'sip' 'PAP2T'
- option 'type' 'friend'
- option 'extension' '101'
- option 'username' 'PAP2T'
- option 'secret' 'mypass'
- option 'port' '5061'
- option 'host' ''
- option 'dtmfmode' 'rfc2833'
- option 'insecure' 'very'
- option 'context' 'internal'
- option 'mailbox' '1001@default'
- option 'nat' 'no'
- option 'canreinvite' 'nonat'
- option 'selfmailbox' 'yes'
- option 'incoming' 'provider_inbound'
-
-config 'sip' 'PAP2T2'
- option 'type' 'friend'
- option 'extension' '101'
- option 'username' 'PAP2T2'
- option 'secret' 'mysecret'
- option 'port' '5060'
- option 'host' ''
- option 'dtmfmode' 'rfc2833'
- option 'insecure' 'very'
- option 'context' 'internal'
- option 'mailbox' '1001@default'
- option 'nat' 'no'
- option 'canreinvite' 'nonat'
- option 'selfmailbox' 'yes'
- option 'incoming' 'provider_inbound'
-
-config 'sip' 'providerphone'
- option 'provider' 'yes'
- option 'type' 'friend'
- option 'timeout' '55'
- option 'internationalprefix' '0011'
- option 'alwaysinternational' 'no'
- option 'countrycode' '63'
- option 'register' 'yes'
- option 'host' '200.200.200.200'
- option 'username' '0899999999'
- option 'fromuser' '0899999999'
- option 'secret' 'mysecret'
- option 'fromdomain' 'providerphone.provider.net.au'
- option 'context' 'provider_inbound'
- option 'canreinvite' 'no'
- option 'nat' 'yes'
- option 'qualify' 'yes'
- option 'insecure' 'very'
- option 'pedantic' 'no'
- option 'qualify' '1000'
-
-config 'iaxgeneral'
- option 'static' 'yes'
- option 'writeprotect' 'no'
- option 'canreinvite' 'no'
- option 'allow' 'ulaw,gsm'
-
-config 'iax' 'nell'
- option 'type' 'friend'
- option 'extension' '108'
- option 'host' ''
- option 'username' 'nell'
- option 'secret' 'mypass'
- option 'context' 'internal'
-
-config 'iax' 'iax_vista'
- option 'extension' '106'
- option 'type' 'friend'
- option 'host' ''
- option 'username' 'vista'
- option 'secret' 'mysecret'
- option 'context' 'internal'
-
-config 'iax' 'sam'
- option 'type' 'friend'
- option 'extension' '103'
- option 'host' ''
- option 'username' 'sam'
- option 'secret' 'mysecret'
- option 'context' 'internal'
-
-config 'voicegeneral'
- option 'serveremail' 'voice@sip.mydomain.net'
-
-config 'voicemail'
- option 'number' '1001'
- option 'context' 'default'
- option 'password' '0000'
- option 'name' 'Family'
- option 'email' 'us@mydomain.net'
- option 'zone' 'wa'
- option 'attach' 'no'
-
-config 'voicezone' 'wa'
- option 'zone' 'Australia/Perth'
- option 'message' 'Q IMp'
-
-config 'voicezone' 'military'
- option 'zone' 'Zulu'
- option 'message' '"vm-received" q "digits/at" H N "hours" "phonetic/z_p"'
-
-config 'incominggeneral'
- option 'allowtransfer' 'no'
- option 'timeout' '20'
- option 'answerfirst' 'no'
- option 'mailbox' '1001@default'
-
-config 'dialplangeneral'
- option 'static' 'yes'
- option 'writeprotect' 'no'
- option 'canreinvite' 'no'
- option 'clearglobalvars' 'no'
- option 'allowtransfer' 'no'
-
-config 'dialplan' 'internal'
- option 'include' 'localcall interstate smartnumber emergency extensions'
-
-config 'dialplanvoice'
- option 'dialplan' 'internal'
- option 'extension' '1001'
- option 'voicecontext' 'default'
- option 'voicebox' '1001'
-
-config 'dialplansaytime'
- option 'dialplan' 'internal'
- option 'extension' '108'
-
-config 'dialplanmeetme'
- option 'dialplan' 'internal'
- option 'extension' '109'
- option 'room' '101'
-
-config 'dialplanmeetme'
- option 'dialplan' 'internal'
- option 'extension' '1009'
- option 'room' ''
-
-config 'dialplan' 'localinternational'
- option 'include' 'mobile interstate'
-
-config 'dialzone' 'interstate'
- option 'uses' 'SIP/providerphone'
- option 'match' '0[235-8]NXXXXXXX'
- option 'localprefix' '0'
-
-config 'dialzone' 'mobile'
- option 'uses' 'SIP/providerphone'
- option 'match' '04XXXXXXXX'
- option 'localprefix' '0'
-
-config 'dialzone' 'smartnumber'
- option 'uses' 'SIP/providerphone'
- option 'match' '1[835]00.'
- option 'match' '13ZXXX'
-
-config 'dialzone' 'emergency'
- option 'uses' 'SIP/providerphone'
- option 'match' '000'
- option 'match' '112'
-
-config 'dialzone' 'localcall'
- option 'uses' 'SIP/providerphone'
- option 'match' 'NXXXXXXX'
- option 'addprefix' '08'
- option 'localprefix' '0'
-
-config 'dialzone' 'international'
- option 'uses' 'SIP/providerphone'
- option 'international' '0011,+'
- option 'localzone' 'localinternational'
- option 'localprefix' '0'
- option 'addprefix' ''
-
-config 'meetmegeneral'
- option 'audiobuffers' '32'
-
-config 'meetme'
- option 'room' '101'
- option 'pin' ''
- option 'adminpin' ''
-
-config 'moh' 'default'
- option 'mode' 'files'
- option 'directory' '/opt/moh'
- option 'random' 'no'
diff --git a/applications/luci-asterisk/root/etc/uci-defaults/luci-asterisk b/applications/luci-asterisk/root/etc/uci-defaults/luci-asterisk
deleted file mode 100755
index e45819f602..0000000000
--- a/applications/luci-asterisk/root/etc/uci-defaults/luci-asterisk
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-uci -q batch <<-EOF >/dev/null
- delete ucitrack.@asterisk[-1]
- add ucitrack asterisk
- set ucitrack.@asterisk[-1].init=asterisk
- commit ucitrack
-EOF
-
-rm -f /tmp/luci-indexcache
-exit 0
diff --git a/applications/luci-coovachilli/Makefile b/applications/luci-coovachilli/Makefile
deleted file mode 100644
index a98ccb8473..0000000000
--- a/applications/luci-coovachilli/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-PO = coovachilli
-
-include ../../build/config.mk
-include ../../build/module.mk
diff --git a/applications/luci-coovachilli/luasrc/controller/coovachilli.lua b/applications/luci-coovachilli/luasrc/controller/coovachilli.lua
deleted file mode 100644
index 52e09f6f57..0000000000
--- a/applications/luci-coovachilli/luasrc/controller/coovachilli.lua
+++ /dev/null
@@ -1,29 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-module("luci.controller.coovachilli", package.seeall)
-
-function index()
-
- require("luci.i18n")
- local i18n = luci.i18n.translate
-
- local cc = entry( { "admin", "services", "coovachilli" }, cbi("coovachilli"), i18n("CoovaChilli"), 90)
- cc.i18n = "coovachilli"
- cc.subindex = true
-
- entry( { "admin", "services", "coovachilli", "network" }, cbi("coovachilli_network"), i18n("Network Configuration"), 10)
- entry( { "admin", "services", "coovachilli", "radius" }, cbi("coovachilli_radius"), i18n("RADIUS configuration"), 20)
- entry( { "admin", "services", "coovachilli", "auth" }, cbi("coovachilli_auth"), i18n("UAM and MAC Authentication"), 30)
-
-end
diff --git a/applications/luci-coovachilli/luasrc/model/cbi/coovachilli.lua b/applications/luci-coovachilli/luasrc/model/cbi/coovachilli.lua
deleted file mode 100644
index e97987dd7e..0000000000
--- a/applications/luci-coovachilli/luasrc/model/cbi/coovachilli.lua
+++ /dev/null
@@ -1,31 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-
-m = Map("coovachilli")
-
--- general
-s = m:section(TypedSection, "general")
-s.anonymous = true
-
-s:option( Flag, "debug" )
-s:option( Value, "interval" )
-s:option( Value, "pidfile" ).optional = true
-s:option( Value, "statedir" ).optional = true
-s:option( Value, "cmdsock" ).optional = true
-s:option( Value, "logfacility" ).optional = true
-
-
-return m
diff --git a/applications/luci-coovachilli/luasrc/model/cbi/coovachilli_auth.lua b/applications/luci-coovachilli/luasrc/model/cbi/coovachilli_auth.lua
deleted file mode 100644
index 064df2b4fa..0000000000
--- a/applications/luci-coovachilli/luasrc/model/cbi/coovachilli_auth.lua
+++ /dev/null
@@ -1,76 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-
-m = Map("coovachilli")
-
--- uam config
-s1 = m:section(TypedSection, "uam")
-s1.anonymous = true
-
-s1:option( Value, "uamserver" )
-s1:option( Value, "uamsecret" ).password = true
-
-s1:option( Flag, "uamanydns" )
-s1:option( Flag, "nouamsuccess" )
-s1:option( Flag, "nouamwispr" )
-s1:option( Flag, "chillixml" )
-s1:option( Flag, "uamanyip" ).optional = true
-s1:option( Flag, "dnsparanoia" ).optional = true
-s1:option( Flag, "usestatusfile" ).optional = true
-
-s1:option( Value, "uamhomepage" ).optional = true
-s1:option( Value, "uamlisten" ).optional = true
-s1:option( Value, "uamport" ).optional = true
-s1:option( Value, "uamiport" ).optional = true
-s1:option( DynamicList, "uamdomain" ).optional = true
-s1:option( Value, "uamlogoutip" ).optional = true
-s1:option( DynamicList, "uamallowed" ).optional = true
-s1:option( Value, "uamui" ).optional = true
-
-s1:option( Value, "wisprlogin" ).optional = true
-
-s1:option( Value, "defsessiontimeout" ).optional = true
-s1:option( Value, "defidletimeout" ).optional = true
-s1:option( Value, "definteriminterval" ).optional = true
-
-s1:option( Value, "ssid" ).optional = true
-s1:option( Value, "vlan" ).optional = true
-s1:option( Value, "nasip" ).optional = true
-s1:option( Value, "nasmac" ).optional = true
-s1:option( Value, "wwwdir" ).optional = true
-s1:option( Value, "wwwbin" ).optional = true
-
-s1:option( Value, "localusers" ).optional = true
-s1:option( Value, "postauthproxy" ).optional = true
-s1:option( Value, "postauthproxyport" ).optional = true
-s1:option( Value, "locationname" ).optional = true
-
-
--- mac authentication
-s2 = m:section(TypedSection, "macauth")
-s2.anonymous = true
-
-s2:option( Flag, "macauth" )
-s2:option( Flag, "macallowlocal" )
-s2:option( DynamicList, "macallowed" )
-
-pw = s2:option( Value, "macpasswd" )
-pw.optional = true
-pw.password = true
-
-s2:option( Value, "macsuffix" ).optional = true
-
-return m
diff --git a/applications/luci-coovachilli/luasrc/model/cbi/coovachilli_network.lua b/applications/luci-coovachilli/luasrc/model/cbi/coovachilli_network.lua
deleted file mode 100644
index 2e9768ff3d..0000000000
--- a/applications/luci-coovachilli/luasrc/model/cbi/coovachilli_network.lua
+++ /dev/null
@@ -1,67 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-require("luci.sys")
-require("luci.ip")
-
-m = Map("coovachilli")
-
--- tun
-s1 = m:section(TypedSection, "tun")
-s1.anonymous = true
-
-s1:option( Flag, "usetap" )
-s1:option( Value, "tundev" ).optional = true
-s1:option( Value, "txqlen" ).optional = true
-
-net = s1:option( Value, "net" )
-for _, route in ipairs(luci.sys.net.routes()) do
- if route.device ~= "lo" and route.dest:prefix() < 32 then
- net:value( route.dest:string() )
- end
-end
-
-s1:option( Value, "dynip" ).optional = true
-s1:option( Value, "statip" ).optional = true
-
-s1:option( Value, "dns1" ).optional = true
-s1:option( Value, "dns2" ).optional = true
-s1:option( Value, "domain" ).optional = true
-
-s1:option( Value, "ipup" ).optional = true
-s1:option( Value, "ipdown" ).optional = true
-
-s1:option( Value, "conup" ).optional = true
-s1:option( Value, "condown" ).optional = true
-
-
--- dhcp config
-s2 = m:section(TypedSection, "dhcp")
-s2.anonymous = true
-
-dif = s2:option( Value, "dhcpif" )
-for _, nif in ipairs(luci.sys.net.devices()) do
- if nif ~= "lo" then dif:value(nif) end
-end
-
-s2:option( Value, "dhcpmac" ).optional = true
-s2:option( Value, "lease" ).optional = true
-s2:option( Value, "dhcpstart" ).optional = true
-s2:option( Value, "dhcpend" ).optional = true
-
-s2:option( Flag, "eapolenable" )
-
-
-return m
diff --git a/applications/luci-coovachilli/luasrc/model/cbi/coovachilli_radius.lua b/applications/luci-coovachilli/luasrc/model/cbi/coovachilli_radius.lua
deleted file mode 100644
index ee838b0864..0000000000
--- a/applications/luci-coovachilli/luasrc/model/cbi/coovachilli_radius.lua
+++ /dev/null
@@ -1,67 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-
-m = Map("coovachilli")
-
--- radius server
-s1 = m:section(TypedSection, "radius")
-s1.anonymous = true
-
-s1:option( Value, "radiusserver1" )
-s1:option( Value, "radiusserver2" )
-s1:option( Value, "radiussecret" ).password = true
-
-s1:option( Value, "radiuslisten" ).optional = true
-s1:option( Value, "radiusauthport" ).optional = true
-s1:option( Value, "radiusacctport" ).optional = true
-
-s1:option( Value, "radiusnasid" ).optional = true
-s1:option( Value, "radiusnasip" ).optional = true
-
-s1:option( Value, "radiuscalled" ).optional = true
-s1:option( Value, "radiuslocationid" ).optional = true
-s1:option( Value, "radiuslocationname" ).optional = true
-
-s1:option( Value, "radiusnasporttype" ).optional = true
-
-s1:option( Flag, "radiusoriginalurl" )
-
-s1:option( Value, "adminuser" ).optional = true
-rs = s1:option( Value, "adminpassword" )
-rs.optional = true
-rs.password = true
-
-s1:option( Flag, "swapoctets" )
-s1:option( Flag, "openidauth" )
-s1:option( Flag, "wpaguests" )
-s1:option( Flag, "acctupdate" )
-
-s1:option( Value, "coaport" ).optional = true
-s1:option( Flag, "coanoipcheck" )
-
-
--- radius proxy
-s2 = m:section(TypedSection, "proxy")
-s2.anonymous = true
-
-s2:option( Value, "proxylisten" ).optional = true
-s2:option( Value, "proxyport" ).optional = true
-s2:option( Value, "proxyclient" ).optional = true
-ps = s2:option( Value, "proxysecret" )
-ps.optional = true
-ps.password = true
-
-return m
diff --git a/applications/luci-coovachilli/root/etc/config/coovachilli b/applications/luci-coovachilli/root/etc/config/coovachilli
deleted file mode 100644
index 0b6be2c593..0000000000
--- a/applications/luci-coovachilli/root/etc/config/coovachilli
+++ /dev/null
@@ -1,243 +0,0 @@
-##############################################################################
-#
-# Sample CoovaChilli configuration file
-#
-##############################################################################
-
-# General settings
-config general
-
- # Enable this flag to include debug information.
- option debug 0
-
- # Re-read configuration file at this interval. Will also cause new domain
- # name lookups to be performed. Value is given in seconds.
- option interval 3600
-
- # File to store information about the process id of the program.
- # The program must have write access to this file/directory.
- option pidfile /var/run/chilli.pid
-
- # Directory to use for nonvolatile storage.
- # The program must have write access to this directory.
- # This tag is currently ignored
- #option statedir ./
-
-
-# TUN parameters
-config tun
-
- # IP network address of external packet data network
- # Used to allocate dynamic IP addresses and set up routing.
- # Normally you do not need to uncomment this tag.
- option net 192.168.182.0/24
-
- # Dynamic IP address pool
- # Used to allocate dynamic IP addresses to clients.
- # If not set it defaults to the net tag.
- # Do not uncomment this tag unless you are an experienced user!
- #option dynip 192.168.182.0/24
-
- # Static IP address pool
- # Used to allocate static IP addresses to clients.
- # Do not uncomment this tag unless you are an experienced user!
- #option statip 192.168.182.0/24
-
- # Primary DNS server.
- # Will be suggested to the client.
- # If omitted the system default will be used.
- # Normally you do not need to uncomment this tag.
- #option dns1 172.16.0.5
-
- # Secondary DNS server.
- # Will be suggested to the client.
- # If omitted the system default will be used.
- # Normally you do not need to uncomment this tag.
- #option dns2 172.16.0.6
-
- # Domain name
- # Will be suggested to the client.
- # Normally you do not need to uncomment this tag.
- option domain key.chillispot.org
-
- # Script executed after network interface has been brought up.
- # Executed with the following parameters: <devicename> <ip address> <mask>
- # Normally you do not need to uncomment this tag.
- #option ipup /etc/chilli.ipup
-
- # Script executed after network interface has been taken down.
- # Executed with the following parameters: <devicename> <ip address> <mask>
- # Normally you do not need to uncomment this tag.
- #option ipdown /etc/chilli.ipdown
-
- # Script executed after a user has been authenticated.
- # Executed with the following parameters: <devicename> <ip address>
- # <mask> <user ip address> <user mac address> <filter ID>
- # Normally you do not need to uncomment this tag.
- #option conup /etc/chilli.conup
-
- # Script executed after a user has disconnected.
- # Executed with the following parameters: <devicename> <ip address>
- # <mask> <user ip address> <user mac address> <filter ID>
- # Normally you do not need to uncomment this tag.
- #option condown /etc/chilli.condown
-
-
-# DHCP Parameters
-config dhcp
-
- # Ethernet interface to listen to.
- # This is the network interface which is connected to the access points.
- # In a typical configuration this tag should be set to eth1.
- option dhcpif eth1
-
- # Use specified MAC address.
- # An address in the range 00:00:5E:00:02:00 - 00:00:5E:FF:FF:FF falls
- # within the IANA range of addresses and is not allocated for other
- # purposes.
- # Normally you do not need to uncomment this tag.
- #option dhcpmac 00:00:5E:00:02:00
-
- # Time before DHCP lease expires
- # Normally you do not need to uncomment this tag.
- #option lease 600
-
-
-# Radius parameters
-config radius
-
- # IP address to listen to
- # Normally you do not need to uncomment this tag.
- #option radiuslisten 127.0.0.1
-
- # IP address of radius server 1
- # For most installations you need to modify this tag.
- option radiusserver1 rad01.chillispot.org
-
- # IP address of radius server 2
- # If you have only one radius server you should set radiusserver2 to the
- # same value as radiusserver1.
- # For most installations you need to modify this tag.
- option radiusserver2 rad02.chillispot.org
-
- # Radius authentication port
- # The UDP port number to use for radius authentication requests.
- # The same port number is used for both radiusserver1 and radiusserver2.
- # Normally you do not need to uncomment this tag.
- #option radiusauthport 1812
-
- # Radius accounting port
- # The UDP port number to use for radius accounting requests.
- # The same port number is used for both radiusserver1 and radiusserver2.
- # Normally you do not need to uncomment this tag.
- #option radiusacctport 1813
-
- # Radius shared secret for both servers
- # For all installations you should modify this tag.
- #option radiussecret testing123
-
- # Radius NAS-Identifier
- # Normally you do not need to uncomment this tag.
- #option radiusnasid nas01
-
- # Radius NAS-IP-Address
- # Normally you do not need to uncomment this tag.
- #option radiusnasip 127.0.0.1
-
- # Radius Called-Station-ID
- # Normally you do not need to uncomment this tag.
- #option radiuscalled 00133300
-
- # WISPr Location ID. Should be in the format: isocc=<ISO_Country_Code>,
- # cc=<E.164_Country_Code>,ac=<E.164_Area_Code>,network=<ssid/ZONE>
- # Normally you do not need to uncomment this tag.
- #option radiuslocationid isocc=us,cc=1,ac=408,network=ACMEWISP_NewarkAirport
-
- # WISPr Location Name. Should be in the format:
- # <HOTSPOT_OPERATOR_NAME>,<LOCATION>
- # Normally you do not need to uncomment this tag.
- #option radiuslocationname ACMEWISP,Gate_14_Terminal_C_of_Newark_Airport
-
-
-# Radius proxy parameters
-config proxy
-
- # IP address to listen to
- # Normally you do not need to uncomment this tag.
- #option proxylisten 10.0.0.1
-
- # UDP port to listen to.
- # If not specified a port will be selected by the system
- # Normally you do not need to uncomment this tag.
- #option proxyport 1645
-
- # Client(s) from which we accept radius requests
- # Normally you do not need to uncomment this tag.
- #option proxyclient 10.0.0.1/24
-
- # Radius proxy shared secret for all clients
- # If not specified defaults to radiussecret
- # Normally you do not need to uncomment this tag.
- #option proxysecret testing123
-
-
-# Universal access method (UAM) parameters
-config uam
-
- # URL of web server handling authentication.
- option uamserver https://radius.chillispot.org/hotspotlogin
-
- # URL of welcome homepage.
- # Unauthenticated users will be redirected to this URL. If not specified
- # users will be redirected to the uamserver instead.
- # Normally you do not need to uncomment this tag.
- #option uamhomepage http://192.168.182.1/welcome.html
-
- # Shared between chilli and authentication web server
- #option uamsecret ht2eb8ej6s4et3rg1ulp
-
- # IP address to listen to for authentication requests
- # Do not uncomment this tag unless you are an experienced user!
- #option uamlisten 192.168.182.1
-
- # TCP port to listen to for authentication requests
- # Do not uncomment this tag unless you are an experienced user!
- #option uamport 3990
-
- # Comma separated list of domain names, IP addresses or network segments
- # the client can access without first authenticating.
- # It is possible to specify this tag multiple times.
- # Normally you do not need to uncomment this tag.
- #list uamallowed www.chillispot.org
- #list uamallowed 10.11.12.0/24
-
- # If this flag is given unauthenticated users are allowed to use
- # any DNS server.
- # Normally you do not need to uncomment this tag.
- #uamanydns
-
-
-# MAC authentication
-config macauth
-
- # If this flag is given users will be authenticated only on their MAC
- # address.
- # Normally you do not need to enable this flag.
- option macauth 0
-
- # List of MAC addresses.
- # The MAC addresses specified in this list will be authenticated only on
- # their MAC address.
- # This tag is ignored if the macauth tag is given.
- # It is possible to specify this tag multiple times.
- # Normally you do not need to uncomment this tag.
- #list macallowed 00-0A-5E-AC-BE-51
- #list macallowed 00-30-1B-3C-32-E9
-
- # Password to use for MAC authentication.
- # Normally you do not need to uncomment this tag.
- #option macpasswd password
-
- # Suffix to add to MAC address in order to form the username.
- # Normally you do not need to uncomment this tag.
- #option macsuffix suffix
diff --git a/applications/luci-ddns/luasrc/controller/ddns.lua b/applications/luci-ddns/luasrc/controller/ddns.lua
index 8e1bc665ab..e2f786b324 100644
--- a/applications/luci-ddns/luasrc/controller/ddns.lua
+++ b/applications/luci-ddns/luasrc/controller/ddns.lua
@@ -12,21 +12,21 @@ You may obtain a copy of the License at
$Id$
]]--
+
module("luci.controller.ddns", package.seeall)
function index()
- require("luci.i18n")
- luci.i18n.loadc("ddns")
if not nixio.fs.access("/etc/config/ddns") then
return
end
- local page = entry({"admin", "services", "ddns"}, cbi("ddns/ddns"), luci.i18n.translate("Dynamic DNS"), 60)
+ local page
+
+ page = entry({"admin", "services", "ddns"}, cbi("ddns/ddns"), _("Dynamic DNS"), 60)
page.i18n = "ddns"
page.dependent = true
-
-
- local page = entry({"mini", "network", "ddns"}, cbi("ddns/ddns", {autoapply=true}), luci.i18n.translate("Dynamic DNS"), 60)
+
+ page = entry({"mini", "network", "ddns"}, cbi("ddns/ddns", {autoapply=true}), _("Dynamic DNS"), 60)
page.i18n = "ddns"
page.dependent = true
end
diff --git a/applications/luci-diag-core/luasrc/controller/luci_diag.lua b/applications/luci-diag-core/luasrc/controller/luci_diag.lua
index 23b8d00098..c12399431e 100644
--- a/applications/luci-diag-core/luasrc/controller/luci_diag.lua
+++ b/applications/luci-diag-core/luasrc/controller/luci_diag.lua
@@ -16,16 +16,15 @@ require("luci.i18n")
module("luci.controller.luci_diag", package.seeall)
function index()
- require("luci.i18n")
- luci.i18n.loadc("diag_core")
-
- local e = entry({"admin", "network", "diag_config"}, template("diag/network_config_index") , luci.i18n.translate("Configure Diagnostics"), 120)
- e.index = true
- e.i18n = "diag_core"
- e.dependent = true
-
- e = entry({"mini", "diag"}, template("diag/index"), luci.i18n.translate("l_d_diag"), 120)
- e.index = true
- e.i18n = "diag_core"
- e.dependent = true
+ local e
+
+ e = entry({"admin", "network", "diag_config"}, template("diag/network_config_index") , _("Configure Diagnostics"), 120)
+ e.index = true
+ e.i18n = "diag_core"
+ e.dependent = true
+
+ e = entry({"mini", "diag"}, template("diag/index"), _("Diagnostics"), 120)
+ e.index = true
+ e.i18n = "diag_core"
+ e.dependent = true
end
diff --git a/applications/luci-diag-devinfo/luasrc/controller/luci_diag/luci_diag_devinfo.lua b/applications/luci-diag-devinfo/luasrc/controller/luci_diag/luci_diag_devinfo.lua
index e40a3e82cc..e8a2f5043d 100644
--- a/applications/luci-diag-devinfo/luasrc/controller/luci_diag/luci_diag_devinfo.lua
+++ b/applications/luci-diag-devinfo/luasrc/controller/luci_diag/luci_diag_devinfo.lua
@@ -11,58 +11,56 @@ You may obtain a copy of the License at
]]--
-
module("luci.controller.luci_diag.luci_diag_devinfo", package.seeall)
function index()
- require("luci.i18n")
- luci.i18n.loadc("diag_devinfo")
+ local e
- local e = entry({"admin", "voice", "diag", "phones"}, arcombine(cbi("luci_diag/smap_devinfo"), cbi("luci_diag/smap_devinfo_config")), luci.i18n.translate("Phones"), 10)
+ e = entry({"admin", "voice", "diag", "phones"}, arcombine(cbi("luci_diag/smap_devinfo"), cbi("luci_diag/smap_devinfo_config")), _("Phones"), 10)
e.leaf = true
e.subindex = true
e.i18n = "diag_devinfo"
e.dependent = true
- e = entry({"admin", "voice", "diag", "phones", "config"}, cbi("luci_diag/smap_devinfo_config"), luci.i18n.translate("Configure"), 10)
+ e = entry({"admin", "voice", "diag", "phones", "config"}, cbi("luci_diag/smap_devinfo_config"), _("Configure"), 10)
e.i18n = "diag_devinfo"
- e = entry({"admin", "status", "smap_devinfo"}, cbi("luci_diag/smap_devinfo"), luci.i18n.translate("SIP Devices on Network"), 120)
+ e = entry({"admin", "status", "smap_devinfo"}, cbi("luci_diag/smap_devinfo"), _("SIP Devices on Network"), 120)
e.leaf = true
e.i18n = "diag_devinfo"
e.dependent = true
- e = entry({"admin", "network", "diag_config", "netdiscover_devinfo_config"}, cbi("luci_diag/netdiscover_devinfo_config"), luci.i18n.translate("Network Device Scan"), 100)
+ e = entry({"admin", "network", "diag_config", "netdiscover_devinfo_config"}, cbi("luci_diag/netdiscover_devinfo_config"), _("Network Device Scan"), 100)
e.leaf = true
e.i18n = "diag_devinfo"
e.dependent = true
- e = entry({"admin", "network", "diag_config", "smap_devinfo_config"}, cbi("luci_diag/smap_devinfo_config"), luci.i18n.translate("SIP Device Scan"))
+ e = entry({"admin", "network", "diag_config", "smap_devinfo_config"}, cbi("luci_diag/smap_devinfo_config"), _("SIP Device Scan"))
e.leaf = true
e.i18n = "diag_devinfo"
e.dependent = true
- e = entry({"admin", "status", "netdiscover_devinfo"}, cbi("luci_diag/netdiscover_devinfo"), luci.i18n.translate("Devices on Network"), 90)
+ e = entry({"admin", "status", "netdiscover_devinfo"}, cbi("luci_diag/netdiscover_devinfo"), _("Devices on Network"), 90)
e.i18n = "diag_devinfo"
e.dependent = true
- e = entry({"admin", "network", "mactodevinfo"}, cbi("luci_diag/mactodevinfo"), luci.i18n.translate("MAC Device Info Overrides"), 190)
+ e = entry({"admin", "network", "mactodevinfo"}, cbi("luci_diag/mactodevinfo"), _("MAC Device Info Overrides"), 190)
e.i18n = "diag_devinfo"
e.dependent = true
- e = entry({"mini", "diag", "phone_scan"}, cbi("luci_diag/smap_devinfo_mini"), luci.i18n.translate("Phone Scan"), 100)
+ e = entry({"mini", "diag", "phone_scan"}, cbi("luci_diag/smap_devinfo_mini"), _("Phone Scan"), 100)
e.i18n = "diag_devinfo"
e.dependent = true
- e = entry({"mini", "voice", "phones", "phone_scan_config"}, cbi("luci_diag/smap_devinfo_config_mini"), luci.i18n.translate("Config Phone Scan"), 90)
+ e = entry({"mini", "voice", "phones", "phone_scan_config"}, cbi("luci_diag/smap_devinfo_config_mini"), _("Config Phone Scan"), 90)
e.i18n = "diag_devinfo"
e.dependent = true
- e = entry({"mini", "diag", "netdiscover_devinfo"}, cbi("luci_diag/netdiscover_devinfo_mini"), luci.i18n.translate("Network Device Scan"), 10)
+ e = entry({"mini", "diag", "netdiscover_devinfo"}, cbi("luci_diag/netdiscover_devinfo_mini"), _("Network Device Scan"), 10)
e.i18n = "diag_devinfo"
e.dependent = true
- e = entry({"mini", "network", "netdiscover_devinfo_config"}, cbi("luci_diag/netdiscover_devinfo_config_mini"), luci.i18n.translate("Device Scan Config"))
+ e = entry({"mini", "network", "netdiscover_devinfo_config"}, cbi("luci_diag/netdiscover_devinfo_config_mini"), _("Device Scan Config"))
e.i18n = "diag_devinfo"
e.dependent = true
diff --git a/applications/luci-ffwizard/Makefile b/applications/luci-ffwizard/Makefile
deleted file mode 100644
index c0445b9984..0000000000
--- a/applications/luci-ffwizard/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-PO = ffwizard
-
-include ../../build/config.mk
-include ../../build/module.mk
diff --git a/applications/luci-ffwizard/luasrc/controller/ffwizard.lua b/applications/luci-ffwizard/luasrc/controller/ffwizard.lua
deleted file mode 100644
index 53ceb3a545..0000000000
--- a/applications/luci-ffwizard/luasrc/controller/ffwizard.lua
+++ /dev/null
@@ -1,30 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-Copyright 2011 Patrick Grimm <patrick@pberg.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
-]]--
-
-module "luci.controller.ffwizard"
-
-function index()
- require("luci.i18n").loadc("ffwizard")
- local i18n = luci.i18n.translate
-
- entry({"admin", "freifunk", "ffwizard"}, form("freifunk/ffwizard"), i18n("Wizard"), 40)
- assign({"mini", "freifunk", "ffwizard"}, {"admin", "freifunk", "ffwizard"}, i18n("Wizard"), 40)
-
- entry({"admin", "freifunk", "ffwizard_error"}, template("freifunk/ffwizard_error"))
- assign({"mini", "freifunk", "ffwizard_error"}, {"admin", "freifunk", "ffwizard_error"})
-end
-
diff --git a/applications/luci-ffwizard/luasrc/model/cbi/freifunk/ffwizard.lua b/applications/luci-ffwizard/luasrc/model/cbi/freifunk/ffwizard.lua
deleted file mode 100644
index 621dd352ac..0000000000
--- a/applications/luci-ffwizard/luasrc/model/cbi/freifunk/ffwizard.lua
+++ /dev/null
@@ -1,1219 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-Copyright 2011 Patrick Grimm <patrick@pberg.freifunk.net>
-Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-]]--
-
-
-local uci = require "luci.model.uci".cursor()
-local uci_state = require "luci.model.uci".cursor_state()
-local tools = require "luci.tools.ffwizard"
-local util = require "luci.util"
-local sys = require "luci.sys"
-local ip = require "luci.ip"
-local fs = require "nixio.fs"
-
-local has_pptp = fs.access("/usr/sbin/pptp")
-local has_pppoe = fs.glob("/usr/lib/pppd/*/rp-pppoe.so")()
-local has_l2gvpn = fs.access("/usr/sbin/node")
-local has_radvd = fs.access("/etc/config/radvd")
-local has_rom = fs.access("/rom/etc")
-local has_autoipv6 = fs.access("/usr/bin/auto-ipv6")
-local has_qos = fs.access("/etc/init.d/qos")
-local has_ipv6 = fs.access("/proc/sys/net/ipv6")
-local has_hb = fs.access("/sbin/heartbeat")
-local community = "profile_" .. (uci:get("freifunk", "community", "name") or "na")
-local lat = uci:get_first("system", "system", "latitude")
-local lon = uci:get_first("system", "system", "longitude")
-local suffix = uci:get_first(community, "community", "suffix") or "olsr"
-
-luci.i18n.loadc("freifunk")
-
--- Check if all necessary variables are available
-if not (community ~= "profile_na" and lat and lon) then
- luci.http.redirect(luci.dispatcher.build_url(unpack(luci.dispatcher.context.requested.path), "freifunk", "ffwizard_error"))
- return
-end
-
-function get_mac(ix)
- if string.find(ix, "radio") then
- ix = string.gsub(ix,"radio", 'wlan')
- end
- local mac = fs.readfile("/sys/class/net/" .. ix .. "/address")
- if not mac then
- mac = luci.util.exec("ifconfig " .. ix)
- mac = mac and mac:match(" ([A-F0-9:]+)%s*\n")
- else
- mac = mac:sub(1,17)
- end
- if mac and #mac > 0 then
- return mac:lower()
- end
- return "?"
-end
-
-function get_ula(imac)
- if string.len(imac) == 17 then
- local mac1 = string.sub(imac,4,8)
- local mac2 = string.sub(imac,10,14)
- local mac3 = string.sub(imac,16,17)
- return 'fdca:ffee:babe::02'..mac1..'ff:fe'..mac2..mac3..'/64'
- end
- return "?"
-end
-
-function gen_dhcp_range(n)
- local subnet_prefix = tonumber(uci:get_first(community, "community", "splash_prefix")) or 27
- local pool_network = uci:get_first(community, "community", "splash_network") or "10.104.0.0/16"
- local pool = luci.ip.IPv4(pool_network)
- local ip = tostring(n)
- if pool and ip then
- local hosts_per_subnet = 2^(32 - subnet_prefix)
- local number_of_subnets = (2^pool:prefix())/hosts_per_subnet
- local seed1, seed2 = ip:match("(%d+)%.(%d+)$")
- if seed1 and seed2 then
- math.randomseed((seed1+1)*(seed2+1))
- end
- local subnet = pool:add(hosts_per_subnet * math.random(number_of_subnets))
- dhcp_ip = subnet:network(subnet_prefix):add(1):string()
- dhcp_mask = subnet:mask(subnet_prefix):string()
- end
- return "?"
-end
-
-function cbi_meship(dev)
- meship = f:field(Value, "meship_" .. dev, dev:upper() .. " " .. translate("Mesh IP address"),
- translate("This is a unique address in the mesh (e.g. 10.1.1.1) and has to be registered at your local community."))
- meship:depends("device_" .. dev, "1")
- meship.rmempty = true
- function meship.cfgvalue(self, section)
- return uci:get("freifunk", "wizard", "meship_" .. dev)
- end
- function meship.validate(self, value)
- local x = ip.IPv4(value)
- return ( x and x:prefix() == 32 ) and x:string() or ""
- end
- function meship.write(self, sec, value)
- uci:set("freifunk", "wizard", "meship_" .. dev, value)
- end
-end
-
-function cbi_meship6(dev)
- local meship6 = f:field(Value, "meship6_" .. dev, dev:upper() .. " " .. translate("Mesh IPv6 Address"), translate("The ipv6 address is calculated auomatically."))
- meship6:depends("device_" .. dev, "1")
- meship6.rmempty = true
- function meship6.cfgvalue(self, section)
- return get_ula(get_mac(dev))
- end
-end
-
-function cbi_netconf(dev)
- local d = f:field(Flag, "device_" .. dev , " <b>" .. dev:upper() .. "</b>", "Configure this interface.")
- d:depends("netconfig", "1")
- d.rmempty = false
- function d.cfgvalue(self, section)
- return uci:get("freifunk", "wizard", "device_" .. dev)
- end
- function d.write(self, sec, value)
- if value then
- uci:set("freifunk", "wizard", "device_" .. dev, value)
- uci:save("freifunk")
- end
- end
-end
-
-function cbi_meshdhcp(dev)
- local dhcpmesh = f:field(Value, "dhcpmesh_" .. dev, dev:upper() .. " " .. translate("DHCP IP range"),
- translate("The IP range from which clients are assigned ip addresses (e.g. 10.1.2.1/28). If this is a range inside your mesh network range, then it will be announced as HNA. Any other range will use NAT. If left empty then the defaults from the community profile will be used."))
- dhcpmesh:depends("client_" .. dev, "1")
- dhcpmesh.rmempty = true
- function dhcpmesh.cfgvalue(self, section)
- return uci:get("freifunk", "wizard", "dhcpmesh_" .. dev)
- end
- function dhcpmesh.validate(self, value)
- local x = ip.IPv4(value)
- return ( x and x:prefix() <= 30 and x:minhost()) and x:string() or ""
- end
- function dhcpmesh.write(self, sec, value)
- uci:set("freifunk", "wizard", "dhcpmesh_" .. dev, value)
- uci:save("freifunk")
- end
-end
-
-function cbi_dhcp(dev)
- local client = f:field(Flag, "client_" .. dev, dev:upper() .. " " .. translate("Enable DHCP"), translate("DHCP will automatically assign ip addresses to clients"))
- client:depends("device_" .. dev, "1")
- client.rmempty = true
- function client.cfgvalue(self, section)
- return uci:get("freifunk", "wizard", "client_" .. dev)
- end
- function client.write(self, sec, value)
- uci:set("freifunk", "wizard", "client_" .. dev, value)
- uci:save("freifunk")
- end
-end
-
-function hbconf(dev)
- if has_hb then
- local ifacelist = uci:get_list("manager", "heartbeat", "interface") or {}
- table.insert(ifacelist,dev .. "dhcp")
- uci:set_list("manager", "heartbeat", "interface", ifacelist)
- uci:save("manager")
- end
-end
-
-function uci_radvd(n)
- uci:section("radvd", "interface", nil, {
- interface =n,
- AdvSendAdvert =1,
- AdvManagedFlag =0,
- AdvOtherConfigFlag =0,
- ignore =0
- })
- uci:section("radvd", "prefix", nil, {
- interface =n,
- AdvOnLink =1,
- AdvAutonomous =1,
- AdvRouterAddr =0,
- ignore =0,
- })
- uci:save("radvd")
-end
-
-function uci_clean_radvd (n)
- uci:delete_all("radvd", "interface", {interface=n.."dhcp"})
- uci:delete_all("radvd", "interface", {interface=n})
- uci:delete_all("radvd", "prefix", {interface=n.."dhcp"})
- uci:delete_all("radvd", "prefix", {interface=n})
-end
-
-
--------------------- View --------------------
-f = SimpleForm("ffwizward", translate("Wizard"),
- translate("This wizard will assist you in setting up your router for Freifunk " ..
- "or another similar wireless community network."))
-
--- if password is not set or default then force the user to set a new one
-if sys.exec("diff /rom/etc/passwd /etc/passwd") == "" then
- pw1 = f:field(Value, "pw1", translate("Password"))
- pw1.password = true
- pw1.rmempty = false
-
- pw2 = f:field(Value, "pw2", translate("Password confirmation"))
- pw2.password = true
- pw2.rmempty = false
-
- function pw2.validate(self, value, section)
- return pw1:formvalue(section) == value and value
- end
-end
-
--- main netconfig
-
-local cc = uci:get(community, "wifi_device", "country") or "DE"
-
-main = f:field(Flag, "netconfig", translate("Configure network"), translate("Select this checkbox to configure your network interfaces."))
-
-uci:foreach("wireless", "wifi-device", function(section)
- local device = section[".name"]
- local hwtype = section.type
- local syscc = section.country
-
- if not syscc then
- if hwtype == "atheros" then
- cc = sys.exec("grep -i '" .. cc .. "' /lib/wifi/cc_translate.txt |cut -d ' ' -f 2") or 0
- sys.exec("echo " .. cc .. " > /proc/sys/dev/" .. device .. "/countrycode")
- elseif hwtype == "mac80211" then
- sys.exec("iw reg set " .. cc)
- elseif hwtype == "broadcom" then
- sys.exec ("wlc country " .. cc)
- end
- else
- cc = syscc
- end
-
- cbi_netconf(device)
- local chan = f:field(ListValue, "chan_" .. device, device:upper() .. " " .. translate("Channel"), translate("Your device and neighbouring nodes have to use the same channel."))
- chan:depends("device_" .. device, "1")
- chan.rmempty = true
- function chan.cfgvalue(self, section)
- return uci:get("freifunk", "wizard", "chan_" .. device)
- end
- chan:value('default')
- for _, f in ipairs(sys.wifi.channels(device)) do
- if not f.restricted then
- chan:value(f.channel)
- end
- end
-
- function chan.write(self, sec, value)
- if value then
- uci:set("freifunk", "wizard", "chan_" .. device, value)
- uci:save("freifunk")
- end
- end
-
- cbi_meship(device)
- if has_ipv6 then
- cbi_meship6(device)
- end
- cbi_dhcp(device)
- cbi_meshdhcp(device)
- local hwtype = section.type
- if hwtype == "atheros" then
- local vap = f:field(Flag, "vap_" .. device , " " .. translate("Virtual Access Point (VAP)"), translate("This will setup a new virtual wireless interface in Access Point mode."))
- vap:depends("client_" .. device, "1")
- vap.rmempty = false
- function vap.cfgvalue(self, section)
- return uci:get("freifunk", "wizard", "vap_" .. device)
- end
- function vap.write(self, sec, value)
- uci:set("freifunk", "wizard", "vap_" .. device, value)
- uci:save("freifunk")
- end
- end
-end)
-
-uci:foreach("network", "interface", function(section)
- local device = section[".name"]
- local ifname = uci_state:get("network",device,"ifname")
- if device ~= "loopback" and not string.find(device, "gvpn") and not string.find(device, "wifi") and not string.find(device, "wl") and not string.find(device, "wlan") and not string.find(device, "wireless") and not string.find(device, "radio") then
- cbi_netconf(device)
- cbi_meship(device)
- if has_ipv6 then
- cbi_meship6(device)
- end
- cbi_dhcp(device)
- cbi_meshdhcp(device)
- end
-end)
-
-share = f:field(Flag, "sharenet", "<b>" .. translate("Share your internet connection") .. "</b>", translate("Select this to allow others to use your connection to access the internet."))
-share.rmempty = false
-share:depends("netconfig", "1")
-function share.cfgvalue(self, section)
- return uci:get("freifunk", "wizard", "share")
-end
-function share.write(self, section, value)
- uci:set("freifunk", "wizard", "share", value)
- uci:save("freifunk")
-end
-
-wanproto = f:field(ListValue, "wanproto", translate("Protocol"), translate ("The protocol to use for internet connectivity."))
-wanproto:depends("sharenet", "1")
-wanproto:value("static", translate("static", "static"))
-wanproto:value("dhcp", translate("dhcp", "dhcp"))
-if has_pppoe then wanproto:value("pppoe", "PPPoE") end
-if has_pptp then wanproto:value("pptp", "PPTP") end
-function wanproto.cfgvalue(self, section)
- return uci:get("network", "wan", "proto") or "dhcp"
-end
-function wanproto.write(self, section, value)
- uci:set("network", "wan", "proto", value)
- uci:save("network")
-end
-wanip = f:field(Value, "wanipaddr", translate("Ip address"))
-wanip:depends("wanproto", "static")
-function wanip.cfgvalue(self, section)
- return uci:get("network", "wan", "ipaddr")
-end
-function wanip.write(self, section, value)
- uci:set("network", "wan", "ipaddr", value)
- uci:save("network")
-end
-wannm = f:field(Value, "wannetmask", translate("Netmask"))
-wannm:depends("wanproto", "static")
-function wannm.cfgvalue(self, section)
- return uci:get("network", "wan", "netmask")
-end
-function wannm.write(self, section, value)
- uci:set("network", "wan", "netmask", value)
- uci:save("network")
-end
-wangw = f:field(Value, "wangateway", translate("Gateway"))
-wangw:depends("wanproto", "static")
-wangw.rmempty = true
-function wangw.cfgvalue(self, section)
- return uci:get("network", "wan", "gateway")
-end
-function wangw.write(self, section, value)
- uci:set("network", "wan", "gateway", value)
- uci:save("network")
-end
-wandns = f:field(Value, "wandns", translate("DNS Server"))
-wandns:depends("wanproto", "static")
-wandns.rmempty = true
-function wandns.cfgvalue(self, section)
- return uci:get("network", "wan", "dns")
-end
-function wandns.write(self, section, value)
- uci:set("network", "wan", "dns", value)
- uci:save("network")
-end
-wanusr = f:field(Value, "wanusername", translate("Username"))
-wanusr:depends("wanproto", "pppoe")
-wanusr:depends("wanproto", "pptp")
-function wanusr.cfgvalue(self, section)
- return uci:get("network", "wan", "username")
-end
-function wanusr.write(self, section, value)
- uci:set("network", "wan", "username", value)
- uci:save("network")
-end
-wanpwd = f:field(Value, "wanpassword", translate("Password"))
-wanpwd.password = true
-wanpwd:depends("wanproto", "pppoe")
-wanpwd:depends("wanproto", "pptp")
-function wanpwd.cfgvalue(self, section)
- return uci:get("network", "wan", "password")
-end
-function wanpwd.write(self, section, value)
- uci:set("network", "wan", "password", value)
- uci:save("network")
-end
-
-wansec = f:field(Flag, "wansec", translate("Protect LAN"), translate("Check this to protect your LAN from other nodes or clients" .. " (" .. translate("recommended") .. ")."))
-wansec.default = "1"
-wansec.rmempty = false
-wansec:depends("wanproto", "static")
-wansec:depends("wanproto", "dhcp")
-function wansec.cfgvalue(self, section)
- return uci:get("freifunk", "wizard", "wan_security")
-end
-function wansec.write(self, section, value)
- uci:set("freifunk", "wizard", "wan_security", value)
- uci:save("freifunk")
-end
-if has_qos then
- wanqosdown = f:field(Value, "wanqosdown", translate("Limit download bandwidth"), translate("kbit/s"))
- wanqosdown:depends("sharenet", "1")
- function wanqosdown.cfgvalue(self, section)
- return uci:get("qos", "wan", "download")
- end
- function wanqosdown.write(self, section, value)
- uci:set("qos", "wan", "download", value)
- uci:save("qos")
- end
- wanqosup = f:field(Value, "wanqosup", translate("Limit upload bandwidth"), translate("kbit/s"))
- wanqosup:depends("sharenet", "1")
- function wanqosup.cfgvalue(self, section)
- return uci:get("qos", "wan", "upload")
- end
- function wanqosup.write(self, section, value)
- uci:set("qos", "wan", "upload", value)
- uci:save("qos")
- end
-end
-
-if has_l2gvpn then
- gvpn = f:field(Flag, "gvpn", translate("L2gvpn tunnel"), translate("Connect your node with other nodes with a tunnel via the internet."))
- gvpn.rmempty = false
- gvpn:depends("sharenet", "1")
- function gvpn.cfgvalue(self, section)
- return uci:get("freifunk", "wizard", "gvpn")
- end
- function gvpn.write(self, section, value)
- uci:set("freifunk", "wizard", "gvpn", value)
- uci:save("freifunk")
- end
- gvpnip = f:field(Value, "gvpnipaddr", translate("IP address"))
- gvpnip:depends("gvpn", "1")
- function gvpnip.cfgvalue(self, section)
- return uci:get("l2gvpn", "bbb", "ip") or uci:get("network", "gvpn", "ipaddr")
- end
- function gvpnip.validate(self, value)
- local x = ip.IPv4(value)
- return ( x and x:prefix() == 32 ) and x:string() or ""
- end
-end
-
-if has_hb then
- hb = f:field(Flag, "hb", translate("Heartbeat"), translate("Allow to transfer anonymous statistics about this node" .. " (" .. translate("recommended") .. ")."))
- hb.rmempty = false
- hb:depends("netconfig", "1")
- function hb.cfgvalue(self, section)
- return uci:get("freifunk", "wizard", "hb")
- end
- function hb.write(self, section, value)
- uci:set("freifunk", "wizard", "hb", value)
- uci:save("freifunk")
- end
-end
-
--------------------- Control --------------------
-function f.handle(self, state, data)
- if state == FORM_VALID then
- local debug = uci:get("freifunk", "wizard", "debug")
- if debug == "1" then
- if data.pw1 then
- local stat = luci.sys.user.setpasswd("root", data.pw1) == 0
- if stat then
- f.message = translate("a_s_changepw_changed")
- else
- f.errmessage = translate("unknownerror")
- end
- end
- data.pw1 = nil
- data.pw2 = nil
- luci.http.redirect(luci.dispatcher.build_url(unpack(luci.dispatcher.context.requested.path), "system", "system"))
- else
- if data.pw1 then
- local stat = luci.sys.user.setpasswd("root", data.pw1) == 0
- end
- data.pw1 = nil
- data.pw2 = nil
- uci:commit("freifunk")
- uci:commit("wireless")
- uci:commit("network")
- uci:commit("dhcp")
- uci:commit("luci_splash")
- uci:commit("firewall")
- uci:commit("system")
- uci:commit("olsrd")
- uci:commit("manager")
- if has_autoipv6 then
- uci:commit("autoipv6")
- end
- if has_qos then
- uci:commit("qos")
- end
- if has_l2gvpn then
- uci:commit("l2gvpn")
- end
- if has_radvd then
- uci:commit("radvd")
- end
-
- sys.exec("for s in network dnsmasq luci_splash firewall olsrd radvd l2gvpn; do [ -x /etc/init.d/$s ] && /etc/init.d/$s restart;done > /dev/null &" )
- luci.http.redirect(luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "ffwizard"))
- end
- return false
- elseif state == FORM_INVALID then
- self.errmessage = "Ungültige Eingabe: Bitte die Formularfelder auf Fehler prüfen."
- end
- return true
-end
-
-local function _strip_internals(tbl)
- tbl = tbl or {}
- for k, v in pairs(tbl) do
- if k:sub(1, 1) == "." then
- tbl[k] = nil
- end
- end
- return tbl
-end
--- Configure Freifunk checked
-function main.write(self, section, value)
- if value == "0" then
- uci:set("freifunk", "wizard", "netconfig", "0")
- uci:save("freifunk")
- return
- end
- -- Collect IP-Address
- uci:set("freifunk", "wizard", "net", uci:get_first(community, "community", "mesh_network"))
- uci:save("freifunk")
-
- -- Invalidate fields
- if not community then
- net.tag_missing[section] = true
- return
- end
-
- uci:set("freifunk", "wizard", "netconfig", "1")
- uci:save("freifunk")
-
- local netname = "wireless"
- local network
- network = ip.IPv4(uci:get_first(community, "community", "mesh_network") or "104.0.0.0/8")
-
- -- Cleanup
- uci:delete_all("firewall","zone", {name="freifunk"})
- uci:delete_all("firewall","forwarding", {dest="freifunk"})
- uci:delete_all("firewall","forwarding", {src="freifunk"})
- uci:delete_all("firewall","rule", {dest="freifunk"})
- uci:delete_all("firewall","rule", {src="freifunk"})
- uci:save("firewall")
- -- Create firewall zone and add default rules (first time)
- -- firewall_create_zone("name" , "input" , "output", "forward ", Masqurade)
- local newzone = tools.firewall_create_zone("freifunk", "ACCEPT", "ACCEPT", "REJECT" , true)
- if newzone then
- uci:foreach("freifunk", "fw_forwarding", function(section)
- uci:section("firewall", "forwarding", nil, section)
- end)
- uci:foreach(community, "fw_forwarding", function(section)
- uci:section("firewall", "forwarding", nil, section)
- end)
-
- uci:foreach("freifunk", "fw_rule", function(section)
- uci:section("firewall", "rule", nil, section)
- end)
- uci:foreach(community, "fw_rule", function(section)
- uci:section("firewall", "rule", nil, section)
- end)
- end
- uci:save("firewall")
- if has_hb then
- uci:delete("manager", "heartbeat", "interface")
- uci:save("manager")
- end
- -- Delete olsrdv4
- uci:delete_all("olsrd", "olsrd")
- local olsrbase
- olsrbase = uci:get_all("freifunk", "olsrd") or {}
- util.update(olsrbase, uci:get_all(community, "olsrd") or {})
- if has_ipv6 then
- olsrbase.IpVersion='6and4'
- else
- olsrbase.IpVersion='4'
- end
- uci:section("olsrd", "olsrd", nil, olsrbase)
- -- Delete olsrdv4 old p2pd settings
- uci:delete_all("olsrd", "LoadPlugin", {library="olsrd_mdns.so.1.0.0"})
- uci:delete_all("olsrd", "LoadPlugin", {library="olsrd_p2pd.so.0.1.0"})
- -- Write olsrdv4 new p2pd settings
- uci:section("olsrd", "LoadPlugin", nil, {
- library = "olsrd_p2pd.so.0.1.0",
- P2pdTtl = 10,
- UdpDestPort = "224.0.0.251 5353",
- ignore = 1,
- })
- -- Delete http plugin
- uci:delete_all("olsrd", "LoadPlugin", {library="olsrd_httpinfo.so.0.1"})
-
- -- Delete olsrdv4 old interface
- uci:delete_all("olsrd", "Interface")
- uci:delete_all("olsrd", "Hna4")
- -- Create wireless ip4/ip6 and firewall config
- uci:foreach("wireless", "wifi-device",
- function(sec)
- local device = sec[".name"]
- if not luci.http.formvalue("cbid.ffwizward.1.device_" .. device) then
- return
- end
- node_ip = luci.http.formvalue("cbid.ffwizward.1.meship_" .. device) and ip.IPv4(luci.http.formvalue("cbid.ffwizward.1.meship_" .. device))
- if has_ipv6 then
- node_ip6 = luci.http.formvalue("cbid.ffwizward.1.meship6_" .. device) and ip.IPv6(luci.http.formvalue("cbid.ffwizward.1.meship6_" .. device))
- end
- if not node_ip or not network or not network:contains(node_ip) then
- meship.tag_missing[section] = true
- node_ip = nil
- return
- end
- -- rename the wireless interface s/wifi/wireless/
- local nif
- if string.find(device, "wifi") then
- nif = string.gsub(device,"wifi", netname)
- elseif string.find(device, "wl") then
- nif = string.gsub(device,"wl", netname)
- elseif string.find(device, "wlan") then
- nif = string.gsub(device,"wlan", netname)
- elseif string.find(device, "radio") then
- nif = string.gsub(device,"radio", netname)
- end
- -- Cleanup
- tools.wifi_delete_ifaces(device)
- -- tools.network_remove_interface(device)
- uci:delete("network", device .. "dhcp")
- uci:delete("network", device)
- tools.firewall_zone_remove_interface("freifunk", device)
- -- tools.network_remove_interface(nif)
- uci:delete("network", nif .. "dhcp")
- uci:delete("network", nif)
- tools.firewall_zone_remove_interface("freifunk", nif)
- -- Delete old dhcp
- uci:delete("dhcp", device)
- uci:delete("dhcp", device .. "dhcp")
- uci:delete("dhcp", nif)
- uci:delete("dhcp", nif .. "dhcp")
- -- Delete old splash
- uci:delete_all("luci_splash", "iface", {network=device.."dhcp", zone="freifunk"})
- uci:delete_all("luci_splash", "iface", {network=nif.."dhcp", zone="freifunk"})
- -- Delete old radvd
- if has_radvd then
- uci_clean_radvd(nif)
- end
- -- New Config
- -- Tune wifi device
- local ssid = uci:get_first(community, "community", "ssid") or "olsr.freifunk.net"
- local devconfig = uci:get_all("freifunk", "wifi_device")
- util.update(devconfig, uci:get_all(community, "wifi_device") or {})
- local channel = luci.http.formvalue("cbid.ffwizward.1.chan_" .. device)
- local hwmode = "11bg"
- local bssid = uci:get_all(community, "wifi_iface", "bssid") or "02:CA:FF:EE:BA:BE"
- local mrate = 5500
- devconfig.diversity = sec.diversity or "1"
- if sec.txantenna then
- devconfig.txantenna = sec.txantenna
- end
- if sec.rxantenna then
- devconfig.rxantenna = sec.rxantenna
- end
-
- -- set bssid, see https://kifuse02.pberg.freifunk.net/moin/channel-bssid-essid for schema
- if channel and channel ~= "default" then
- if devconfig.channel ~= channel then
- devconfig.channel = channel
- local chan = tonumber(channel)
- if chan >= 0 and chan < 10 then
- bssid = channel .. "2:CA:FF:EE:BA:BE"
- elseif chan == 10 then
- bssid = "02:CA:FF:EE:BA:BE"
- elseif chan >= 11 and chan <= 14 then
- bssid = string.format("%X",channel) .. "2:CA:FF:EE:BA:BE"
- elseif chan >= 36 and chan <= 64 then
- hwmode = "11a"
- mrate = ""
- bssid = "00:" .. channel ..":CA:FF:EE:EE"
- elseif chan >= 100 and chan <= 140 then
- hwmode = "11a"
- mrate = ""
- bssid = "01:" .. string.sub(channel, 2) .. ":CA:FF:EE:EE"
- end
- devconfig.hwmode = hwmode
- end
- devconfig.country = cc
- ssid = ssid .. " - ch" .. channel
- end
- uci:tset("wireless", device, devconfig)
- -- Create wifi iface
- local ifconfig = uci:get_all("freifunk", "wifi_iface")
- util.update(ifconfig, uci:get_all(community, "wifi_iface") or {})
- ifconfig.device = device
- ifconfig.network = nif
- ifconfig.ssid = ssid
- ifconfig.bssid = bssid
- ifconfig.encryption="none"
- -- Read Preset
- local netconfig = uci:get_all("freifunk", "interface")
- util.update(netconfig, uci:get_all(community, "interface") or {})
- netconfig.proto = "static"
- netconfig.ipaddr = node_ip:string()
- if has_ipv6 then
- netconfig.ip6addr = node_ip6:string()
- end
- uci:section("network", "interface", nif, netconfig)
- if has_radvd then
- uci_radvd(nif)
- end
- tools.firewall_zone_add_interface("freifunk", nif)
- uci:save("firewall")
- -- Write new olsrv4 interface
- local olsrifbase = uci:get_all("freifunk", "olsr_interface")
- util.update(olsrifbase, uci:get_all(community, "olsr_interface") or {})
- olsrifbase.interface = nif
- olsrifbase.ignore = "0"
- uci:section("olsrd", "Interface", nil, olsrifbase)
- -- Collect MESH DHCP IP NET
- local client = luci.http.formvalue("cbid.ffwizward.1.client_" .. device)
- if client then
- local dhcpmeshnet = luci.http.formvalue("cbid.ffwizward.1.dhcpmesh_" .. device) and ip.IPv4(luci.http.formvalue("cbid.ffwizward.1.dhcpmesh_" .. device))
- hbconf(nif)
- if dhcpmeshnet then
- if not dhcpmeshnet:minhost() or not dhcpmeshnet:mask() then
- dhcpmesh.tag_missing[section] = true
- dhcpmeshnet = nil
- return
- end
- dhcp_ip = dhcpmeshnet:minhost():string()
- dhcp_mask = dhcpmeshnet:mask():string()
- dhcp_network = dhcpmeshnet:network():string()
- uci:section("olsrd", "Hna4", nil, {
- netmask = dhcp_mask,
- netaddr = dhcp_network
- })
- uci:foreach("olsrd", "LoadPlugin",
- function(s)
- if s.library == "olsrd_p2pd.so.0.1.0" then
- uci:set("olsrd", s['.name'], "ignore", "0")
- local nonolsr = uci:get("olsrd", s['.name'], "NonOlsrIf") or ""
- vap = luci.http.formvalue("cbid.ffwizward.1.vap_" .. device)
- if vap then
- nonolsr = nif.."dhcp "..nonolsr
- else
- nonolsr = nif.." "..nonolsr
- end
- uci:set("olsrd", s['.name'], "NonOlsrIf", nonolsr)
- end
- end)
- else
- gen_dhcp_range(netconfig.ipaddr)
- end
- if dhcp_ip and dhcp_mask then
- -- Create alias
- local aliasbase = uci:get_all("freifunk", "alias")
- util.update(aliasbase, uci:get_all(community, "alias") or {})
- aliasbase.ipaddr = dhcp_ip
- aliasbase.netmask = dhcp_mask
- aliasbase.proto = "static"
- vap = luci.http.formvalue("cbid.ffwizward.1.vap_" .. device)
- if vap then
- uci:section("network", "interface", nif .. "dhcp", aliasbase)
- uci:section("wireless", "wifi-iface", nil, {
- device =device,
- mode ="ap",
- encryption ="none",
- network =nif .. "dhcp",
- ssid ="AP-" .. ssid
- })
- if has_radvd then
- uci_radvd(nif .. "dhcp")
- end
- tools.firewall_zone_add_interface("freifunk", nif .. "dhcp")
- uci:save("wireless")
- ifconfig.mcast_rate = nil
- ifconfig.encryption="none"
- else
- aliasbase.interface = nif
- uci:section("network", "alias", nif .. "dhcp", aliasbase)
- end
- -- Create dhcp
- local dhcpbase = uci:get_all("freifunk", "dhcp")
- util.update(dhcpbase, uci:get_all(community, "dhcp") or {})
- dhcpbase.interface = nif .. "dhcp"
- dhcpbase.force = 1
- uci:section("dhcp", "dhcp", nif .. "dhcp", dhcpbase)
- uci:set_list("dhcp", nif .. "dhcp", "dhcp_option", "119,olsr")
- -- Create firewall settings
- uci:delete_all("firewall", "rule", {
- src="freifunk",
- proto="udp",
- dest_port="53"
- })
- uci:section("firewall", "rule", nil, {
- src="freifunk",
- proto="udp",
- dest_port="53",
- target="ACCEPT"
- })
- uci:delete_all("firewall", "rule", {
- src="freifunk",
- proto="udp",
- src_port="68",
- dest_port="67"
- })
- uci:section("firewall", "rule", nil, {
- src="freifunk",
- proto="udp",
- src_port="68",
- dest_port="67",
- target="ACCEPT"
- })
- uci:delete_all("firewall", "rule", {
- src="freifunk",
- proto="tcp",
- dest_port="8082",
- })
- uci:section("firewall", "rule", nil, {
- src="freifunk",
- proto="tcp",
- dest_port="8082",
- target="ACCEPT"
- })
- -- Register splash
- uci:section("luci_splash", "iface", nil, {network=nif.."dhcp", zone="freifunk"})
- uci:save("luci_splash")
- -- Make sure that luci_splash is enabled
- sys.init.enable("luci_splash")
- end
- else
- -- Delete old splash
- uci:delete_all("luci_splash", "iface", {network=device.."dhcp", zone="freifunk"})
- end
- --Write Ad-Hoc wifi section after AP wifi section
- uci:section("wireless", "wifi-iface", nil, ifconfig)
- uci:save("network")
- uci:save("wireless")
- uci:save("network")
- uci:save("firewall")
- uci:save("dhcp")
- end)
- -- Create wired ip and firewall config
- uci:foreach("network", "interface",
- function(sec)
- local device = sec[".name"]
- if not luci.http.formvalue("cbid.ffwizward.1.device_" .. device) then
- return
- end
- if device ~= "loopback" and not string.find(device, "wifi") and not string.find(device, "wl") and not string.find(device, "wlan") and not string.find(device, "wireless") and not string.find(device, "radio") then
- local node_ip
- node_ip = luci.http.formvalue("cbid.ffwizward.1.meship_" .. device) and ip.IPv4(luci.http.formvalue("cbid.ffwizward.1.meship_" .. device))
- if has_ipv6 then
- node_ip6 = luci.http.formvalue("cbid.ffwizward.1.meship6_" .. device) --and ip.IPv6(luci.http.formvalue("cbid.ffwizward.1.meship6_" .. device))
- end
- if not node_ip or not network or not network:contains(node_ip) then
- meship.tag_missing[section] = true
- node_ip = nil
- return
- end
- -- Cleanup
- tools.firewall_zone_remove_interface(device, device)
- uci:delete_all("firewall","zone", {name=device})
- uci:delete_all("firewall","forwarding", {src=device})
- uci:delete_all("firewall","forwarding", {dest=device})
- uci:delete("network", device .. "dhcp")
- -- Delete old dhcp
- uci:delete("dhcp", device)
- uci:delete("dhcp", device .. "dhcp")
- -- Delete old splash
- uci:delete_all("luci_splash", "iface", {network=device.."dhcp", zone="freifunk"})
- if has_radvd then
- uci_clean_radvd(device)
- end
- -- New Config
- local netconfig = uci:get_all("freifunk", "interface")
- util.update(netconfig, uci:get_all(community, "interface") or {})
- netconfig.proto = "static"
- netconfig.ipaddr = node_ip:string()
- if has_ipv6 then
- netconfig.ip6addr = node_ip6:string()
- end
- uci:section("network", "interface", device, netconfig)
- uci:save("network")
- if has_radvd then
- uci_radvd(device)
- end
- tools.firewall_zone_add_interface("freifunk", device)
- uci:save("firewall")
- -- Write new olsrv4 interface
- local olsrifbase = uci:get_all("freifunk", "olsr_interface")
- util.update(olsrifbase, uci:get_all(community, "olsr_interface") or {})
- olsrifbase.interface = device
- olsrifbase.ignore = "0"
- uci:section("olsrd", "Interface", nil, olsrifbase)
- olsrifbase.Mode = 'ether'
- -- Collect MESH DHCP IP NET
- local client = luci.http.formvalue("cbid.ffwizward.1.client_" .. device)
- if client then
- local dhcpmeshnet = luci.http.formvalue("cbid.ffwizward.1.dhcpmesh_" .. device) and ip.IPv4(luci.http.formvalue("cbid.ffwizward.1.dhcpmesh_" .. device))
- hbconf(device)
-
- if dhcpmeshnet then
- if not dhcpmeshnet:minhost() or not dhcpmeshnet:mask() then
- dhcpmesh.tag_missing[section] = true
- dhcpmeshnet = nil
- return
- end
- dhcp_ip = dhcpmeshnet:minhost():string()
- dhcp_mask = dhcpmeshnet:mask():string()
- dhcp_network = dhcpmeshnet:network():string()
- uci:section("olsrd", "Hna4", nil, {
- netmask = dhcp_mask,
- netaddr = dhcp_network
- })
- uci:foreach("olsrd", "LoadPlugin",
- function(s)
- if s.library == "olsrd_p2pd.so.0.1.0" then
- uci:set("olsrd", s['.name'], "ignore", "0")
- local nonolsr = uci:get("olsrd", s['.name'], "NonOlsrIf") or ""
- uci:set("olsrd", s['.name'], "NonOlsrIf", device .." ".. nonolsr)
- end
- end)
- else
- gen_dhcp_range(netconfig.ipaddr)
- end
- if dhcp_ip and dhcp_mask then
- -- Create alias
- local aliasbase = uci:get_all("freifunk", "alias")
- util.update(aliasbase, uci:get_all(community, "alias") or {})
- aliasbase.interface = device
- aliasbase.ipaddr = dhcp_ip
- aliasbase.netmask = dhcp_mask
- aliasbase.proto = "static"
- uci:section("network", "alias", device .. "dhcp", aliasbase)
- -- Create dhcp
- local dhcpbase = uci:get_all("freifunk", "dhcp")
- util.update(dhcpbase, uci:get_all(community, "dhcp") or {})
- dhcpbase.interface = device .. "dhcp"
- dhcpbase.force = 1
- uci:section("dhcp", "dhcp", device .. "dhcp", dhcpbase)
- uci:set_list("dhcp", device .. "dhcp", "dhcp_option", "119,olsr")
- -- Create firewall settings
- uci:delete_all("firewall", "rule", {
- src="freifunk",
- proto="udp",
- dest_port="53"
- })
- uci:section("firewall", "rule", nil, {
- src="freifunk",
- proto="udp",
- dest_port="53",
- target="ACCEPT"
- })
- uci:delete_all("firewall", "rule", {
- src="freifunk",
- proto="udp",
- src_port="68",
- dest_port="67"
- })
- uci:section("firewall", "rule", nil, {
- src="freifunk",
- proto="udp",
- src_port="68",
- dest_port="67",
- target="ACCEPT"
- })
- uci:delete_all("firewall", "rule", {
- src="freifunk",
- proto="tcp",
- dest_port="8082",
- })
- uci:section("firewall", "rule", nil, {
- src="freifunk",
- proto="tcp",
- dest_port="8082",
- target="ACCEPT"
- })
- -- Register splash
- uci:section("luci_splash", "iface", nil, {network=device.."dhcp", zone="freifunk"})
- uci:save("luci_splash")
- -- Make sure that luci_splash is enabled
- sys.init.enable("luci_splash")
- end
- end
- uci:save("wireless")
- uci:save("network")
- uci:save("firewall")
- uci:save("dhcp")
- end
- end)
- --enable radvd
- if has_radvd then
- sys.init.enable("radvd")
- end
- -- Enforce firewall include
- local has_include = false
- uci:foreach("firewall", "include",
- function(section)
- if section.path == "/etc/firewall.freifunk" then
- has_include = true
- end
- end)
-
- if not has_include then
- uci:section("firewall", "include", nil,
- { path = "/etc/firewall.freifunk" })
- end
- -- Allow state: invalid packets
- uci:foreach("firewall", "defaults",
- function(section)
- uci:set("firewall", section[".name"], "drop_invalid", "0")
- end)
-
- -- Prepare advanced config
- local has_advanced = false
- uci:foreach("firewall", "advanced",
- function(section) has_advanced = true end)
-
- if not has_advanced then
- uci:section("firewall", "advanced", nil,
- { tcp_ecn = "0", ip_conntrack_max = "8192", tcp_westwood = "1" })
- end
- uci:save("wireless")
- uci:save("network")
- uci:save("firewall")
- uci:save("dhcp")
-
- if has_hb then
- local dhcphb = hb:formvalue(section)
- if dhcphb then
- uci:set("manager", "heartbeat", "enabled", "1")
- -- Make sure that heartbeat is enabled
- sys.init.enable("machash")
- else
- uci:set("manager", "heartbeat", "enabled", "0")
- -- Make sure that heartbeat is enabled
- sys.init.disable("machash")
- end
- uci:save("manager")
- end
-
- uci:foreach("system", "system",
- function(s)
- -- Make crond silent
- uci:set("system", s['.name'], "cronloglevel", "10")
- -- Make set timzone and zonename
- uci:set("system", s['.name'], "zonename", "Europe/Berlin")
- uci:set("system", s['.name'], "timezone", 'CET-1CEST,M3.5.0,M10.5.0/3')
- end)
-
- -- Create time rdate_servers
- local rdate = uci:get_all("freifunk", "time")
- if rdate then
- uci:delete_all("system", "time")
- uci:section("system", "time", "rdate_servers", rdate)
- rdate.server = rdate.rdate_servers
- rdate.rdate_servers = ""
- uci:delete_all("system", "rdate", nil)
- uci:section("system", "rdate", nil, rdate)
- uci:save("system")
- end
-
- -- Delete old watchdog settings
- uci:delete_all("olsrd", "LoadPlugin", {library="olsrd_watchdog.so.0.1"})
- -- Write new watchdog settings
- uci:section("olsrd", "LoadPlugin", nil, {
- library = "olsrd_watchdog.so.0.1",
- file = "/var/run/olsrd.watchdog",
- interval = "30"
- })
-
- -- Delete old nameservice settings
- uci:delete_all("olsrd", "LoadPlugin", {library="olsrd_nameservice.so.0.3"})
- -- Write new nameservice settings
- uci:section("olsrd", "LoadPlugin", nil, {
- library = "olsrd_nameservice.so.0.3",
- suffix = "." .. suffix ,
- hosts_file = "/var/etc/hosts.olsr",
- latlon_file = "/var/run/latlon.js",
- lat = lat and string.format("%.15f", lat) or "",
- lon = lon and string.format("%.15f", lon) or "",
- services_file = "/var/etc/services.olsr"
- })
-
- -- Import hosts and set domain
- uci:foreach("dhcp", "dnsmasq", function(s)
- uci:set_list("dhcp", s[".name"], "addnhosts", "/var/etc/hosts.olsr")
- uci:set("dhcp", s[".name"], "local", "/" .. suffix .. "/")
- uci:set("dhcp", s[".name"], "domain", suffix)
- end)
-
- -- Make sure that OLSR is enabled
- sys.init.enable("olsrd")
-
- uci:save("olsrd")
- uci:save("dhcp")
- -- Import hosts and set domain
- if has_ipv6 then
- uci:foreach("dhcp", "dnsmasq", function(s)
- uci:set_list("dhcp", s[".name"], "addnhosts", {"/var/etc/hosts.olsr","/var/etc/hosts.olsr.ipv6"})
- end)
- else
- uci:foreach("dhcp", "dnsmasq", function(s)
- uci:set_list("dhcp", s[".name"], "addnhosts", "/var/etc/hosts.olsr")
- end)
- end
-
- uci:save("dhcp")
-
- -- Internet sharing
- local share_value = share:formvalue(section)
- if share_value == "1" then
- uci:set("freifunk", "wizard", "netconfig", "1")
- uci:section("firewall", "forwarding", nil, {src="freifunk", dest="wan"})
-
- if has_autoipv6 then
- -- Set autoipv6 tunnel mode
- uci:set("autoipv6", "olsr_node", "enable", "0")
- uci:set("autoipv6", "tunnel", "enable", "1")
- uci:save("autoipv6")
- end
-
- -- Delete/Disable gateway plugin
- uci:delete_all("olsrd", "LoadPlugin", {library="olsrd_dyn_gw.so.0.5"})
- uci:delete_all("olsrd", "LoadPlugin", {library="olsrd_dyn_gw_plain.so.0.4"})
- -- Enable gateway_plain plugin
- uci:section("olsrd", "LoadPlugin", nil, {library="olsrd_dyn_gw_plain.so.0.4"})
- sys.exec("chmod +x /etc/init.d/freifunk-p2pblock")
- sys.init.enable("freifunk-p2pblock")
- sys.init.enable("qos")
- sys.exec('grep wan /etc/crontabs/root >/dev/null || echo "0 6 * * * ifup wan" >> /etc/crontabs/root')
-
- if wansec:formvalue(section) == "1" then
- uci:foreach("firewall", "zone",
- function(s)
- if s.name == "wan" then
- uci:set("firewall", s['.name'], "local_restrict", "1")
- return false
- end
- end)
- end
- else
- uci:set("freifunk", "wizard", "netconfig", "0")
- uci:save("freifunk")
- if has_autoipv6 then
- -- Set autoipv6 olsrd mode
- uci:set("autoipv6", "olsr_node", "enable", "1")
- uci:set("autoipv6", "tunnel", "enable", "0")
- uci:save("autoipv6")
- end
- -- Delete gateway plugins
- uci:delete_all("olsrd", "LoadPlugin", {library="olsrd_dyn_gw.so.0.5"})
- uci:delete_all("olsrd", "LoadPlugin", {library="olsrd_dyn_gw_plain.so.0.4"})
- -- Disable gateway_plain plugin
- uci:section("olsrd", "LoadPlugin", nil, {
- library = "olsrd_dyn_gw_plain.so.0.4",
- ignore = 1,
- })
- sys.init.disable("freifunk-p2pblock")
- sys.init.disable("qos")
- sys.exec("chmod -x /etc/init.d/freifunk-p2pblock")
- uci:delete_all("firewall", "forwarding", {src="freifunk", dest="wan"})
- uci:foreach("firewall", "zone",
- function(s)
- if s.name == "wan" then
- uci:delete("firewall", s['.name'], "local_restrict")
- return false
- end
- end)
- end
- -- Write gvpn dummy interface
- if has_l2gvpn then
- if gvpn then
- local vpn = gvpn:formvalue(section)
- if vpn then
- uci:delete_all("l2gvpn", "l2gvpn")
- uci:delete_all("l2gvpn", "node")
- uci:delete_all("l2gvpn", "supernode")
- -- Write olsr tunnel interface options
- local olsr_gvpnifbase = uci:get_all("freifunk", "olsr_gvpninterface")
- util.update(olsr_gvpnifbase, uci:get_all(community, "olsr_gvpninterface") or {})
- uci:section("olsrd", "Interface", nil, olsr_gvpnifbase)
- local vpnip = gvpnip:formvalue(section)
- local gvpnif = uci:get_all("freifunk", "gvpn_node")
- util.update(gvpnif, uci:get_all(community, "gvpn_node") or {})
- if gvpnif and gvpnif.tundev and vpnip then
- uci:section("network", "interface", gvpnif.tundev, {
- ifname =gvpnif.tundev ,
- proto ="static" ,
- ipaddr =vpnip ,
- netmask =gvpnif.subnet or "255.255.255.192" ,
- })
- gvpnif.ip=""
- gvpnif.subnet=""
- gvpnif.up=""
- gvpnif.down=""
- gvpnif.mac="00:00:48:"..string.format("%X",string.gsub( vpnip, ".*%." , "" ))..":00:00"
- tools.firewall_zone_add_interface("freifunk", gvpnif.tundev)
- uci:section("l2gvpn", "node" , gvpnif.community , gvpnif)
- uci:save("network")
- uci:save("l2gvpn")
- uci:save("firewall")
- uci:save("olsrd")
- sys.init.enable("l2gvpn")
- end
- else
- -- Disable l2gvpn
- sys.exec("/etc/init.d/l2gvpn stop")
- sys.init.disable("l2gvpn")
- end
- end
- end
-
- uci:save("freifunk")
- uci:save("firewall")
- uci:save("olsrd")
- uci:save("system")
-end
-
-return f
-
diff --git a/applications/luci-ffwizard/luasrc/tools/ffwizard.lua b/applications/luci-ffwizard/luasrc/tools/ffwizard.lua
deleted file mode 100644
index 217cd44bb8..0000000000
--- a/applications/luci-ffwizard/luasrc/tools/ffwizard.lua
+++ /dev/null
@@ -1,149 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
-]]--
-
-local uci = require "luci.model.uci"
-local util = require "luci.util"
-local table = require "table"
-
-local type = type
-
-module "luci.tools.ffwizard"
-
--- Deletes all references of a wifi device
-function wifi_delete_ifaces(device)
- local cursor = uci.cursor()
- cursor:delete_all("wireless", "wifi-iface", {device=device})
- cursor:save("wireless")
-end
-
--- Deletes a network interface and all occurences of it in firewall zones and dhcp
-function network_remove_interface(iface)
- local cursor = uci.cursor()
-
- if not cursor:delete("network", iface) then
- return false
- end
-
- local aliases = {iface}
- cursor:foreach("network", "alias",
- function(section)
- if section.interface == iface then
- table.insert(aliases, section[".name"])
- end
- end)
-
- -- Delete Aliases and Routes
- cursor:delete_all("network", "route", {interface=iface})
- cursor:delete_all("network", "alias", {interface=iface})
-
- -- Delete DHCP sections
- cursor:delete_all("dhcp", "dhcp",
- function(section)
- return util.contains(aliases, section.interface)
- end)
-
- -- Remove OLSR sections
- cursor:delete_all("olsrd", "Interface", {Interface=iface})
-
- -- Remove Splash sections
- cursor:delete_all("luci-splash", "iface", {network=iface})
-
- cursor:save("network")
- cursor:save("olsr")
- cursor:save("dhcp")
- cursor:save("luci-splash")
-end
-
--- Creates a firewall zone
-function firewall_create_zone(zone, input, output, forward, masq)
- local cursor = uci.cursor()
- if not firewall_find_zone(zone) then
- local stat = cursor:section("firewall", "zone", nil, {
- input = input,
- output = output,
- forward = forward,
- masq = masq and "1",
- name = zone
- })
- cursor:save("firewall")
- return stat
- end
-end
-
--- Adds interface to zone, creates zone on-demand
-function firewall_zone_add_interface(name, interface)
- local cursor = uci.cursor()
- local zone = firewall_find_zone(name)
- local net = cursor:get("firewall", zone, "network")
- local old = net or (cursor:get("network", name) and name)
- cursor:set("firewall", zone, "network", (old and old .. " " or "") .. interface)
- cursor:save("firewall")
-end
-
--- Removes interface from zone
-function firewall_zone_remove_interface(name, interface)
- local cursor = uci.cursor()
- local zone = firewall_find_zone(name)
- if zone then
- local net = cursor:get("firewall", zone, "network")
- local new = remove_list_entry(net, interface)
- if new then
- if #new > 0 then
- cursor:set("firewall", zone, "network", new)
- else
- cursor:delete("firewall", zone, "network")
- end
- cursor:save("firewall")
- end
- end
-end
-
-
--- Finds the firewall zone with given name
-function firewall_find_zone(name)
- local find
-
- uci.cursor():foreach("firewall", "zone",
- function (section)
- if section.name == name then
- find = section[".name"]
- end
- end)
-
- return find
-end
-
-
-
--- Helpers --
-
--- Removes a listentry, handles real and pseduo lists transparently
-function remove_list_entry(value, entry)
- if type(value) == "nil" then
- return nil
- end
-
- local result = type(value) == "table" and value or util.split(value, " ")
- local key = util.contains(result, entry)
-
- while key do
- table.remove(result, key)
- key = util.contains(result, entry)
- end
-
- result = type(value) == "table" and result or table.concat(result, " ")
- return result ~= value and result
-end
diff --git a/applications/luci-ffwizard/luasrc/view/freifunk/ffwizard_error.htm b/applications/luci-ffwizard/luasrc/view/freifunk/ffwizard_error.htm
deleted file mode 100644
index c988051c5c..0000000000
--- a/applications/luci-ffwizard/luasrc/view/freifunk/ffwizard_error.htm
+++ /dev/null
@@ -1,26 +0,0 @@
-<%+header%>
-
-<%
-local uci = require "luci.model.uci".cursor()
-local basicsurl = luci.dispatcher.build_url(luci.dispatcher.context.path[1], "freifunk", "basics")
-local hostname = uci:get_first ("system", "system", "hostname")
-local latitude = uci:get_first ("system", "system", "latitude")
-local longitude = uci:get_first ("system", "system", "longitude")
-local location = uci:get_first ("system", "system", "location")
-%>
-
-<h2><%:Error%></h2>
-
-<%:You can not use the wizard because some necessary values are missing.%>
-<p/>
-
-<%
-local co = uci:get("freifunk", "community", "name")
-if not (co and hostname and latitude and longitude and location) then
-%>
-<%:Basic settings are incomplete. Please go to%> <a href='<%=basicsurl%>'><%:Basic settings%></a> <%:and fill out all required fields.%>
-<p/>
-<% end %>
-
-
-<%+footer%>
diff --git a/applications/luci-ffwizard/root/etc/uci-defaults/device-defaults b/applications/luci-ffwizard/root/etc/uci-defaults/device-defaults
deleted file mode 100755
index 3ebf4c0f0e..0000000000
--- a/applications/luci-ffwizard/root/etc/uci-defaults/device-defaults
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/sh
-
-# prevent running on sdk
-type config_get >/dev/null 2>/dev/null || exit 0
-
-set_default_config()
-{
- local cfg="$1"
- config_get type "$cfg" "type"
- case $type in
- atheros)
- uci -q batch <<-EOF
- set freifunk.wifi_device.channel=1
- set freifunk.wifi_device.diversity=1
- set freifunk.wifi_device.disabled=0
- set freifunk.wifi_device.txpower=""
- set freifunk.wifi_device.hwmode=11g
- set freifunk.wifi_device.distance=1000
- set freifunk.wifi_iface=defaults
- set freifunk.wifi_iface.mode=adhoc
- set freifunk.wifi_iface.bssid="02:CA:FF:EE:BA:BE"
- set freifunk.wifi_iface.sw_merge=1
- set freifunk.wifi_iface.mcast_rate=5500
- set freifunk.wifi_iface.probereq=1
- commit freifunk
- EOF
- ;;
- mac80211)
- uci -q batch <<-EOF
- set freifunk.wifi_device.channel=1
- set freifunk.wifi_device.diversity=1
- set freifunk.wifi_device.disabled=0
- set freifunk.wifi_device.txpower=""
- set freifunk.wifi_device.distance=1000
- set freifunk.wifi_device.htmode='HT40-'
- set freifunk.wifi_device.hwmode=11ng
- set freifunk.wifi_iface=defaults
- set freifunk.wifi_iface.mode=adhoc
- set freifunk.wifi_iface.bssid="02:CA:FF:EE:BA:BE"
- set freifunk.wifi_iface.sw_merge=""
- commit freifunk
- EOF
- ;;
- broadcom)
- uci -q batch <<-EOF
- set freifunk.wifi_device.channel=1
- set freifunk.wifi_device.diversity=1
- set freifunk.wifi_device.disabled=0
- set freifunk.wifi_device.txpower=""
- set freifunk.wifi_device.hwmode=11g
- set freifunk.wifi_device.distance=1000
- set freifunk.wifi_iface=defaults
- set freifunk.wifi_iface.encryption=none
- set freifunk.wifi_iface.mode=adhoc
- set freifunk.wifi_iface.bssid="02:CA:FF:EE:BA:BE"
- set freifunk.wifi_iface.sw_merge=""
- commit freifunk
- EOF
- ;;
- esac
-}
-
-
-
-(
-while true ; do
- sleep 30
- wifie=0
-
- config_load wireless && wifie=1
-
- if [ $wifie -eq 1 ] ; then
- config_foreach set_default_config wifi-device
-
- uci set freifunk.interface.dns="88.198.178.18 141.54.1.1 212.204.49.83 8.8.8.8 8.8.4.4"
- uci commit freifunk
- exit 0
- fi
-done
-) >/dev/null &
diff --git a/applications/luci-firewall/luasrc/controller/luci_fw/luci_fw.lua b/applications/luci-firewall/luasrc/controller/luci_fw/luci_fw.lua
index 5dd84bc90d..b3d440d1c0 100644
--- a/applications/luci-firewall/luasrc/controller/luci_fw/luci_fw.lua
+++ b/applications/luci-firewall/luasrc/controller/luci_fw/luci_fw.lua
@@ -1,13 +1,10 @@
module("luci.controller.luci_fw.luci_fw", package.seeall)
function index()
- require("luci.i18n").loadc("luci-fw")
- local i18n = luci.i18n.translate
-
- entry({"admin", "network", "firewall"}, alias("admin", "network", "firewall", "zones"), i18n("Firewall"), 60).i18n = "firewall"
+ entry({"admin", "network", "firewall"}, alias("admin", "network", "firewall", "zones"), _("Firewall"), 60).i18n = "firewall"
entry({"admin", "network", "firewall", "zones"}, arcombine(cbi("luci_fw/zones"), cbi("luci_fw/zone")), nil, 10).leaf = true
entry({"admin", "network", "firewall", "rule"}, arcombine(cbi("luci_fw/zones"), cbi("luci_fw/trule")), nil, 20).leaf = true
entry({"admin", "network", "firewall", "redirect"}, arcombine(cbi("luci_fw/zones"), cbi("luci_fw/rrule")), nil, 30).leaf = true
- entry({"mini", "network", "portfw"}, cbi("luci_fw/miniportfw", {autoapply=true}), i18n("Port forwarding"), 70).i18n = "firewall"
+ entry({"mini", "network", "portfw"}, cbi("luci_fw/miniportfw", {autoapply=true}), _("Port forwarding"), 70).i18n = "firewall"
end
diff --git a/applications/luci-freifunk-policyrouting/luasrc/controller/freifunk/policy-routing.lua b/applications/luci-freifunk-policyrouting/luasrc/controller/freifunk/policy-routing.lua
index 32c9c0ba4e..e8aca9ce57 100644
--- a/applications/luci-freifunk-policyrouting/luasrc/controller/freifunk/policy-routing.lua
+++ b/applications/luci-freifunk-policyrouting/luasrc/controller/freifunk/policy-routing.lua
@@ -10,14 +10,9 @@ You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
]]--
-
module "luci.controller.freifunk.policy-routing"
function index()
- require("luci.i18n").loadc("freifunk-policyrouting")
- local i18n = luci.i18n.translate
-
- entry({"admin", "freifunk", "policyrouting"}, cbi("freifunk/policyrouting"), i18n("Policy Routing"), 60)
+ entry({"admin", "freifunk", "policyrouting"}, cbi("freifunk/policyrouting"),
+ _("Policy Routing"), 60).i18n = "freifunk-policyrouting"
end
-
-
diff --git a/applications/luci-hd-idle/luasrc/controller/hd_idle.lua b/applications/luci-hd-idle/luasrc/controller/hd_idle.lua
index 9d5e5b3b30..e28983f390 100644
--- a/applications/luci-hd-idle/luasrc/controller/hd_idle.lua
+++ b/applications/luci-hd-idle/luasrc/controller/hd_idle.lua
@@ -16,13 +16,13 @@ $Id$
module("luci.controller.hd_idle", package.seeall)
function index()
- require("luci.i18n")
- luci.i18n.loadc("hd_idle")
- if not nixio.fs.access("/etc/config/hd-idle") then
- return
- end
-
- local page = entry({"admin", "services", "hd_idle"}, cbi("hd_idle"), luci.i18n.translate("hd-idle"), 60)
- page.i18n = "hd_idle"
- page.dependent = true
+ if not nixio.fs.access("/etc/config/hd-idle") then
+ return
+ end
+
+ local page
+
+ page = entry({"admin", "services", "hd_idle"}, cbi("hd_idle"), _("hd-idle"), 60)
+ page.i18n = "hd_idle"
+ page.dependent = true
end
diff --git a/applications/luci-lqtapifoss/luasrc/controller/lqtapifoss.lua b/applications/luci-lqtapifoss/luasrc/controller/lqtapifoss.lua
index 08941874a2..323f8a7c41 100644
--- a/applications/luci-lqtapifoss/luasrc/controller/lqtapifoss.lua
+++ b/applications/luci-lqtapifoss/luasrc/controller/lqtapifoss.lua
@@ -10,6 +10,7 @@ You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
]]--
+
module("luci.controller.lqtapifoss", package.seeall)
function index()
@@ -17,11 +18,13 @@ function index()
return
end
- local e = entry({"admin", "telephony"}, template("luci_lqvoip/index") , luci.i18n.translate("VoIP"), 90)
+ local e
+
+ e = entry({"admin", "telephony"}, template("luci_lqvoip/index") , _("VoIP"), 90)
e.index = true
e.i18n = "telephony"
- --local e = entry({"admin", "telephony", "config"}, cbi("luci_lqvoip/config") , luci.i18n.translate("Config"), 10)
- local e = entry({"admin", "telephony", "account"}, cbi("luci_lqvoip/account") , luci.i18n.translate("Account"), 20)
- local e = entry({"admin", "telephony", "contact"}, cbi("luci_lqvoip/contact") , luci.i18n.translate("Contacts"), 30)
+ --entry({"admin", "telephony", "config"}, cbi("luci_lqvoip/config") , _("Config"), 10)
+ entry({"admin", "telephony", "account"}, cbi("luci_lqvoip/account") , _("Account"), 20)
+ entry({"admin", "telephony", "contact"}, cbi("luci_lqvoip/contact") , _("Contacts"), 30)
end
diff --git a/applications/luci-meshwizard/luasrc/controller/meshwizard.lua b/applications/luci-meshwizard/luasrc/controller/meshwizard.lua
index 4e930cc50d..942987db50 100644
--- a/applications/luci-meshwizard/luasrc/controller/meshwizard.lua
+++ b/applications/luci-meshwizard/luasrc/controller/meshwizard.lua
@@ -14,8 +14,6 @@ http://www.apache.org/licenses/LICENSE-2.0
module "luci.controller.meshwizard"
function index()
- require("luci.i18n").loadc("meshwizard")
- local i18n = luci.i18n.translate
- entry({"admin", "freifunk", "meshwizard"}, cbi("freifunk/meshwizard"), i18n("Mesh Wizard"), 40)
+ entry({"admin", "freifunk", "meshwizard"}, cbi("freifunk/meshwizard"), _("Mesh Wizard"), 40)
end
diff --git a/applications/luci-mmc-over-gpio/luasrc/controller/mmc_over_gpio.lua b/applications/luci-mmc-over-gpio/luasrc/controller/mmc_over_gpio.lua
index 9ee2a9dec6..5abceab7aa 100644
--- a/applications/luci-mmc-over-gpio/luasrc/controller/mmc_over_gpio.lua
+++ b/applications/luci-mmc-over-gpio/luasrc/controller/mmc_over_gpio.lua
@@ -16,13 +16,13 @@ $Id$
module("luci.controller.mmc_over_gpio", package.seeall)
function index()
- require("luci.i18n")
- luci.i18n.loadc("mmc_over_gpio")
- if not nixio.fs.access("/etc/config/mmc_over_gpio") then
- return
- end
-
- local page = entry({"admin", "system", "mmc_over_gpio"}, cbi("mmc_over_gpio"), luci.i18n.translate("MMC/SD driver configuration"), 60)
- page.i18n = "mmc_over_gpio"
- page.dependent = true
+ if not nixio.fs.access("/etc/config/mmc_over_gpio") then
+ return
+ end
+
+ local page
+
+ page = entry({"admin", "system", "mmc_over_gpio"}, cbi("mmc_over_gpio"), _("MMC/SD driver configuration"), 60)
+ page.i18n = "mmc_over_gpio"
+ page.dependent = true
end
diff --git a/applications/luci-multiwan/luasrc/controller/multiwan.lua b/applications/luci-multiwan/luasrc/controller/multiwan.lua
index 561747b0f6..6aa4cf454a 100644
--- a/applications/luci-multiwan/luasrc/controller/multiwan.lua
+++ b/applications/luci-multiwan/luasrc/controller/multiwan.lua
@@ -1,18 +1,62 @@
module("luci.controller.multiwan", package.seeall)
function index()
- local fs = luci.fs or nixio.fs
- if not fs.access("/etc/config/multiwan") then
+ local fs = luci.fs or nixio.fs
+ if not fs.access("/etc/config/multiwan") then
return
end
+
+ local page
+
+ page = entry({"admin", "network", "multiwan"}, cbi("multiwan/multiwan"), _("Multi-WAN"))
+ page.i18n = "multiwan"
+ page.dependent = true
- local page = entry({"admin", "network", "multiwan"}, cbi("multiwan/multiwan"), "Multi-WAN")
+ entry({"admin", "network", "multiwan", "status"}, call("multiwan_status"))
+
+ page = entry({"mini", "network", "multiwan"}, cbi("multiwan/multiwanmini", {autoapply=true}), _("Multi-WAN"))
page.i18n = "multiwan"
page.dependent = true
+end
+function multiwan_status()
+ local nfs = require "nixio.fs"
+ local cachefile = "/tmp/.mwan/cache"
+
+ local rv = { }
+
+ cachefile = nfs.readfile(cachefile)
+ if cachefile then
+ local ntm = require "luci.model.network".init()
+ _, _, wan_if_map = string.find(cachefile, "wan_if_map=\"([^\"]*)\"")
+ _, _, wan_fail_map = string.find(cachefile, "wan_fail_map=\"([^\"]*)\"")
+ _, _, wan_recovery_map = string.find(cachefile, "wan_recovery_map=\"([^\"]*)\"")
+
+ rv.wans = { }
+ wansid = {}
- local page = entry({"mini", "network", "multiwan"}, cbi("multiwan/multiwanmini", {autoapply=true}), "Multi-WAN")
- page.i18n = "multiwan"
- page.dependent = true
+ for wanname, wanifname in string.gfind(wan_if_map, "([^%[]+)%[([^%]]+)%]") do
+ local wanlink = ntm:get_interface(wanifname)
+ wanlink = wanlink and wanlink:get_network()
+ wanlink = wanlink and wanlink:adminlink() or "#"
+ wansid[wanname] = #rv.wans + 1
+ rv.wans[wansid[wanname]] = { name = wanname, link = wanlink, ifname = wanifname, status = "ok", count = 0 }
+ end
+ for wanname, failcount in string.gfind(wan_fail_map, "([^%[]+)%[([^%]]+)%]") do
+ if failcount == "x" then
+ rv.wans[wansid[wanname]].status = "ko"
+ else
+ rv.wans[wansid[wanname]].status = "failing"
+ rv.wans[wansid[wanname]].count = failcount
+ end
+ end
+
+ for wanname, recoverycount in string.gfind(wan_recovery_map, "([^%[]+)%[([^%]]+)%]") do
+ rv.wans[wansid[wanname]].status = "recovering"
+ rv.wans[wansid[wanname]].count = recoverycount
+ end
+ end
+ luci.http.prepare_content("application/json")
+ luci.http.write_json(rv)
end
diff --git a/applications/luci-multiwan/luasrc/view/admin_status/index/multiwan.htm b/applications/luci-multiwan/luasrc/view/admin_status/index/multiwan.htm
new file mode 100644
index 0000000000..79c04539ff
--- /dev/null
+++ b/applications/luci-multiwan/luasrc/view/admin_status/index/multiwan.htm
@@ -0,0 +1 @@
+<%+multiwan_status%>
diff --git a/applications/luci-multiwan/luasrc/view/multiwan_status.htm b/applications/luci-multiwan/luasrc/view/multiwan_status.htm
new file mode 100644
index 0000000000..8c4127b237
--- /dev/null
+++ b/applications/luci-multiwan/luasrc/view/multiwan_status.htm
@@ -0,0 +1,71 @@
+<script type="text/javascript">//<![CDATA[
+ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "multiwan", "status")%>', null,
+ function(x, st)
+ {
+ var tx = document.getElementById('multiwan_status_text');
+ if (tx)
+ {
+ if (st && st.wans)
+ {
+ var temp = '';
+
+ for( var i = 0; i < st.wans.length; i++ )
+ {
+ var stat = '<%:Unknown%>';
+ var cssc = '';
+
+ switch (st.wans[i].status)
+ {
+ case 'ok':
+ stat = '<%:OK%>';
+ cssc = 'wanok';
+ break;
+
+ case 'ko':
+ stat = '<%:KO%>';
+ cssc = 'wanko';
+ break;
+
+ case 'recovering':
+ stat = String.format('<%:Recovering%>(%d)', st.wans[i].count);
+ cssc = 'wanrecov';
+ break;
+
+ case 'failing':
+ stat = String.format('<%:Failing%>(%d)', st.wans[i].count);
+ cssc = 'wanfail';
+ break;
+ }
+
+ temp += String.format(
+ '<span class="%s"><strong>%s (<a href="%q">%s</a>) :</strong> %s</span>',
+ cssc, st.wans[i].name, st.wans[i].link, st.wans[i].ifname, stat
+ );
+ }
+
+ tx.innerHTML = temp;
+ }
+ else
+ {
+ tx.innerHTML = '';
+ }
+ }
+ }
+ );
+//]]></script>
+
+<style type="text/css">
+ .wanok { background-color: rgb(144, 240, 144); }
+ .wanko { background-color: rgb(240, 144, 144); }
+ .wanrecov { background-color: rgb(240, 240, 0); }
+ .wanfail { background-color: rgb(255, 165, 0); }
+ .wanko, .wanok, .wanrecov, .wanfail {
+ padding: 0.4em;
+ margin: 0.4em;
+ }
+</style>
+
+<fieldset class="cbi-section">
+ <legend><%:Multi-WAN Status%></legend>
+ <div id="multiwan_status_text" style="text-align:center;"><em><%:Collecting data...%></em></div>
+</fieldset>
diff --git a/applications/luci-ntpc/luasrc/controller/ntpc.lua b/applications/luci-ntpc/luasrc/controller/ntpc.lua
index b6af6f9502..782e216143 100644
--- a/applications/luci-ntpc/luasrc/controller/ntpc.lua
+++ b/applications/luci-ntpc/luasrc/controller/ntpc.lua
@@ -12,21 +12,21 @@ You may obtain a copy of the License at
$Id$
]]--
+
module("luci.controller.ntpc", package.seeall)
function index()
- require("luci.i18n")
- luci.i18n.loadc("ntpc")
if not nixio.fs.access("/etc/config/ntpclient") then
return
end
- local page = entry({"admin", "system", "ntpc"}, cbi("ntpc/ntpc"), luci.i18n.translate("Time Synchronisation"), 50)
+ local page
+
+ page = entry({"admin", "system", "ntpc"}, cbi("ntpc/ntpc"), _("Time Synchronisation"), 50)
page.i18n = "ntpc"
page.dependent = true
-
-
- local page = entry({"mini", "system", "ntpc"}, cbi("ntpc/ntpcmini", {autoapply=true}), luci.i18n.translate("Time Synchronisation"), 50)
+
+ page = entry({"mini", "system", "ntpc"}, cbi("ntpc/ntpcmini", {autoapply=true}), _("Time Synchronisation"), 50)
page.i18n = "ntpc"
page.dependent = true
-end \ No newline at end of file
+end
diff --git a/applications/luci-olsr-services/luasrc/controller/services.lua b/applications/luci-olsr-services/luasrc/controller/services.lua
index cc1a2f62e8..a4636bfd57 100644
--- a/applications/luci-olsr-services/luasrc/controller/services.lua
+++ b/applications/luci-olsr-services/luasrc/controller/services.lua
@@ -2,7 +2,6 @@ module "luci.controller.services"
function index()
local uci = require "luci.model.uci".cursor()
- local i18n = luci.i18n.translate
uci:foreach("olsrd", "LoadPlugin", function(s)
if s.library == "olsrd_nameservice.so.0.3" then
@@ -11,7 +10,7 @@ function index()
end)
if has_serv then
- entry({"freifunk", "services"}, template("freifunk-services/services"), i18n("Services"), 60)
+ entry({"freifunk", "services"}, template("freifunk-services/services"), _("Services"), 60)
end
end
diff --git a/applications/luci-olsr-viz/luasrc/controller/olsr-viz.lua b/applications/luci-olsr-viz/luasrc/controller/olsr-viz.lua
index 4981f8d05f..672486c53b 100644
--- a/applications/luci-olsr-viz/luasrc/controller/olsr-viz.lua
+++ b/applications/luci-olsr-viz/luasrc/controller/olsr-viz.lua
@@ -1,5 +1,5 @@
module "luci.controller.olsr-viz"
function index()
- entry({"admin", "status", "olsr", "olsr-viz"}, template("olsr-viz/olsr-viz"), "OLSR-Viz", 90)
+ entry({"admin", "status", "olsr", "olsr-viz"}, template("olsr-viz/olsr-viz"), _("OLSR-Viz"), 90)
end
diff --git a/applications/luci-olsr/luasrc/controller/olsr.lua b/applications/luci-olsr/luasrc/controller/olsr.lua
index c7c7f01410..6d6dc1ace2 100644
--- a/applications/luci-olsr/luasrc/controller/olsr.lua
+++ b/applications/luci-olsr/luasrc/controller/olsr.lua
@@ -5,49 +5,46 @@ function index()
return
end
- require("luci.i18n").loadc("olsr")
- local i18n = luci.i18n.translate
-
local page = node("admin", "status", "olsr")
page.target = template("status-olsr/overview")
- page.title = i18n("OLSR")
+ page.title = _("OLSR")
page.i18n = "olsr"
page.subindex = true
local page = node("admin", "status", "olsr", "neighbors")
page.target = call("action_neigh")
- page.title = i18n("Neighbours")
+ page.title = _("Neighbours")
page.subindex = true
page.order = 5
local page = node("admin", "status", "olsr", "routes")
page.target = call("action_routes")
- page.title = i18n("Routes")
+ page.title = _("Routes")
page.order = 10
local page = node("admin", "status", "olsr", "topology")
page.target = call("action_topology")
- page.title = i18n("Topology")
+ page.title = _("Topology")
page.order = 20
local page = node("admin", "status", "olsr", "hna")
page.target = call("action_hna")
- page.title = i18n("HNA")
+ page.title = _("HNA")
page.order = 30
local page = node("admin", "status", "olsr", "mid")
page.target = call("action_mid")
- page.title = i18n("MID")
+ page.title = _("MID")
page.order = 50
local page = node("admin", "status", "olsr", "smartgw")
page.target = call("action_smartgw")
- page.title = i18n("SmartGW")
+ page.title = _("SmartGW")
page.order = 60
local page = node("admin", "status", "olsr", "interfaces")
page.target = call("action_interfaces")
- page.title = i18n("Interfaces")
+ page.title = _("Interfaces")
page.order = 70
local ol = entry(
@@ -64,17 +61,17 @@ function index()
entry(
{"admin", "services", "olsrd", "hna"},
- cbi("olsr/olsrdhna"), i18n("HNA Announcements")
+ cbi("olsr/olsrdhna"), _("HNA Announcements")
)
oplg = entry(
{"admin", "services", "olsrd", "plugins"},
- cbi("olsr/olsrdplugins"), i18n("Plugins")
+ cbi("olsr/olsrdplugins"), _("Plugins")
)
odsp = entry(
{"admin", "services", "olsrd", "display"},
- cbi("olsr/olsrddisplay"), i18n("Display")
+ cbi("olsr/olsrddisplay"), _("Display")
)
oplg.i18n = "olsr"
diff --git a/applications/luci-olsr/luasrc/model/cbi/olsr/olsrd.lua b/applications/luci-olsr/luasrc/model/cbi/olsr/olsrd.lua
index 82b7728915..9bdf3a34ce 100644
--- a/applications/luci-olsr/luasrc/model/cbi/olsr/olsrd.lua
+++ b/applications/luci-olsr/luasrc/model/cbi/olsr/olsrd.lua
@@ -106,7 +106,7 @@ lqage:depends("LinkQualityLevel", "2")
lqa = s:taboption("lquality", ListValue, "LinkQualityAlgorithm", translate("LQ algorithm"),
translate("Link quality algorithm (only for lq level 2).<br />"..
"<b>etx_float</b>: floating point ETX with exponential aging<br />"..
- "<b>etx_fpm</b> : same as ext_float, but with integer arithmetic<br />"..
+ "<b>etx_fpm</b> : same as etx_float, but with integer arithmetic<br />"..
"<b>etx_ff</b> : ETX freifunk, an etx variant which use all OLSR traffic (instead of only hellos) for ETX calculation<br />"..
"<b>etx_ffeth</b>: incompatible variant of etx_ff that allows ethernet links with ETX 0.1.<br />"..
"Defaults to \"etx_ff\""))
diff --git a/applications/luci-openvpn/luasrc/controller/openvpn.lua b/applications/luci-openvpn/luasrc/controller/openvpn.lua
index ddfa990916..691ce178d5 100644
--- a/applications/luci-openvpn/luasrc/controller/openvpn.lua
+++ b/applications/luci-openvpn/luasrc/controller/openvpn.lua
@@ -12,13 +12,11 @@ You may obtain a copy of the License at
$Id$
]]--
+
module("luci.controller.openvpn", package.seeall)
function index()
- require("luci.i18n")
- luci.i18n.loadc("openvpn")
-
- entry( {"admin", "services", "openvpn"}, cbi("openvpn"), luci.i18n.translate("OpenVPN") ).i18n = "openvpn"
+ entry( {"admin", "services", "openvpn"}, cbi("openvpn"), _("OpenVPN") ).i18n = "openvpn"
entry( {"admin", "services", "openvpn", "basic"}, cbi("openvpn-basic"), nil ).leaf = true
entry( {"admin", "services", "openvpn", "advanced"}, cbi("openvpn-advanced"), nil ).leaf = true
end
diff --git a/applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua b/applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua
index 8782cce92b..eee08eb813 100644
--- a/applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua
+++ b/applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua
@@ -13,190 +13,192 @@ $Id$
]]--
require("luci.ip")
+require("luci.model.uci")
local knownParams = {
--
- -- Widget Name Optn. Default(s)
+ -- Widget Name Default(s) Description Option(s)
--
- { "service", {
+ { "Service", {
-- initialisation and daemon options
- { ListValue, "verb", { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } },
- { Flag, "mlock", 0 },
- { Flag, "disable_occ", 0 },
- -- { Value, "user", "root" },
- -- { Value, "group", "root" },
- { Value, "cd", "/etc/openvpn" },
- { Value, "chroot", "/var/run" },
- -- { Value, "daemon", "Instance-Name" },
- -- { Value, "syslog", "Instance-Name" },
- { Flag, "passtos", 0 },
- -- { Value, "inetd", "nowait Instance-Name" },
- { Value, "log", "/var/log/openvpn.log" },
- { Value, "log_append", "/var/log/openvpn.log" },
- { Flag, "suppress_timestamps", 0 },
- -- { Value, "writepid", "/var/run/openvpn.pid" },
- { Value, "nice", 0 },
- { Flag, "fast_io", 0 },
- { Value, "echo", "some params echoed to log" },
- { ListValue, "remap_usr1", { "SIGHUP", "SIGTERM" } },
- { Value, "status", "/var/run/openvpn.status 5" },
- { Value, "status_version", { 1, 2 } }, -- status
- { Value, "mute", 5 },
-
- { Value, "up", "/usr/bin/ovpn-up" },
- { Value, "up_delay", 5 },
- { Value, "down", "/usr/bin/ovpn-down" },
- { Flag, "down_pre", 0 },
- { Flag, "up_restart", 0 },
- { Value, "route_up", "/usr/bin/ovpn-routeup" },
- { Value, "ipchange", "/usr/bin/ovpn-ipchange", { mode="p2p" } },
- { DynamicList, "setenv", { "VAR1 value1", "VAR2 value2" } },
- { Value, "tls_verify", "/usr/bin/ovpn-tlsverify" },
- { Value, "client_connect", "/usr/bin/ovpn-clientconnect" },
- { Flag, "client_disconnect", 0 },
- { Value, "learn_address", "/usr/bin/ovpn-learnaddress" },
- { Value, "auth_user_pass_verify", "/usr/bin/ovpn-userpass via-env" },
- { ListValue, "script_security", { 0, 1, 2, 3 }, {mode="server" } },
+ { ListValue, "verb", { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, translate("Set output verbosity") },
+ { Flag, "mlock", 0, translate("Disable Paging") },
+ { Flag, "disable_occ", 0, translate("Disable options consistency check") },
+ -- { Value, "user", "root", translate("Set UID to user") },
+ -- { Value, "group", "root", translate("Set GID to group") },
+ { Value, "cd", "/etc/openvpn", translate("Change to directory before initialization") },
+ { Value, "chroot", "/var/run", translate("Chroot to directory after initialization") },
+ -- { Value, "daemon", "Instance-Name", translate("Daemonize after initialization") },
+ -- { Value, "syslog", "Instance-Name", translate("Output to syslog and do not daemonize") },
+ { Flag, "passtos", 0, translate("TOS passthrough (applies to IPv4 only)") },
+ -- { Value, "inetd", "nowait Instance-Name", translate("Run as an inetd or xinetd server") },
+ { Value, "log", "/var/log/openvpn.log", translate("Write log to file") },
+ { Value, "log_append", "/var/log/openvpn.log", translate("Append log to file") },
+ { Flag, "suppress_timestamps", 0, translate("Don't log timestamps") },
+ -- { Value, "writepid", "/var/run/openvpn.pid", translate("Write process ID to file") },
+ { Value, "nice", 0, translate("Change process priority") },
+ { Flag, "fast_io", 0, translate("Optimize TUN/TAP/UDP writes") },
+ { Value, "echo", "some params echoed to log", translate("Echo parameters to log") },
+ { ListValue, "remap_usr1", { "SIGHUP", "SIGTERM" }, translate("Remap SIGUSR1 signals") },
+ { Value, "status", "/var/run/openvpn.status 5", translate("Write status to file every n seconds") },
+ { Value, "status_version", { 1, 2 }, translate("Status file format version") }, -- status
+ { Value, "mute", 5, translate("Limit repeated log messages") },
+
+ { Value, "up", "/usr/bin/ovpn-up", translate("Shell cmd to execute after tun device open") },
+ { Value, "up_delay", 5, translate("Delay tun/tap open and up script execution") },
+ { Value, "down", "/usr/bin/ovpn-down", translate("Shell cmd to run after tun device close") },
+ { Flag, "down_pre", 0, translate("Call down cmd/script before TUN/TAP close") },
+ { Flag, "up_restart", 0, translate("Run up/down scripts for all restarts") },
+ { Value, "route_up", "/usr/bin/ovpn-routeup", translate("Execute shell cmd after routes are added") },
+ { Value, "ipchange", "/usr/bin/ovpn-ipchange", translate("Execute shell command on remote ip change"), { mode="p2p" } },
+ { DynamicList, "setenv", { "VAR1 value1", "VAR2 value2" }, translate("Pass environment variables to script") },
+ { Value, "tls_verify", "/usr/bin/ovpn-tlsverify", translate("Shell command to verify X509 name") },
+ { Value, "client_connect", "/usr/bin/ovpn-clientconnect", translate("Run script cmd on client connection") },
+ { Flag, "client_disconnect", 0, translate("Run script cmd on client disconnection") },
+ { Value, "learn_address", "/usr/bin/ovpn-learnaddress", translate("Executed in server mode whenever an IPv4 address/route or MAC address is added to OpenVPN's internal routing table") },
+ { Value, "auth_user_pass_verify", "/usr/bin/ovpn-userpass via-env", translate("Executed in server mode on new client connections, when the client is still untrusted") },
+ { ListValue, "script_security", { 0, 1, 2, 3 }, translate("Policy level over usage of external programs and scripts"), {mode="server" } },
} },
- { "networking", {
+ { "Networking", {
-- socket config
- { ListValue, "mode", { "p2p", "server" } },
- { Value, "local", "0.0.0.0" },
- { Value, "port", 1194 },
- { Value, "lport", 1194 },
- { Value, "rport", 1194 },
- { Flag, "float", 0 },
- { Flag, "nobind", 0 },
-
- { Value, "dev", "tun0" },
- { ListValue, "dev_type", { "tun", "tap" } },
- { Value, "dev_node", "/dev/net/tun" },
- { Flag, "tun_ipv6", 0 },
-
- { Value, "ifconfig", "10.200.200.3 10.200.200.1" },
- { Flag, "ifconfig_noexec", 0 },
- { Flag, "ifconfig_nowarn", 0 },
-
- { DynamicList, "route", "10.123.0.0 255.255.0.0" },
- { Value, "route_gateway", "10.234.1.1" },
- { Value, "route_delay", 0 },
- { Flag, "route_noexec", 0 },
-
- { ListValue, "mtu_disc", { "yes", "maybe", "no" } },
- { Flag, "mtu_test", 0 },
- { Flag, "comp_lzo", 0 },
- { Flag, "comp_noadept", 0, { comp_lzo=1 } },
- { Value, "link_mtu", 1500 },
- { Value, "tun_mtu", 1500 },
- { Value, "tun_mtu_extra", 1500 },
- { Value, "fragment", 1500, { proto="udp" } },
- { Value, "mssfix", 1500, { proto="udp" } },
- { Value, "sndbuf", 65536 },
- { Value, "rcvbuf", 65536 },
- { Value, "txqueuelen", 100 },
- { Value, "shaper", 10240 },
-
- { Value, "inactive", 240 },
- { Value, "keepalive", "10 60" },
- { Value, "ping", 30 },
- { Value, "ping_exit", 120 },
- { Value, "ping_restart", 60 },
- { Flag, "ping_timer_rem", 0 },
-
- { Flag, "persist_tun", 0 },
- { Flag, "persist_key", 0 },
- { Flag, "persist_local_ip", 0 },
- { Flag, "persist_remote_ip", 0 },
+ { ListValue, "mode", { "p2p", "server" }, translate("Major mode") },
+ { Value, "local", "0.0.0.0", translate("Local host name or ip address") },
+ { Value, "port", 1194, translate("TCP/UDP port # for both local and remote") },
+ { Value, "lport", 1194, translate("TCP/UDP port # for local (default=1194)") },
+ { Value, "rport", 1194, translate("TCP/UDP port # for remote (default=1194)") },
+ { Flag, "float", 0, translate("Allow remote to change its IP or port") },
+ { Flag, "nobind", 0, translate("Do not bind to local address and port") },
+
+ { Value, "dev", "tun0", translate("tun/tap device") },
+ { ListValue, "dev_type", { "tun", "tap" }, translate("Type of used device") },
+ { Value, "dev_node", "/dev/net/tun", translate("Use tun/tap device node") },
+ { Flag, "tun_ipv6", 0, translate("Make tun device IPv6 capable") },
+
+ { Value, "ifconfig", "10.200.200.3 10.200.200.1", translate("Set tun/tap adapter parameters") },
+ { Flag, "ifconfig_noexec", 0, translate("Don't actually execute ifconfig") },
+ { Flag, "ifconfig_nowarn", 0, translate("Don't warn on ifconfig inconsistencies") },
+
+ { DynamicList, "route", "10.123.0.0 255.255.0.0", translate("Add route after establishing connection") },
+ { Value, "route_gateway", "10.234.1.1", translate("Specify a default gateway for routes") },
+ { Value, "route_delay", 0, translate("Delay n seconds after connection") },
+ { Flag, "route_noexec", 0, translate("Don't add routes automatically") },
+
+ { ListValue, "mtu_disc", { "yes", "maybe", "no" }, translate("Enable Path MTU discovery") },
+ { Flag, "mtu_test", 0, translate("Empirically measure MTU") },
+ { Flag, "comp_lzo", 0, translate("Use fast LZO compression") },
+ { Flag, "comp_noadapt", 0, translate("Don't use adaptive lzo compression"), { comp_lzo=1 } },
+ { Value, "link_mtu", 1500, translate("Set TCP/UDP MTU") },
+ { Value, "tun_mtu", 1500, translate("Set tun/tap device MTU") },
+ { Value, "tun_mtu_extra", 1500, translate("Set tun/tap device overhead") },
+ { Value, "fragment", 1500, translate("Enable internal datagram fragmentation"), { proto="udp" } },
+ { Value, "mssfix", 1500, translate("Set upper bound on TCP MSS"), { proto="udp" } },
+ { Value, "sndbuf", 65536, translate("Set the TCP/UDP send buffer size") },
+ { Value, "rcvbuf", 65536, translate("Set the TCP/UDP receive buffer size") },
+ { Value, "txqueuelen", 100, translate("Set tun/tap TX queue length") },
+ { Value, "shaper", 10240, translate("Shaping for peer bandwidth") },
+
+ { Value, "inactive", 240, translate("tun/tap inactivity timeout") },
+ { Value, "keepalive", "10 60", translate("Helper directive to simplify the expression of --ping and --ping-restart in server mode configurations") },
+ { Value, "ping", 30, translate("Ping remote every n seconds over TCP/UDP port") },
+ { Value, "ping_exit", 120, translate("Remote ping timeout") },
+ { Value, "ping_restart", 60, translate("Restart after remote ping timeout") },
+ { Flag, "ping_timer_rem", 0, translate("Only process ping timeouts if routes exist") },
+
+ { Flag, "persist_tun", 0, translate("Keep tun/tap device open on restart") },
+ { Flag, "persist_key", 0, translate("Don't re-read key on restart") },
+ { Flag, "persist_local_ip", 0, translate("Keep local IP address on restart") },
+ { Flag, "persist_remote_ip", 0, translate("Keep remote IP address on restart") },
-- management channel
- { Value, "management", "127.0.0.1 31194 /etc/openvpn/mngmt-pwds" },
- { Flag, "management_query_passwords", 0 }, -- management
- { Flag, "management_hold", 0 }, -- management
- { Value, "management_log_cache", 100 }, -- management
- { ListValue, "topology", { "net30", "p2p", "subnet" }, {dev_type="tun" } },
+ { Value, "management", "127.0.0.1 31194 /etc/openvpn/mngmt-pwds", translate("Enable management interface on <em>IP</em> <em>port</em>") },
+ { Flag, "management_query_passwords", 0, translate("Query management channel for private key") }, -- management
+ { Flag, "management_hold", 0, translate("Start OpenVPN in a hibernating state") }, -- management
+ { Value, "management_log_cache", 100, translate("Number of lines for log file history") }, -- management
+ { ListValue, "topology", { "net30", "p2p", "subnet" }, translate("'net30', 'p2p', or 'subnet'"), {dev_type="tun" } },
} },
- { "vpn", {
- { Value, "server", "10.200.200.0 255.255.255.0", { server_mode="1" } },
- { Value, "server_bridge", "10.200.200.1 255.255.255.0 10.200.200.200 10.200.200.250", { server_mode="1" } },
- { DynamicList, "push", { "redirect-gateway", "comp-lzo" }, { server_mode="1" } },
- { Flag, "push_reset", 0, { server_mode="1" } },
- { Flag, "disable", 0, { server_mode="1" } },
- { Value, "ifconfig_pool", "10.200.200.100 10.200.200.150 255.255.255.0", { server_mode="1" } },
- { Value, "ifconfig_pool_persist", "/etc/openvpn/ipp.txt 600", { server_mode="1" } },
- { Flag, "ifconfig_pool_linear", 0, { server_mode="1" } },
- { Value, "ifconfig_push", "10.200.200.1 255.255.255.255", { server_mode="1" } },
- { Value, "iroute", "10.200.200.0 255.255.255.0", { server_mode="1" } },
- { Flag, "client_to_client", 0, { server_mode="1" } },
- { Flag, "duplicate_cn", 0, { server_mode="1" } },
- { Value, "client_config_dir", "/etc/openvpn/ccd", { server_mode="1" } },
- { Flag, "ccd_exclusive", 0, { server_mode="1" } },
- { Value, "tmp_dir", "/var/run/openvpn", { server_mode="1" } },
- { Value, "hash_size", "256 256", { server_mode="1" } },
- { Value, "bcast_buffers", 256, { server_mode="1" } },
- { Value, "tcp_queue_limit", 64, { server_mode="1" } },
- { Value, "max_clients", 10, { server_mode="1" } },
- { Value, "max_routes_per_client", 256, { server_mode="1" } },
- { Value, "connect_freq", "3 10", { server_mode="1" } },
- { Flag, "client_cert_not_required", 0, { server_mode="1" } },
- { Flag, "username_as_common_name", 0, { server_mode="1" } },
- { Flag, "client", 0, { server_mode="0" }, { server_mode="" } },
- { Flag, "pull", 0, { client="1" } },
- { Value, "auth_user_pass", "/etc/openvpn/userpass.txt", { client="1" } },
- { ListValue, "auth_retry", { "none", "nointeract", "interact" }, { client="1" } },
- { Value, "explicit_exit_notify", 1, { client="1" } },
- { DynamicList, "remote", "1.2.3.4", { client="1" } }, -- client
- { Flag, "remote_random", 1, { client="1" } }, -- client
- { ListValue, "proto", { "udp", "tcp-client", "tcp-server" }, { client="1" } },
- { Value, "connect_retry", 5, { proto="tcp-client" }, { client="1" } }, -- client && proto=tcp-client
- { Value, "http_proxy_server", "192.168.1.100 8080", { client="1" } }, -- client
- { Flag, "http_proxy_retry", 0, { client="1" } }, -- client && http_proxy_server
- { Value, "http_proxy_timeout", 5, { client="1" } }, -- client && http_proxy_server
- { DynamicList, "http_proxy_option", { "VERSION 1.0", "AGENT OpenVPN/2.0.9" }, { client="1" } }, -- client && http_proxy_server
- { Value, "socks_proxy_server", "192.168.1.200 1080", { client="1" } }, -- client
- { Value, "socks_proxy_retry", 5, { client="1" } }, -- client && socks_proxy_server
- { Value, "resolv_retry", "infinite", { client="1" } }, -- client
- { ListValue, "redirect_gateway", { "", "local", "def1", "local def1" }, { client="1" } }, -- client
+ { "VPN", {
+ { Value, "server", "10.200.200.0 255.255.255.0", translate("Configure server mode"), { server_mode="1" } },
+ { Value, "server_bridge", "10.200.200.1 255.255.255.0 10.200.200.200 10.200.200.250", translate("Configure server bridge"), { server_mode="1" } },
+ { DynamicList, "push", { "redirect-gateway", "comp-lzo" }, translate("Push options to peer"), { server_mode="1" } },
+ { Flag, "push_reset", 0, translate("Don't inherit global push options"), { server_mode="1" } },
+ { Flag, "disable", 0, translate("Client is disabled"), { server_mode="1" } },
+ { Value, "ifconfig_pool", "10.200.200.100 10.200.200.150 255.255.255.0", translate("Set aside a pool of subnets"), { server_mode="1" } },
+ { Value, "ifconfig_pool_persist", "/etc/openvpn/ipp.txt 600", translate("Persist/unpersist ifconfig-pool"), { server_mode="1" } },
+-- { Flag, "ifconfig_pool_linear", 0, translate("Use individual addresses rather than /30 subnets"), { server_mode="1" } }, -- deprecated and replaced by --topology p2p
+ { Value, "ifconfig_push", "10.200.200.1 255.255.255.255", translate("Push an ifconfig option to remote"), { server_mode="1" } },
+ { Value, "iroute", "10.200.200.0 255.255.255.0", translate("Route subnet to client"), { server_mode="1" } },
+ { Flag, "client_to_client", 0, translate("Allow client-to-client traffic"), { server_mode="1" } },
+ { Flag, "duplicate_cn", 0, translate("Allow multiple clients with same certificate"), { server_mode="1" } },
+ { Value, "client_config_dir", "/etc/openvpn/ccd", translate("Directory for custom client config files"), { server_mode="1" } },
+ { Flag, "ccd_exclusive", 0, translate("Refuse connection if no custom client config"), { server_mode="1" } },
+ { Value, "tmp_dir", "/var/run/openvpn", translate("Temporary directory for client-connect return file"), { server_mode="1" } },
+ { Value, "hash_size", "256 256", translate("Set size of real and virtual address hash tables"), { server_mode="1" } },
+ { Value, "bcast_buffers", 256, translate("Number of allocated broadcast buffers"), { server_mode="1" } },
+ { Value, "tcp_queue_limit", 64, translate("Maximum number of queued TCP output packets"), { server_mode="1" } },
+ { Value, "max_clients", 10, translate("Allowed maximum of connected clients"), { server_mode="1" } },
+ { Value, "max_routes_per_client", 256, translate("Allowed maximum of internal"), { server_mode="1" } },
+ { Value, "connect_freq", "3 10", translate("Allowed maximum of new connections"), { server_mode="1" } },
+ { Flag, "client_cert_not_required", 0, translate("Don't require client certificate"), { server_mode="1" } },
+ { Flag, "username_as_common_name", 0, translate("Use username as common name"), { server_mode="1" } },
+ { Flag, "client", 0, translate("Configure client mode"), { server_mode="0" }, { server_mode="" } },
+ { Flag, "pull", 0, translate("Accept options pushed from server"), { client="1" } },
+ { Value, "auth_user_pass", "/etc/openvpn/userpass.txt", translate("Authenticate using username/password"), { client="1" } },
+ { ListValue, "auth_retry", { "none", "nointeract", "interact" }, translate("Handling of authentication failures"), { client="1" } },
+ { Value, "explicit_exit_notify", 1, translate("Send notification to peer on disconnect"), { client="1" } },
+ { DynamicList, "remote", "1.2.3.4", translate("Remote host name or ip address"), { client="1" } },
+ { Flag, "remote_random", 1, translate("Randomly choose remote server"), { client="1" } },
+ { ListValue, "proto", { "udp", "tcp-client", "tcp-server" }, translate("Use protocol"), { client="1" } },
+ { Value, "connect_retry", 5, translate("Connection retry interval"), { proto="tcp-client" }, { client="1" } },
+ { Value, "http_proxy", "192.168.1.100 8080", translate("Connect to remote host through an HTTP proxy"), { client="1" } },
+ { Flag, "http_proxy_retry", 0, translate("Retry indefinitely on HTTP proxy errors"), { client="1" } },
+ { Value, "http_proxy_timeout", 5, translate("Proxy timeout in seconds"), { client="1" } },
+ { DynamicList, "http_proxy_option", { "VERSION 1.0", "AGENT OpenVPN/2.0.9" }, translate("Set extended HTTP proxy options"), { client="1" } },
+ { Value, "socks_proxy", "192.168.1.200 1080", translate("Connect through Socks5 proxy"), { client="1" } },
+ { Value, "socks_proxy_retry", 5, translate("Retry indefinitely on Socks proxy errors"), { client="1" } }, -- client && socks_proxy
+ { Value, "resolv_retry", "infinite", translate("If hostname resolve fails, retry"), { client="1" } },
+ { ListValue, "redirect_gateway", { "", "local", "def1", "local def1" }, translate("Automatically redirect default route"), { client="1" } },
} },
- { "cryptography", {
- { Value, "secret", "/etc/openvpn/secret.key 1" },
- { Value, "auth", "SHA1" }, -- parse
- { Value, "cipher", "BF-CBC" }, -- parse
- { Value, "keysize", 1024 }, -- parse
- { Value, "engine", "dynamic" }, -- parse
- { Flag, "no_replay", 0 },
- { Value, "replay_window", "64 15" },
- { Flag, "mute_replay_warnings", 0 },
- { Value, "replay_persist", "/var/run/openvpn-replay-state" },
- { Flag, "no_iv", 0 },
- { Flag, "tls_server", 0, { tls_client="" }, { tls_client="0" } },
- { Flag, "tls_client", 0, { tls_server="" }, { tls_server="0" } },
- { FileUpload, "ca", "/etc/easy-rsa/keys/ca.crt" },
- { FileUpload, "dh", "/etc/easy-rsa/keys/dh1024.pem" },
- { FileUpload, "cert", "/etc/easy-rsa/keys/some-client.crt" },
- { FileUpload, "key", "/etc/easy-rsa/keys/some-client.key" },
- { FileUpload, "pkcs12", "/etc/easy-rsa/keys/some-client.pk12" },
- { ListValue, "key_method", { 1, 2 } },
- { Value, "tls_cipher", "DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA:EDH-RSA-DES-CBC3-SHA:EDH-DSS-DES-CBC3-SHA:DES-CBC3-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:AES128-SHA:RC4-SHA:RC4-MD5:EDH-RSA-DES-CBC-SHA:EDH-DSS-DES-CBC-SHA:DES-CBC-SHA:EXP-EDH-RSA-DES-CBC-SHA:EXP-EDH-DSS-DES-CBC-SHA:EXP-DES-CBC-SHA:EXP-RC2-CBC-MD5:EXP-RC4-MD5" },
- { Value, "tls_timeout", 2 },
- { Value, "reneg_bytes", 1024 },
- { Value, "reneg_pkts", 100 },
- { Value, "reneg_sec", 3600 },
- { Value, "hand_window", 60 },
- { Value, "tran_window", 3600 },
- { Flag, "single_session", 0 },
- { Flag, "tls_exit", 0 },
- { Value, "tls_auth", "/etc/openvpn/tlsauth.key 1" },
- --{ Value, "askpass", "[file]" },
- { Flag, "auth_nocache", 0 },
- { Value, "tls_remote", "remote_x509_name" },
- { ListValue, "ns_cert_type", { "client", "server" } },
- { ListValue, "remote_cert_tls", { "client", "server" } },
- { Value, "crl_verify", "/etc/easy-rsa/keys/crl.pem" },
+ { "Cryptography", {
+ { Value, "secret", "/etc/openvpn/secret.key 1", translate("Enable Static Key encryption mode (non-TLS)") },
+ { Value, "auth", "SHA1", translate("HMAC authentication for packets") }, -- parse
+ { Value, "cipher", "BF-CBC", translate("Encryption cipher for packets") }, -- parse
+ { Value, "keysize", 1024, translate("Size of cipher key") }, -- parse
+ { Value, "engine", "dynamic", translate("Enable OpenSSL hardware crypto engines") }, -- parse
+ { Flag, "no_replay", 0, translate("Disable replay protection") },
+ { Value, "replay_window", "64 15", translate("Replay protection sliding window size") },
+ { Flag, "mute_replay_warnings", 0, translate("Silence the output of replay warnings") },
+ { Value, "replay_persist", "/var/run/openvpn-replay-state", translate("Persist replay-protection state") },
+ { Flag, "no_iv", 0, translate("Disable cipher initialisation vector") },
+ { Flag, "tls_server", 0, translate("Enable TLS and assume server role"), { tls_client="" }, { tls_client="0" } },
+ { Flag, "tls_client", 0, translate("Enable TLS and assume client role"), { tls_server="" }, { tls_server="0" } },
+ { FileUpload, "ca", "/etc/easy-rsa/keys/ca.crt", translate("Certificate authority") },
+ { FileUpload, "dh", "/etc/easy-rsa/keys/dh1024.pem", translate("Diffie Hellman parameters") },
+ { FileUpload, "cert", "/etc/easy-rsa/keys/some-client.crt", translate("Local certificate") },
+ { FileUpload, "key", "/etc/easy-rsa/keys/some-client.key", translate("Local private key") },
+ { FileUpload, "pkcs12", "/etc/easy-rsa/keys/some-client.pk12", translate("PKCS#12 file containing keys") },
+ { ListValue, "key_method", { 1, 2 }, translate("Enable TLS and assume client role") },
+ { Value, "tls_cipher", "DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA:EDH-RSA-DES-CBC3-SHA:EDH-DSS-DES-CBC3-SHA:DES-CBC3-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:AES128-SHA:RC4-SHA:RC4-MD5:EDH-RSA-DES-CBC-SHA:EDH-DSS-DES-CBC-SHA:DES-CBC-SHA:EXP-EDH-RSA-DES-CBC-SHA:EXP-EDH-DSS-DES-CBC-SHA:EXP-DES-CBC-SHA:EXP-RC2-CBC-MD5:EXP-RC4-MD5",
+ translate("TLS cipher") },
+ { Value, "tls_timeout", 2, translate("Retransmit timeout on TLS control channel") },
+ { Value, "reneg_bytes", 1024, translate("Renegotiate data chan. key after bytes") },
+ { Value, "reneg_pkts", 100, translate("Renegotiate data chan. key after packets") },
+ { Value, "reneg_sec", 3600, translate("Renegotiate data chan. key after seconds") },
+ { Value, "hand_window", 60, translate("Timeframe for key exchange") },
+ { Value, "tran_window", 3600, translate("Key transition window") },
+ { Flag, "single_session", 0, translate("Allow only one session") },
+ { Flag, "tls_exit", 0, translate("Exit on TLS negotiation failure") },
+ { Value, "tls_auth", "/etc/openvpn/tlsauth.key 1", translate("Additional authentication over TLS") },
+ --{ Value, "askpass", "[file]", translate("Get PEM password from controlling tty before we daemonize") },
+ { Flag, "auth_nocache", 0, translate("Don't cache --askpass or --auth-user-pass passwords") },
+ { Value, "tls_remote", "remote_x509_name", translate("Only accept connections from given X509 name") },
+ { ListValue, "ns_cert_type", { "client", "server" }, translate("Require explicit designation on certificate") },
+ { ListValue, "remote_cert_tls", { "client", "server" }, translate("Require explicit key usage on certificate") },
+ { Value, "crl_verify", "/etc/easy-rsa/keys/crl.pem", translate("Check peer certificate against a CRL") },
} }
}
@@ -210,7 +212,7 @@ local p = m:section( SimpleSection )
p.template = "openvpn/pageswitch"
p.mode = "advanced"
p.instance = arg[1]
-p.category = arg[2] or "service"
+p.category = arg[2] or "Service"
for _, c in ipairs(knownParams) do
cts[#cts+1] = c[1]
@@ -222,11 +224,10 @@ p.categories = cts
local s = m:section(
NamedSection, arg[1], "openvpn",
- translate("openvpn_%s" % arg[2]),
- translate("openvpn_%s_desc" % arg[2])
+ translate("%s" % arg[2])
)
-s.title = translate("openvpn_%s" % arg[2])
+s.title = translate("%s" % arg[2])
s.addremove = false
s.anonymous = true
@@ -234,8 +235,7 @@ s.anonymous = true
for _, option in ipairs(params) do
local o = s:option(
option[1], option[2],
- translate("openvpn_param_%s" % option[2]),
- translate("openvpn_param_%s_desc" % option[2])
+ option[2], option[4]
)
if option[1] == DummyValue then
diff --git a/applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua b/applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua
index 4f2f8d9f7a..dc1114b6ef 100644
--- a/applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua
+++ b/applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua
@@ -27,13 +27,13 @@ local basicParams = {
{ ListValue,"dev_type",{ "tun", "tap" }, translate("Type of used device") },
{ Flag,"tun_ipv6",0, translate("Make tun device IPv6 capable") },
- { Value,"ifconfig","10.200.200.3 10.200.200.1", translate("") },
+ { Value,"ifconfig","10.200.200.3 10.200.200.1", translate("Set tun/tap adapter parameters") },
{ Value,"server","10.200.200.0 255.255.255.0", translate("Configure server mode") },
{ Value,"server_bridge","192.168.1.1 255.255.255.0 192.168.1.128 192.168.1.254", translate("Configure server bridge") },
{ Flag,"nobind",0, translate("Do not bind to local address and port") },
{ Flag,"comp_lzo",0, translate("Use fast LZO compression") },
- { Value,"keepalive","10 60", translate("") },
+ { Value,"keepalive","10 60", translate("Helper directive to simplify the expression of --ping and --ping-restart in server mode configurations") },
{ ListValue,"proto",{ "udp", "tcp" }, translate("Use protocol") },
diff --git a/applications/luci-openvpn/luasrc/view/openvpn/pageswitch.htm b/applications/luci-openvpn/luasrc/view/openvpn/pageswitch.htm
index 9276fe3cd8..4f4e869e5c 100644
--- a/applications/luci-openvpn/luasrc/view/openvpn/pageswitch.htm
+++ b/applications/luci-openvpn/luasrc/view/openvpn/pageswitch.htm
@@ -11,6 +11,12 @@ You may obtain a copy of the License at
$Id$
+These strings need to be here to be included in the translation template
+translate("Service")
+translate("Networking")
+translate("VPN")
+translate("Cryptography")
+
-%>
<fieldset class="cbi-section">
@@ -20,7 +26,7 @@ $Id$
</legend>
<% if self.mode == "basic" then %>
- <a href="<%=luci.dispatcher.build_url("admin", "services", "openvpn", "advanced", self.instance)%>"><%:Switch to advanced configuration »%></a>
+ <a href="<%=luci.dispatcher.build_url("admin", "services", "openvpn", "advanced", self.instance, "Service")%>"><%:Switch to advanced configuration »%></a>
<% else %>
<a href="<%=luci.dispatcher.build_url("admin", "services", "openvpn", "basic", self.instance)%>"><%:« Switch to basic configuration%></a>
<hr style="margin:0.5em 0" />
diff --git a/applications/luci-p2pblock/luasrc/controller/ff_p2pblock.lua b/applications/luci-p2pblock/luasrc/controller/ff_p2pblock.lua
index 651172cd18..50c9e7a1af 100644
--- a/applications/luci-p2pblock/luasrc/controller/ff_p2pblock.lua
+++ b/applications/luci-p2pblock/luasrc/controller/ff_p2pblock.lua
@@ -15,7 +15,6 @@ $Id$
module("luci.controller.ff_p2pblock", package.seeall)
function index()
- require("luci.i18n").loadc("p2pblock")
entry({"admin", "network", "firewall", "p2pblock"}, cbi("luci_fw/p2pblock"),
- luci.i18n.translate("P2P-Block"), 40)
+ _("P2P-Block"), 40).i18n = "p2pblock"
end
diff --git a/applications/luci-p910nd/luasrc/controller/p910nd.lua b/applications/luci-p910nd/luasrc/controller/p910nd.lua
index c2fe3fa51b..bc38c2bb9a 100644
--- a/applications/luci-p910nd/luasrc/controller/p910nd.lua
+++ b/applications/luci-p910nd/luasrc/controller/p910nd.lua
@@ -16,13 +16,13 @@ $Id$
module("luci.controller.p910nd", package.seeall)
function index()
- require("luci.i18n")
- luci.i18n.loadc("p910nd")
- if not nixio.fs.access("/etc/config/p910nd") then
- return
- end
-
- local page = entry({"admin", "services", "p910nd"}, cbi("p910nd"), luci.i18n.translate("p910nd - Printer server"), 60)
- page.i18n = "p910nd"
- page.dependent = true
+ if not nixio.fs.access("/etc/config/p910nd") then
+ return
+ end
+
+ local page
+
+ page = entry({"admin", "services", "p910nd"}, cbi("p910nd"), _("p910nd - Printer server"), 60)
+ page.i18n = "p910nd"
+ page.dependent = true
end
diff --git a/applications/luci-polipo/luasrc/controller/polipo.lua b/applications/luci-polipo/luasrc/controller/polipo.lua
index 1ee67e2381..d07eaebd45 100644
--- a/applications/luci-polipo/luasrc/controller/polipo.lua
+++ b/applications/luci-polipo/luasrc/controller/polipo.lua
@@ -11,6 +11,7 @@ You may obtain a copy of the License at
$Id$
]]--
+
module("luci.controller.polipo", package.seeall)
function index()
@@ -18,11 +19,8 @@ function index()
return
end
- require("luci.i18n").loadc("polipo")
- local i18n = luci.i18n.translate
-
- entry({"admin", "services", "polipo"}, alias("admin", "services", "polipo", "config"), "Polipo").i18n = "polipo"
- entry({"admin", "services", "polipo", "status"}, template("polipo_status"), i18n("Status"))
- entry({"admin", "services", "polipo", "config"}, cbi("polipo"), i18n("Configuration"))
+ entry({"admin", "services", "polipo"}, alias("admin", "services", "polipo", "config"), _("Polipo")).i18n = "polipo"
+ entry({"admin", "services", "polipo", "status"}, template("polipo_status"), _("Status"))
+ entry({"admin", "services", "polipo", "config"}, cbi("polipo"), _("Configuration"))
end
diff --git a/applications/luci-qos/luasrc/controller/qos.lua b/applications/luci-qos/luasrc/controller/qos.lua
index af9b11499a..c9eb9e5d11 100644
--- a/applications/luci-qos/luasrc/controller/qos.lua
+++ b/applications/luci-qos/luasrc/controller/qos.lua
@@ -11,6 +11,7 @@ You may obtain a copy of the License at
$Id$
]]--
+
module("luci.controller.qos", package.seeall)
function index()
@@ -18,12 +19,13 @@ function index()
return
end
- local page = entry({"admin", "network", "qos"}, cbi("qos/qos"), "QoS")
+ local page
+
+ page = entry({"admin", "network", "qos"}, cbi("qos/qos"), _("QoS"))
page.i18n = "qos"
page.dependent = true
-
-
- local page = entry({"mini", "network", "qos"}, cbi("qos/qosmini", {autoapply=true}), "QoS")
+
+ page = entry({"mini", "network", "qos"}, cbi("qos/qosmini", {autoapply=true}), _("QoS"))
page.i18n = "qos"
page.dependent = true
end
diff --git a/applications/luci-radvd/luasrc/controller/radvd.lua b/applications/luci-radvd/luasrc/controller/radvd.lua
index 6ed1176837..09e764659e 100644
--- a/applications/luci-radvd/luasrc/controller/radvd.lua
+++ b/applications/luci-radvd/luasrc/controller/radvd.lua
@@ -19,7 +19,7 @@ function index()
return
end
- entry({"admin", "network", "radvd"}, cbi("radvd"), "Radvd", 61).i18n = "radvd"
+ entry({"admin", "network", "radvd"}, cbi("radvd"), _("Radvd"), 61).i18n = "radvd"
entry({"admin", "network", "radvd", "interface"}, cbi("radvd/interface"), nil).leaf = true
entry({"admin", "network", "radvd", "prefix"}, cbi("radvd/prefix"), nil).leaf = true
entry({"admin", "network", "radvd", "route"}, cbi("radvd/route"), nil).leaf = true
diff --git a/applications/luci-samba/luasrc/controller/samba.lua b/applications/luci-samba/luasrc/controller/samba.lua
index a6d0918b74..7d531330a7 100644
--- a/applications/luci-samba/luasrc/controller/samba.lua
+++ b/applications/luci-samba/luasrc/controller/samba.lua
@@ -12,16 +12,17 @@ You may obtain a copy of the License at
$Id$
]]--
+
module("luci.controller.samba", package.seeall)
function index()
if not nixio.fs.access("/etc/config/samba") then
return
end
- require("luci.i18n")
- luci.i18n.loadc("samba")
-
- local page = entry({"admin", "services", "samba"}, cbi("samba"), luci.i18n.translate("Network Shares"))
+
+ local page
+
+ page = entry({"admin", "services", "samba"}, cbi("samba"), _("Network Shares"))
page.i18n = "samba"
page.dependent = true
-end \ No newline at end of file
+end
diff --git a/applications/luci-splash/Makefile b/applications/luci-splash/Makefile
index a4f7c76ef9..6e625c0e57 100644
--- a/applications/luci-splash/Makefile
+++ b/applications/luci-splash/Makefile
@@ -1,4 +1,4 @@
-PO =
+PO = splash
include ../../build/config.mk
include ../../build/module.mk
diff --git a/applications/luci-splash/luasrc/controller/splash/splash.lua b/applications/luci-splash/luasrc/controller/splash/splash.lua
index 27eff65796..a41256a09e 100644
--- a/applications/luci-splash/luasrc/controller/splash/splash.lua
+++ b/applications/luci-splash/luasrc/controller/splash/splash.lua
@@ -1,17 +1,20 @@
module("luci.controller.splash.splash", package.seeall)
+luci.i18n.loadc("splash")
function index()
- require("luci.i18n")
- luci.i18n.loadc("freifunk")
+ entry({"admin", "services", "splash"}, cbi("splash/splash"), _("Client-Splash"), 90).i18n = "freifunk"
+ entry({"admin", "services", "splash", "splashtext" }, form("splash/splashtext"), _("Splashtext"), 10)
- entry({"admin", "services", "splash"}, cbi("splash/splash"), luci.i18n.translate("Client-Splash"), 90)
- entry({"admin", "services", "splash", "splashtext" }, form("splash/splashtext"), luci.i18n.translate("Splashtext"), 10)
+ local e
+
+ e = node("splash")
+ e.target = call("action_dispatch")
+ e.i18n = "freifunk"
- node("splash").target = call("action_dispatch")
node("splash", "activate").target = call("action_activate")
node("splash", "splash").target = template("splash_splash/splash")
- entry({"admin", "status", "splash"}, call("action_status_admin"), "Client-Splash")
+ entry({"admin", "status", "splash"}, call("action_status_admin"), _("Client-Splash")).i18n = "freifunk"
end
function action_dispatch()
diff --git a/applications/luci-splash/luasrc/model/cbi/splash/splash.lua b/applications/luci-splash/luasrc/model/cbi/splash/splash.lua
index 145b16d5b0..c03cd459ae 100644
--- a/applications/luci-splash/luasrc/model/cbi/splash/splash.lua
+++ b/applications/luci-splash/luasrc/model/cbi/splash/splash.lua
@@ -1,24 +1,31 @@
--- ToDo: Translate, Add descriptions and help texts
+--[[
+LuCI - Lua Configuration Interface
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+]]--
+
require("luci.model.uci")
+luci.i18n.loadc("splash")
-m = Map("luci_splash", "Client-Splash", [[Client-Splash ist das Freifunk Hotspot-Authentifizierungs-System.]])
+m = Map("luci_splash", translate("Client-Splash"), translate("Client-Splash is a hotspot authentification system for wireless mesh networks."))
-s = m:section(NamedSection, "general", "core", "Allgemein")
+s = m:section(NamedSection, "general", "core", translate("General"))
s.addremove = false
-s:option(Value, "leasetime", "Freigabezeit", "h")
+s:option(Value, "leasetime", translate("Clearance time"), translate("Clients that have accepted the splash are allowed to use the network for that many hours."))
-s:option(Value, "limit_up", "Upload-Limitierung", "Kilobyte/s - limitiert die Upload-Geschwindigkeit von Clients")
-s:option(Value, "limit_down", "Download-Limitierung", "Kilobyte/s - limitiert die Download-Geschwindigkeit von Clients")
+s:option(Value, "limit_up", translate("Upload limit"), translate("Clients upload speed is limited to this value (kbyte/s)"))
+s:option(Value, "limit_down", translate("Download limit"), translate("Clients download speed is limited to this value (kbyte/s)"))
s:option(DummyValue, "_tmp", "",
- "Bandbreitenlimitierung für Clients wird aktiviert wenn sowohl Up- als auch " ..
- "Download-Geschwindigkeit angegeben werden. Auf 0 setzen um die Limitierung zu deaktivieren. " ..
- "Clients in der Whitelist werden nicht limitiert.")
+ translate("Bandwidth limit for clients is only activated when both up- and download limit are set. " ..
+ "Use a value of 0 here to completely disable this limitation. Whitelisted clients are not limited."))
-s = m:section(TypedSection, "iface", "Schnittstellen",
- "Bestimmt die Schnittstellen auf denen Splashing aktiviert werden soll. " ..
- "Diese Einstellungen müssen normalerweise nicht angepasst werden.")
+s = m:section(TypedSection, "iface", translate("Interfaces"), translate("Interfaces that are used for Splash."))
s.template = "cbi/tblsection"
s.addremove = true
@@ -26,16 +33,16 @@ s.anonymous = true
local uci = luci.model.uci.cursor()
-zone = s:option(ListValue, "zone", "Firewallzone",
- "Splash-Regeln in der angegebenen Zone eingliedern")
+zone = s:option(ListValue, "zone", translate("Firewall zone"),
+ translate("Splash rules are integrated in this firewall zone"))
uci:foreach("firewall", "zone",
function (section)
zone:value(section.name)
end)
-iface = s:option(ListValue, "network", "Netzwerk",
- "Client-Verkehr auf der angegebenen Schnittstelle abfangen")
+iface = s:option(ListValue, "network", translate("Network"),
+ translate("Intercept client traffic on this Interface"))
uci:foreach("network", "interface",
function (section)
@@ -50,34 +57,30 @@ uci:foreach("network", "alias",
end)
-s = m:section(TypedSection, "whitelist", "Whitelist",
- "MAC-Adressen in dieser Liste werden automatisch freigegeben und unterliegen " ..
- "keiner Bandbreitenlimitierung.")
+s = m:section(TypedSection, "whitelist", translate("Whitelist"),
+ translate("MAC addresses of whitelisted clients. These do not need to accept the splash and are not bandwidth limited."))
s.template = "cbi/tblsection"
s.addremove = true
s.anonymous = true
-s:option(Value, "mac", "MAC-Adresse")
+s:option(Value, "mac", translate ("MAC Address"))
-s = m:section(TypedSection, "blacklist", "Blacklist",
- "MAC-Adressen in dieser Liste werden automatisch gesperrt. Verkehr von diesen " ..
- "Adressen wird komplett verworfen und es wird kein Verbindungsaufbau via WLAN " ..
- "zugelassen.")
+s = m:section(TypedSection, "blacklist", translate("Blacklist"),
+ translate("MAC addresses in this list are blocked."))
s.template = "cbi/tblsection"
s.addremove = true
s.anonymous = true
-s:option(Value, "mac", "MAC-Adresse")
+s:option(Value, "mac", translate ("MAC Address"))
-s = m:section(TypedSection, "subnet", "Freigegebene Subnetze",
- "Hier eingetragene Subnetze oder Host-Adressen sind vom Splash-Vorgang ausgenommen.")
+s = m:section(TypedSection, "subnet", translate("Allowed hosts/subnets"),
+ translate("Hosts and Networks that are listed here are excluded from splashing, i.e. they are always allowed."))
s.template = "cbi/tblsection"
s.addremove = true
s.anonymous = true
-s:option(Value, "ipaddr", "IP-Adresse")
-s:option(Value, "netmask", "Netzmaske", "optional bei Host-Adressen").rmempty = true
-
+s:option(Value, "ipaddr", translate("IP Address"))
+s:option(Value, "netmask", translate("Netmask"), translate("optional when using host addresses")).rmempty = true
return m
diff --git a/applications/luci-splash/luasrc/model/cbi/splash/splashtext.lua b/applications/luci-splash/luasrc/model/cbi/splash/splashtext.lua
index 5f75e80156..453942152c 100644
--- a/applications/luci-splash/luasrc/model/cbi/splash/splashtext.lua
+++ b/applications/luci-splash/luasrc/model/cbi/splash/splashtext.lua
@@ -13,6 +13,8 @@ You may obtain a copy of the License at
]]--
local fs = require "nixio.fs"
+luci.i18n.loadc("splash")
+
local splashtextfile = "/usr/lib/luci-splash/splashtext.html"
f = SimpleForm("splashtext", translate("Edit Splash text"), translate("You can change the text that is displayed to clients here.<br /> It is possible to use the following markers: ###COMMUNITY###, ###COMMUNITY_URL###, ###LEASETIME### and ###ACCEPT###.<br />Click here to <a href='/luci/splash/'>test the splash page</a> after you saved it."))
diff --git a/applications/luci-splash/luasrc/view/admin_status/splash.htm b/applications/luci-splash/luasrc/view/admin_status/splash.htm
index 70e6c06cfe..1b55e7b275 100644
--- a/applications/luci-splash/luasrc/view/admin_status/splash.htm
+++ b/applications/luci-splash/luasrc/view/admin_status/splash.htm
@@ -19,6 +19,7 @@ local ipt = require "luci.sys.iptparser".IptParser()
local uci = require "luci.model.uci".cursor_state()
local wat = require "luci.tools.webadmin"
local fs = require "nixio.fs"
+luci.i18n.loadc("splash")
local clients = { }
local leasetime = tonumber(uci:get("luci_splash", "general", "leasetime") or 1) * 60 * 60
diff --git a/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua b/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
index ed6363f9fb..5c1376435a 100644
--- a/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
+++ b/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
@@ -19,13 +19,8 @@ function index()
require("nixio.fs")
require("luci.util")
- require("luci.i18n")
require("luci.statistics.datatree")
- -- load language files
- luci.i18n.loadc("rrdtool")
- luci.i18n.loadc("statistics")
-
-- get rrd data tree
local tree = luci.statistics.datatree.Instance()
@@ -37,32 +32,30 @@ function index()
end
end
- local translate = luci.i18n.translate
-
local labels = {
- s_output = translate("Output plugins"),
- s_system = translate("System plugins"),
- s_network = translate("Network plugins"),
-
- rrdtool = translate("RRDTool"),
- network = translate("Network"),
- unixsock = translate("UnixSock"),
- csv = translate("CSV Output"),
- exec = translate("Exec"),
- email = translate("Email"),
- cpu = translate("Processor"),
- df = translate("Disk Space Usage"),
- disk = translate("Disk Usage"),
- irq = translate("Interrupts"),
- processes = translate("Processes"),
- load = translate("System Load"),
- interface = translate("Interfaces"),
- netlink = translate("Netlink"),
- iptables = translate("Firewall"),
- tcpconns = translate("TCP Connections"),
- ping = translate("Ping"),
- dns = translate("DNS"),
- wireless = translate("Wireless")
+ s_output = _("Output plugins"),
+ s_system = _("System plugins"),
+ s_network = _("Network plugins"),
+
+ rrdtool = _("RRDTool"),
+ network = _("Network"),
+ unixsock = _("UnixSock"),
+ csv = _("CSV Output"),
+ exec = _("Exec"),
+ email = _("Email"),
+ cpu = _("Processor"),
+ df = _("Disk Space Usage"),
+ disk = _("Disk Usage"),
+ irq = _("Interrupts"),
+ processes = _("Processes"),
+ load = _("System Load"),
+ interface = _("Interfaces"),
+ netlink = _("Netlink"),
+ iptables = _("Firewall"),
+ tcpconns = _("TCP Connections"),
+ ping = _("Ping"),
+ dns = _("DNS"),
+ wireless = _("Wireless")
}
-- our collectd menu
@@ -73,21 +66,24 @@ function index()
}
-- create toplevel menu nodes
- local st = entry({"admin", "statistics"}, call("statistics_index"), translate("Statistics"), 80)
+ local st = entry({"admin", "statistics"}, call("statistics_index"), _("Statistics"), 80)
st.i18n = "statistics"
st.index = true
- entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), translate("Collectd"), 10).subindex = true
+ entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), _("Collectd"), 10).subindex = true
-- populate collectd plugin menu
local index = 1
for section, plugins in luci.util.kspairs( collectd_menu ) do
- entry(
+ local e = entry(
{ "admin", "statistics", "collectd", section },
call( "statistics_" .. section .. "plugins" ),
labels["s_"..section], index * 10
- ).index = true
+ )
+
+ e.index = true
+ e.i18n = "rrdtool"
for j, plugin in luci.util.vspairs( plugins ) do
_entry(
@@ -101,7 +97,7 @@ function index()
end
-- output views
- local page = entry( { "admin", "statistics", "graph" }, call("statistics_index"), translate("Graphs"), 80)
+ local page = entry( { "admin", "statistics", "graph" }, call("statistics_index"), _("Graphs"), 80)
page.i18n = "statistics"
page.setuser = "nobody"
page.setgroup = "nogroup"
diff --git a/applications/luci-statistics/luasrc/model/cbi/luci_statistics/iptables.lua b/applications/luci-statistics/luasrc/model/cbi/luci_statistics/iptables.lua
index f353d8b533..1f7341c46e 100644
--- a/applications/luci-statistics/luasrc/model/cbi/luci_statistics/iptables.lua
+++ b/applications/luci-statistics/luasrc/model/cbi/luci_statistics/iptables.lua
@@ -20,8 +20,10 @@ chains = { }
targets = { }
for i, rule in ipairs( ip:find() ) do
- chains[rule.chain] = true
- targets[rule.target] = true
+ if rule.chain and rule.target then
+ chains[rule.chain] = true
+ targets[rule.target] = true
+ end
end
diff --git a/applications/luci-tinyproxy/luasrc/controller/tinyproxy.lua b/applications/luci-tinyproxy/luasrc/controller/tinyproxy.lua
index 8625bc1cec..1dcb20ce34 100644
--- a/applications/luci-tinyproxy/luasrc/controller/tinyproxy.lua
+++ b/applications/luci-tinyproxy/luasrc/controller/tinyproxy.lua
@@ -20,10 +20,7 @@ function index()
return
end
- require("luci.i18n").loadc("tinyproxy")
- local i18n = luci.i18n.translate
-
- entry({"admin", "services", "tinyproxy"}, alias("admin", "services", "tinyproxy", "config"), "Tinyproxy").i18n = "tinyproxy"
- entry({"admin", "services", "tinyproxy", "status"}, template("tinyproxy_status"), i18n("Status"))
- entry({"admin", "services", "tinyproxy", "config"}, cbi("tinyproxy"), i18n("Configuration"))
+ entry({"admin", "services", "tinyproxy"}, alias("admin", "services", "tinyproxy", "config"), _("Tinyproxy")).i18n = "tinyproxy"
+ entry({"admin", "services", "tinyproxy", "status"}, template("tinyproxy_status"), _("Status"))
+ entry({"admin", "services", "tinyproxy", "config"}, cbi("tinyproxy"), _("Configuration"))
end
diff --git a/applications/luci-upnp/luasrc/controller/upnp.lua b/applications/luci-upnp/luasrc/controller/upnp.lua
index fe9d3d8f5b..c40493dab6 100644
--- a/applications/luci-upnp/luasrc/controller/upnp.lua
+++ b/applications/luci-upnp/luasrc/controller/upnp.lua
@@ -12,6 +12,7 @@ You may obtain a copy of the License at
$Id$
]]--
+
module("luci.controller.upnp", package.seeall)
function index()
@@ -21,11 +22,11 @@ function index()
local page
- page = entry({"admin", "services", "upnp"}, cbi("upnp/upnp"), "UPNP")
+ page = entry({"admin", "services", "upnp"}, cbi("upnp/upnp"), _("UPNP"))
page.i18n = "upnp"
page.dependent = true
- page = entry({"mini", "network", "upnp"}, cbi("upnp/upnpmini", {autoapply=true}), "UPNP")
+ page = entry({"mini", "network", "upnp"}, cbi("upnp/upnpmini", {autoapply=true}), _("UPNP"))
page.i18n = "upnp"
page.dependent = true
diff --git a/applications/luci-upnp/luasrc/view/upnp_status.htm b/applications/luci-upnp/luasrc/view/upnp_status.htm
index 89857d542b..d50ed0c4d7 100644
--- a/applications/luci-upnp/luasrc/view/upnp_status.htm
+++ b/applications/luci-upnp/luasrc/view/upnp_status.htm
@@ -1,8 +1,6 @@
<script type="text/javascript">//<![CDATA[
function upnp_delete_fwd(idx) {
- var dlxhr = new XHR();
-
- dlxhr.get('<%=luci.dispatcher.build_url("admin", "services", "upnp", "delete")%>/' + idx, null,
+ XHR.get('<%=luci.dispatcher.build_url("admin", "services", "upnp", "delete")%>/' + idx, null,
function(x)
{
var tb = document.getElementById('upnp_status_table');
@@ -12,51 +10,44 @@
);
}
- var stxhr = new XHR();
- var update_status = function() {
- stxhr.get('<%=luci.dispatcher.build_url("admin", "services", "upnp", "status")%>', null,
- function(x, st)
+ XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "upnp", "status")%>', null,
+ function(x, st)
+ {
+ var tb = document.getElementById('upnp_status_table');
+ if (st && tb)
{
- var tb = document.getElementById('upnp_status_table');
- if (st && tb)
- {
- /* clear all rows */
- while( tb.rows.length > 1 )
- tb.deleteRow(1);
+ /* clear all rows */
+ while( tb.rows.length > 1 )
+ tb.deleteRow(1);
- for( var i = 0; i < st.length; i++ )
- {
- var tr = tb.insertRow(-1);
- tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
+ for( var i = 0; i < st.length; i++ )
+ {
+ var tr = tb.insertRow(-1);
+ tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
- tr.insertCell(-1).innerHTML = st[i].proto;
- tr.insertCell(-1).innerHTML = st[i].extport;
- tr.insertCell(-1).innerHTML = st[i].intaddr;
- tr.insertCell(-1).innerHTML = st[i].intport;
+ tr.insertCell(-1).innerHTML = st[i].proto;
+ tr.insertCell(-1).innerHTML = st[i].extport;
+ tr.insertCell(-1).innerHTML = st[i].intaddr;
+ tr.insertCell(-1).innerHTML = st[i].intport;
- tr.insertCell(-1).innerHTML = String.format(
- '<input class="cbi-input-remove" type="button" value="<%:Delete Redirect%>" onclick="upnp_delete_fwd(%d)" />',
- st[i].num
- );
- }
+ tr.insertCell(-1).innerHTML = String.format(
+ '<input class="cbi-button cbi-input-remove" type="button" value="<%:Delete Redirect%>" onclick="upnp_delete_fwd(%d)" />',
+ st[i].num
+ );
+ }
- if( tb.rows.length == 1 )
- {
- var tr = tb.insertRow(-1);
- tr.className = 'cbi-section-table-row';
+ if( tb.rows.length == 1 )
+ {
+ var tr = tb.insertRow(-1);
+ tr.className = 'cbi-section-table-row';
- var td = tr.insertCell(-1);
- td.colSpan = 5;
- td.innerHTML = '<em><br /><%:There are no active redirects.%></em>';
- }
+ var td = tr.insertCell(-1);
+ td.colSpan = 5;
+ td.innerHTML = '<em><br /><%:There are no active redirects.%></em>';
}
-
- window.setTimeout(update_status, 5000);
}
- )
- };
-
- update_status();
+ }
+ );
//]]></script>
<fieldset class="cbi-section">
diff --git a/applications/luci-ushare/luasrc/controller/ushare.lua b/applications/luci-ushare/luasrc/controller/ushare.lua
index a17c9a41e3..7bbd2ddde1 100644
--- a/applications/luci-ushare/luasrc/controller/ushare.lua
+++ b/applications/luci-ushare/luasrc/controller/ushare.lua
@@ -16,13 +16,13 @@ $Id$
module("luci.controller.ushare", package.seeall)
function index()
- require("luci.i18n")
- luci.i18n.loadc("ushare")
- if not nixio.fs.access("/etc/config/ushare") then
- return
- end
-
- local page = entry({"admin", "services", "ushare"}, cbi("ushare"), luci.i18n.translate("uShare"), 60)
- page.i18n = "uvc_streamer"
- page.dependent = true
+ if not nixio.fs.access("/etc/config/ushare") then
+ return
+ end
+
+ local page
+
+ page = entry({"admin", "services", "ushare"}, cbi("ushare"), _("uShare"), 60)
+ page.i18n = "ushare"
+ page.dependent = true
end
diff --git a/applications/luci-ushare/luasrc/model/cbi/ushare.lua b/applications/luci-ushare/luasrc/model/cbi/ushare.lua
index 0e5b6cff6e..cc7377e4a3 100644
--- a/applications/luci-ushare/luasrc/model/cbi/ushare.lua
+++ b/applications/luci-ushare/luasrc/model/cbi/ushare.lua
@@ -31,7 +31,7 @@ for _, nif in ipairs(luci.sys.net.devices()) do
if nif ~= "lo" then dif:value(nif) end
end
-s:option(Value, "content_directories", translate("Content directories"))
+s:option(DynamicList, "content_directories", translate("Content directories"))
s:option(Flag, "disable_webif", translate("Disable webinterface"))
diff --git a/applications/luci-vnstat/luasrc/controller/vnstat.lua b/applications/luci-vnstat/luasrc/controller/vnstat.lua
index 605f799dcb..4c10e2ad30 100644
--- a/applications/luci-vnstat/luasrc/controller/vnstat.lua
+++ b/applications/luci-vnstat/luasrc/controller/vnstat.lua
@@ -1,14 +1,11 @@
module("luci.controller.vnstat", package.seeall)
function index()
- require("luci.i18n").loadc("vnstat")
- local i18n = luci.i18n.translate
+ entry({"admin", "status", "vnstat"}, alias("admin", "status", "vnstat", "graphs"), _("VnStat Traffic Monitor"), 90).i18n = "vnstat"
+ entry({"admin", "status", "vnstat", "graphs"}, template("vnstat"), _("Graphs"), 1)
+ entry({"admin", "status", "vnstat", "config"}, cbi("vnstat"), _("Configuration"), 2)
- entry({"admin", "status", "vnstat"}, alias("admin", "status", "vnstat", "graphs"), i18n("VnStat Traffic Monitor"), 90).i18n = "vnstat"
- entry({"admin", "status", "vnstat", "graphs"}, template("vnstat"), i18n("Graphs"), 1)
- entry({"admin", "status", "vnstat", "config"}, cbi("vnstat"), i18n("Configuration"), 2)
-
- entry({"mini", "network", "vnstat"}, alias("mini", "network", "vnstat", "graphs"), i18n("VnStat Traffic Monitor"), 90).i18n = "vnstat"
- entry({"mini", "network", "vnstat", "graphs"}, template("vnstat"), i18n("Graphs"), 1)
- entry({"mini", "network", "vnstat", "config"}, cbi("vnstat"), i18n("Configuration"), 2)
+ entry({"mini", "network", "vnstat"}, alias("mini", "network", "vnstat", "graphs"), _("VnStat Traffic Monitor"), 90).i18n = "vnstat"
+ entry({"mini", "network", "vnstat", "graphs"}, template("vnstat"), _("Graphs"), 1)
+ entry({"mini", "network", "vnstat", "config"}, cbi("vnstat"), _("Configuration"), 2)
end
diff --git a/applications/luci-vnstat/luasrc/model/cbi/vnstat.lua b/applications/luci-vnstat/luasrc/model/cbi/vnstat.lua
index 5c5e8f7aa2..38b06ba9a7 100644
--- a/applications/luci-vnstat/luasrc/model/cbi/vnstat.lua
+++ b/applications/luci-vnstat/luasrc/model/cbi/vnstat.lua
@@ -56,9 +56,11 @@ s.anonymous = true
s.addremove = false
mon_ifaces = s:option(Value, "interface", translate("Monitor selected interfaces"))
-mon_ifaces.template = "cbi/network_ifacelist"
-mon_ifaces.widget = "checkbox"
-mon_ifaces.cast = "table"
+mon_ifaces.template = "cbi/network_ifacelist"
+mon_ifaces.widget = "checkbox"
+mon_ifaces.cast = "table"
+mon_ifaces.noinactive = true
+mon_ifaces.nocreate = true
function mon_ifaces.write(self, section, val)
local i
diff --git a/applications/luci-voice-core/luasrc/controller/luci_voice.lua b/applications/luci-voice-core/luasrc/controller/luci_voice.lua
index 70617af6dc..dc1482e358 100644
--- a/applications/luci-voice-core/luasrc/controller/luci_voice.lua
+++ b/applications/luci-voice-core/luasrc/controller/luci_voice.lua
@@ -11,26 +11,24 @@ You may obtain a copy of the License at
]]--
-
module("luci.controller.luci_voice", package.seeall)
function index()
- require("luci.i18n")
- luci.i18n.loadc("voice_core")
+ local e
- local e = entry({"admin", "voice"}, template("luci_voice/index") , luci.i18n.translate("Voice"), 90)
+ e = entry({"admin", "voice"}, template("luci_voice/index") , _("Voice"), 90)
e.index = true
e.i18n = "voice_core"
- e = entry({"mini", "voice"}, template("luci_voice/index"), luci.i18n.translate("Voice"), 90)
+ e = entry({"mini", "voice"}, template("luci_voice/index"), _("Voice"), 90)
e.index = true
e.i18n = "voice_core"
- e = entry({"mini", "voice", "phones"}, template("luci_voice/phone_index"), luci.i18n.translate("Phones"), 90)
+ e = entry({"mini", "voice", "phones"}, template("luci_voice/phone_index"), _("Phones"), 90)
e.index = true
e.i18n = "voice_core"
- e = entry({"admin", "voice", "phones"}, template("luci_voice/phone_index"), luci.i18n.translate("l_v_adminphones"), 90)
+ e = entry({"admin", "voice", "phones"}, template("luci_voice/phone_index"), _("Phones"), 90)
e.index = true
e.i18n = "voice_core"
diff --git a/applications/luci-voice-diag/luasrc/controller/luci_voice/luci_voice_diag.lua b/applications/luci-voice-diag/luasrc/controller/luci_voice/luci_voice_diag.lua
index e0dccb051c..8fba53b732 100644
--- a/applications/luci-voice-diag/luasrc/controller/luci_voice/luci_voice_diag.lua
+++ b/applications/luci-voice-diag/luasrc/controller/luci_voice/luci_voice_diag.lua
@@ -11,15 +11,13 @@ You may obtain a copy of the License at
]]--
-
module("luci.controller.luci_voice.luci_voice_diag", package.seeall)
function index()
- require("luci.i18n")
- luci.i18n.loadc("voice_diag")
+ local e
- local e = entry({"admin", "voice", "diag"}, template("luci_voice/diag_index") , luci.i18n.translate("l_v_d_admindiag"), 90)
- e.index = true
- e.i18n = "voice_diag"
- e.dependent = true
+ e = entry({"admin", "voice", "diag"}, template("luci_voice/diag_index"), _("Diagnostics"), 90)
+ e.index = true
+ e.i18n = "voice_diag"
+ e.dependent = true
end
diff --git a/applications/luci-wol/luasrc/controller/wol.lua b/applications/luci-wol/luasrc/controller/wol.lua
index 429ab2ac3f..bb98b6d89a 100644
--- a/applications/luci-wol/luasrc/controller/wol.lua
+++ b/applications/luci-wol/luasrc/controller/wol.lua
@@ -1,9 +1,6 @@
module("luci.controller.wol", package.seeall)
function index()
- require("luci.i18n").loadc("wol")
- local i18n = luci.i18n.translate
-
- entry({"admin", "network", "wol"}, cbi("wol"), i18n("Wake on LAN"), 90).i18n = "wol"
- entry({"mini", "network", "wol"}, cbi("wol"), i18n("Wake on LAN"), 90).i18n = "wol"
+ entry({"admin", "network", "wol"}, cbi("wol"), _("Wake on LAN"), 90).i18n = "wol"
+ entry({"mini", "network", "wol"}, cbi("wol"), _("Wake on LAN"), 90).i18n = "wol"
end
diff --git a/applications/luci-asterisk/Makefile b/applications/luci-wshaper/Makefile
index 1b8cf53cd2..fcdd099fae 100644
--- a/applications/luci-asterisk/Makefile
+++ b/applications/luci-wshaper/Makefile
@@ -1,4 +1,4 @@
-PO = asterisk
+PO = wshaper
include ../../build/config.mk
include ../../build/module.mk
diff --git a/applications/luci-wshaper/ipkg/postinst b/applications/luci-wshaper/ipkg/postinst
new file mode 100644
index 0000000000..dad884259d
--- /dev/null
+++ b/applications/luci-wshaper/ipkg/postinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+[ -n "${IPKG_INSTROOT}" ] || {
+ ( . /etc/uci-defaults/wshaper ) && rm -f /etc/uci-defaults/wshaper
+ exit 0
+}
+
diff --git a/applications/luci-wshaper/luasrc/controller/wshaper.lua b/applications/luci-wshaper/luasrc/controller/wshaper.lua
new file mode 100644
index 0000000000..9d7f01e9d5
--- /dev/null
+++ b/applications/luci-wshaper/luasrc/controller/wshaper.lua
@@ -0,0 +1,19 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2011 Manuel Munz <freifunk somakoma de>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+]]--
+
+module "luci.controller.wshaper"
+
+function index()
+ entry({"admin", "network", "wshaper"}, cbi("wshaper"), _("Wondershaper"), 80)
+end
+
diff --git a/applications/luci-wshaper/luasrc/model/cbi/wshaper.lua b/applications/luci-wshaper/luasrc/model/cbi/wshaper.lua
new file mode 100644
index 0000000000..81225ce213
--- /dev/null
+++ b/applications/luci-wshaper/luasrc/model/cbi/wshaper.lua
@@ -0,0 +1,55 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+]]--
+
+require("luci.tools.webadmin")
+
+m = Map("wshaper", translate("Wondershaper"),
+ translate("Wondershaper uses traffic shaping to ensure low latencies for interactive traffic even when your " ..
+ "internet connection is highly saturated."))
+
+s = m:section(NamedSection, "settings", "wshaper", translate("Wondershaper settings"))
+s.anonymous = true
+
+network = s:option(ListValue, "network", translate("Interface"))
+luci.tools.webadmin.cbi_add_networks(network)
+
+uplink = s:option(Value, "uplink", translate("Uplink"), translate("Upstream bandwidth in kbit/s"))
+uplink.optional = false
+uplink.datatype = "uinteger"
+uplink.default = "240"
+
+uplink = s:option(Value, "downlink", translate("Downlink"), translate("Downstream bandwidth in kbit/s"))
+uplink.optional = false
+uplink.datatype = "uinteger"
+uplink.default = "200"
+
+nopriohostsrc = s:option(DynamicList, "nopriohostsrc", translate("Low priority hosts (Source)"), translate("Host or Network in CIDR notation."))
+nopriohostsrc.optional = true
+nopriohostsrc.datatype = ipaddr
+nopriohostsrc.placeholder = "10.0.0.1/32"
+
+nopriohostdst = s:option(DynamicList, "nopriohostdst", translate("Low priority hosts (Destination)"), translate("Host or Network in CIDR notation."))
+nopriohostdst.optional = true
+nopriohostdst.datatype = ipaddr
+nopriohostdst.placeholder = "10.0.0.1/32"
+
+noprioportsrc = s:option(DynamicList, "noprioportsrc", translate("Low priority source ports"))
+noprioportsrc.optional = true
+noprioportsrc.datatype = "range(0,65535)"
+noprioportsrc.placeholder = "21"
+
+noprioportdst = s:option(DynamicList, "noprioportdst", translate("Low priority destination ports"))
+noprioportdst.optional = true
+noprioportdst.datatype = "range(0,65535)"
+noprioportdst.placeholder = "21"
+
+return m
diff --git a/applications/luci-wshaper/root/etc/uci-defaults/wshaper b/applications/luci-wshaper/root/etc/uci-defaults/wshaper
new file mode 100644
index 0000000000..918dff2801
--- /dev/null
+++ b/applications/luci-wshaper/root/etc/uci-defaults/wshaper
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+uci -q batch <<-EOF >/dev/null
+ delete ucitrack.@wshaper[-1]
+ set ucitrack.wshaper="wshaper"
+ set ucitrack.wshaper.exec='/etc/init.d/wshaper start'
+ commit ucitrack
+EOF
+
+rm -f /tmp/luci-indexcache
+exit 0