Update my email addresses in the license headers
[project/luci.git] / applications / luci-app-asterisk / luasrc / model / cbi / asterisk-dialplans.lua
1 -- Copyright 2008 Steven Barth <steven@midlink.org>
2 -- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
3 -- Licensed to the public under the Apache License 2.0.
4
5 cbimap = Map("asterisk", "asterisk", "")
6
7 dialplan = cbimap:section(TypedSection, "dialplan", "Section dialplan", "")
8 dialplan.addremove = true
9 dialplan.dynamic = true
10
11 include = dialplan:option(MultiValue, "include", "Include zones and plans", "")
12 cbimap.uci:foreach( "asterisk", "dialplan", function(s) include:value(s['.name']) end )
13 cbimap.uci:foreach( "asterisk", "dialzone", function(s) include:value(s['.name']) end )
14
15 dialplanexten = cbimap:section(TypedSection, "dialplanexten", "Dialplan Extension", "")
16 dialplanexten.anonymous = true
17 dialplanexten.addremove = true
18 dialplanexten.dynamic = true
19
20
21 dialplangeneral = cbimap:section(TypedSection, "dialplangeneral", "Dialplan General Options", "")
22 dialplangeneral.anonymous = true
23 dialplangeneral.addremove = true
24
25 allowtransfer = dialplangeneral:option(Flag, "allowtransfer", "Allow transfer", "")
26 allowtransfer.rmempty = true
27
28 canreinvite = dialplangeneral:option(ListValue, "canreinvite", "Reinvite/redirect media connections", "")
29 canreinvite:value("yes", "Yes")
30 canreinvite:value("nonat", "Yes when not behind NAT")
31 canreinvite:value("update", "Use UPDATE rather than INVITE for path redirection")
32 canreinvite:value("no", "No")
33 canreinvite.rmempty = true
34
35 clearglobalvars = dialplangeneral:option(Flag, "clearglobalvars", "Clear global vars", "")
36 clearglobalvars.rmempty = true
37
38
39 dialplangoto = cbimap:section(TypedSection, "dialplangoto", "Dialplan Goto", "")
40 dialplangoto.anonymous = true
41 dialplangoto.addremove = true
42 dialplangoto.dynamic = true
43
44
45 dialplanmeetme = cbimap:section(TypedSection, "dialplanmeetme", "Dialplan Conference", "")
46 dialplanmeetme.anonymous = true
47 dialplanmeetme.addremove = true
48 dialplanmeetme.dynamic = true
49
50
51 dialplansaytime = cbimap:section(TypedSection, "dialplansaytime", "Dialplan Time", "")
52 dialplansaytime.anonymous = true
53 dialplansaytime.addremove = true
54 dialplansaytime.dynamic = true
55
56
57 dialplanvoice = cbimap:section(TypedSection, "dialplanvoice", "Dialplan Voicemail", "")
58 dialplanvoice.anonymous = true
59 dialplanvoice.addremove = true
60 dialplanvoice.dynamic = true
61
62
63 dialzone = cbimap:section(TypedSection, "dialzone", "Dial Zones for Dialplan", "")
64 dialzone.addremove = true
65 dialzone.template = "cbi/tblsection"
66
67 addprefix = dialzone:option(Value, "addprefix", "Prefix to add matching dialplans", "")
68 addprefix.rmempty = true
69
70 --international = dialzone:option(DynamicList, "international", "Match International prefix", "")
71 international = dialzone:option(Value, "international", "Match International prefix", "")
72 international.rmempty = true
73
74 localprefix = dialzone:option(Value, "localprefix", "Prefix (0) to add/remove to/from intl. numbers", "")
75 localprefix.rmempty = true
76
77 localzone = dialzone:option(Value, "localzone", "Dialzone for intl. numbers matched as local", "")
78 localzone.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
79 cbimap.uci:foreach( "asterisk", "dialplan", function(s) localzone:value(s['.name']) end )
80 cbimap.uci:foreach( "asterisk", "dialzone", function(s) localzone:value(s['.name']) end )
81
82 match = dialzone:option(Value, "match", "Match plan", "")
83 match.rmempty = true
84
85 uses = dialzone:option(ListValue, "uses", "Connection to use", "")
86 uses.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "sip-conns" )
87 cbimap.uci:foreach( "asterisk", "sip", function(s) uses:value('SIP/'..s['.name']) end )
88 cbimap.uci:foreach( "asterisk", "iax", function(s) uses:value('IAX/'..s['.name']) end )
89
90
91 return cbimap