<%# 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,t) return "%s" %{ 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 %>
" enctype="multipart/form-data">

Outgoing Call Routing

Here you can manage your dial plans which are used to route outgoing calls from your local extensions.

Related tasks:
Manage dialzones | Manage voicemailboxes
<% for i, plan in pairs(ast.dialplan.plans()) do %>
<% local zones_used = { }; local row = 0 %> <% for i, zone in ipairs(plan.zones) do zones_used[zone.name] = true %> <% row = row + 1; end %> <% local boxes_used = { } %> <% for ext, box in luci.util.kspairs(plan.voicemailboxes) do boxes_used[box.id] = true %> <% row = row + 1; end %>
Dialplan <%=plan.name%> Remove this dialplan
└ Dialzone <%=zone.name%> (<%=zone.description%>)

Lines: <%=ast.tools.hyperlinks( zone.trunks, function(v) return luci.dispatcher.build_url("admin", "asterisk", "trunks", "%s") % v:lower() end )%>
Matches: <%=format_matches(zone)%>

Edit dialzone Remove from this dialplan
└ Voicemailbox <%=box.id%> (<%=box.name%>)

Owner: <%=box.name%> | eMail: <%=#box.email > 0 and box.email or 'n/a'%> | Pager: <%=#box.page > 0 and box.page or 'n/a'%>
Matches: <%=format_matches(ext)%>

Edit dialzone Remove from this dialplan

Add Dialzone:


Add Voicemailbox:
as extension


<% end %>

Create a new dialplan

The name is required and must be unique. It may only contain the characters A-Z, a-z, 0-9 and _ .
<%- if create_error then %>
Invalid name given!
<% end -%>
<%+footer%>