X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-app-asterisk%2Fluasrc%2Fmodel%2Fcbi%2Fasterisk-dialplans.lua;fp=applications%2Fluci-app-asterisk%2Fluasrc%2Fmodel%2Fcbi%2Fasterisk-dialplans.lua;h=4e4dce06bc05a538b5502c47b68375591d028e5d;hp=0000000000000000000000000000000000000000;hb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92;hpb=9edd0e46c3f880727738ce8ca6ff1c8b85f99ef4 diff --git a/applications/luci-app-asterisk/luasrc/model/cbi/asterisk-dialplans.lua b/applications/luci-app-asterisk/luasrc/model/cbi/asterisk-dialplans.lua new file mode 100644 index 000000000..4e4dce06b --- /dev/null +++ b/applications/luci-app-asterisk/luasrc/model/cbi/asterisk-dialplans.lua @@ -0,0 +1,102 @@ +--[[ +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$ +]]-- + +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