83476957f8224ce29cb1cbf2d0c80e8e42fcbcf0
[project/luci.git] / applications / luci-app-asterisk / luasrc / model / cbi / asterisk.lua
1 -- Copyright 2008 Steven Barth <steven@midlink.org>
2 -- Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
3 -- Licensed to the public under the Apache License 2.0.
4
5 cbimap = Map("asterisk", "asterisk", "")
6
7 asterisk = cbimap:section(TypedSection, "asterisk", "Asterisk General Options", "")
8 asterisk.anonymous = true
9
10 agidir = asterisk:option(Value, "agidir", "AGI directory", "")
11 agidir.rmempty = true
12
13 cache_record_files = asterisk:option(Flag, "cache_record_files", "Cache recorded sound files during recording", "")
14 cache_record_files.rmempty = true
15
16 debug = asterisk:option(Value, "debug", "Debug Level", "")
17 debug.rmempty = true
18
19 dontwarn = asterisk:option(Flag, "dontwarn", "Disable some warnings", "")
20 dontwarn.rmempty = true
21
22 dumpcore = asterisk:option(Flag, "dumpcore", "Dump core on crash", "")
23 dumpcore.rmempty = true
24
25 highpriority = asterisk:option(Flag, "highpriority", "High Priority", "")
26 highpriority.rmempty = true
27
28 initcrypto = asterisk:option(Flag, "initcrypto", "Initialise Crypto", "")
29 initcrypto.rmempty = true
30
31 internal_timing = asterisk:option(Flag, "internal_timing", "Use Internal Timing", "")
32 internal_timing.rmempty = true
33
34 logdir = asterisk:option(Value, "logdir", "Log directory", "")
35 logdir.rmempty = true
36
37 maxcalls = asterisk:option(Value, "maxcalls", "Maximum number of calls allowed", "")
38 maxcalls.rmempty = true
39
40 maxload = asterisk:option(Value, "maxload", "Maximum load to stop accepting new calls", "")
41 maxload.rmempty = true
42
43 nocolor = asterisk:option(Flag, "nocolor", "Disable console colors", "")
44 nocolor.rmempty = true
45
46 record_cache_dir = asterisk:option(Value, "record_cache_dir", "Sound files Cache directory", "")
47 record_cache_dir.rmempty = true
48 record_cache_dir:depends({ ["cache_record_files"] = "true" })
49
50 rungroup = asterisk:option(Flag, "rungroup", "The Group to run as", "")
51 rungroup.rmempty = true
52
53 runuser = asterisk:option(Flag, "runuser", "The User to run as", "")
54 runuser.rmempty = true
55
56 spooldir = asterisk:option(Value, "spooldir", "Voicemail Spool directory", "")
57 spooldir.rmempty = true
58
59 systemname = asterisk:option(Value, "systemname", "Prefix UniquID with system name", "")
60 systemname.rmempty = true
61
62 transcode_via_sln = asterisk:option(Flag, "transcode_via_sln", "Build transcode paths via SLINEAR, not directly", "")
63 transcode_via_sln.rmempty = true
64
65 transmit_silence_during_record = asterisk:option(Flag, "transmit_silence_during_record", "Transmit SLINEAR silence while recording a channel", "")
66 transmit_silence_during_record.rmempty = true
67
68 verbose = asterisk:option(Value, "verbose", "Verbose Level", "")
69 verbose.rmempty = true
70
71 zone = asterisk:option(Value, "zone", "Time Zone", "")
72 zone.rmempty = true
73
74
75 hardwarereboot = cbimap:section(TypedSection, "hardwarereboot", "Reload Hardware Config", "")
76
77 method = hardwarereboot:option(ListValue, "method", "Reboot Method", "")
78 method:value("web", "Web URL (wget)")
79 method:value("system", "program to run")
80 method.rmempty = true
81
82 param = hardwarereboot:option(Value, "param", "Parameter", "")
83 param.rmempty = true
84
85
86 iaxgeneral = cbimap:section(TypedSection, "iaxgeneral", "IAX General Options", "")
87 iaxgeneral.anonymous = true
88 iaxgeneral.addremove = true
89
90 allow = iaxgeneral:option(MultiValue, "allow", "Allow Codecs", "")
91 allow:value("alaw", "alaw")
92 allow:value("gsm", "gsm")
93 allow:value("g726", "g726")
94 allow.rmempty = true
95
96 canreinvite = iaxgeneral:option(ListValue, "canreinvite", "Reinvite/redirect media connections", "")
97 canreinvite:value("yes", "Yes")
98 canreinvite:value("nonat", "Yes when not behind NAT")
99 canreinvite:value("update", "Use UPDATE rather than INVITE for path redirection")
100 canreinvite:value("no", "No")
101 canreinvite.rmempty = true
102
103 static = iaxgeneral:option(Flag, "static", "Static", "")
104 static.rmempty = true
105
106 writeprotect = iaxgeneral:option(Flag, "writeprotect", "Write Protect", "")
107 writeprotect.rmempty = true
108
109
110 sipgeneral = cbimap:section(TypedSection, "sipgeneral", "Section sipgeneral", "")
111 sipgeneral.anonymous = true
112 sipgeneral.addremove = true
113
114 allow = sipgeneral:option(MultiValue, "allow", "Allow codecs", "")
115 allow:value("ulaw", "ulaw")
116 allow:value("alaw", "alaw")
117 allow:value("gsm", "gsm")
118 allow:value("g726", "g726")
119 allow.rmempty = true
120
121 port = sipgeneral:option(Value, "port", "SIP Port", "")
122 port.rmempty = true
123
124 realm = sipgeneral:option(Value, "realm", "SIP realm", "")
125 realm.rmempty = true
126
127
128 moh = cbimap:section(TypedSection, "moh", "Music On Hold", "")
129
130 application = moh:option(Value, "application", "Application", "")
131 application.rmempty = true
132 application:depends({ ["asterisk.moh.mode"] = "custom" })
133
134 directory = moh:option(Value, "directory", "Directory of Music", "")
135 directory.rmempty = true
136
137 mode = moh:option(ListValue, "mode", "Option mode", "")
138 mode:value("system", "program to run")
139 mode:value("files", "Read files from directory")
140 mode:value("quietmp3", "Quite MP3")
141 mode:value("mp3", "Loud MP3")
142 mode:value("mp3nb", "unbuffered MP3")
143 mode:value("quietmp3nb", "Quiet Unbuffered MP3")
144 mode:value("custom", "Run a custom application")
145 mode.rmempty = true
146
147 random = moh:option(Flag, "random", "Random Play", "")
148 random.rmempty = true
149
150
151 return cbimap