X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-app-asterisk%2Fluasrc%2Fview%2Fasterisk%2Fdialzones.htm;fp=applications%2Fluci-app-asterisk%2Fluasrc%2Fview%2Fasterisk%2Fdialzones.htm;h=f93496df8baae8787b41a47a5885da068390cbfe;hp=0000000000000000000000000000000000000000;hb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92;hpb=9edd0e46c3f880727738ce8ca6ff1c8b85f99ef4 diff --git a/applications/luci-app-asterisk/luasrc/view/asterisk/dialzones.htm b/applications/luci-app-asterisk/luasrc/view/asterisk/dialzones.htm new file mode 100644 index 000000000..f93496df8 --- /dev/null +++ b/applications/luci-app-asterisk/luasrc/view/asterisk/dialzones.htm @@ -0,0 +1,174 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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 "%s" % 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 + +%> + + +
" enctype="multipart/form-data"> +
+ + + +
+ +
+

Dial Zone Management

+
+ " class="cbi-title-ref">Back to dialplan overview

+ 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. +
+ + +
+
+ + + + + + + + + + + + + + + <% for i, rule in pairs(ast.dialzone.zones()) do %> + + + + + + + + + <% end %> +
+

Dialzone Overview

+
NamePrepend- MatchTrunkDescription
+ <%=rule.name%> + + <% for _ in ipairs(rule.matches) do %> + <%=rule.addprefix and digit_pattern(rule.addprefix)%> 
+ <% end %> +
+ <% for _, m in ipairs(rule.matches) do %> + <%=rule.localprefix and "%s " % digit_pattern(rule.localprefix)%> + <%=digit_pattern(m)%>
+ <% end %> +
+ <%=ast.tools.hyperlinks( + rule.trunks, function(v) + return luci.dispatcher.build_url("admin", "asterisk", "trunks", "%s") % v:lower() + end + )%> + + <%=rule.description or rule.name%> + + + Edit entry + + + Delete entry + +
+
+
+
+ +
+
+

Create a new dialzone

+ The name is required and must be unique. It may only contain the characters A-Z, a-z, 0-9 and _ .
+ You can specifiy multiple number matches by separating them with spaces.
+ + <%- if create_error then %> +
Invalid name given!
+ <% end -%> + + + + + + +
+
+ +

+ +
+ +
+
+ +
+
+ + +
+
+
+
+
+
+<%+footer%>