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