Merge pull request #656 from nlhintz/pull-request
[project/luci.git] / applications / luci-app-asterisk / luasrc / model / cbi / asterisk-mod-res-feature.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 featuremap = cbimap:section(TypedSection, "featuremap", "Feature Key maps", "")
8 featuremap.anonymous = true
9 featuremap.addremove = true
10
11 atxfer = featuremap:option(Value, "atxfer", "Attended transfer key", "")
12 atxfer.rmempty = true
13
14 blindxfer = featuremap:option(Value, "blindxfer", "Blind transfer key", "")
15 blindxfer.rmempty = true
16
17 disconnect = featuremap:option(Value, "disconnect", "Key to Disconnect call", "")
18 disconnect.rmempty = true
19
20 parkcall = featuremap:option(Value, "parkcall", "Key to Park call", "")
21 parkcall.rmempty = true
22
23
24 featurepark = cbimap:section(TypedSection, "featurepark", "Parking Feature", "")
25 featurepark.anonymous = true
26
27 parkenabled = featurepark:option(Flag, "parkenabled", "Enable Parking", "")
28
29 adsipark = featurepark:option(Flag, "adsipark", "ADSI Park", "")
30 adsipark.rmempty = true
31 adsipark:depends({ parkenabled = "1" })
32
33 atxfernoanswertimeout = featurepark:option(Value, "atxfernoanswertimeout", "Attended transfer timeout (sec)", "")
34 atxfernoanswertimeout.rmempty = true
35 atxfernoanswertimeout:depends({ parkenabled = "1" })
36
37 automon = featurepark:option(Value, "automon", "One touch record key", "")
38 automon.rmempty = true
39 automon:depends({ parkenabled = "1" })
40
41 context = featurepark:option(Value, "context", "Name of call context for parking", "")
42 context.rmempty = true
43 context:depends({ parkenabled = "1" })
44
45 courtesytone = featurepark:option(Value, "courtesytone", "Sound file to play to parked caller", "")
46 courtesytone.rmempty = true
47 courtesytone:depends({ parkenabled = "1" })
48
49 featuredigittimeout = featurepark:option(Value, "featuredigittimeout", "Max time (ms) between digits for feature activation", "")
50 featuredigittimeout.rmempty = true
51 featuredigittimeout:depends({ parkenabled = "1" })
52
53 findslot = featurepark:option(ListValue, "findslot", "Method to Find Parking slot", "")
54 findslot:value("first", "First available slot")
55 findslot:value("next", "Next free parking space")
56 findslot.rmempty = true
57 findslot:depends({ parkenabled = "1" })
58
59 parkedmusicclass = featurepark:option(ListValue, "parkedmusicclass", "Music on Hold class for the parked channel", "")
60 parkedmusicclass.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk" )
61 parkedmusicclass:depends({ parkenabled = "1" })
62 cbimap.uci:foreach( "asterisk", "moh", function(s) parkedmusicclass:value(s['.name']) end )
63
64 parkedplay = featurepark:option(ListValue, "parkedplay", "Play courtesy tone to", "")
65 parkedplay:value("caller", "Caller")
66 parkedplay:value("parked", "Parked user")
67 parkedplay:value("both", "Both")
68 parkedplay.rmempty = true
69 parkedplay:depends({ parkenabled = "1" })
70
71 parkext = featurepark:option(Value, "parkext", "Extension to dial to park", "")
72 parkext.rmempty = true
73 parkext:depends({ parkenabled = "1" })
74
75 parkingtime = featurepark:option(Value, "parkingtime", "Parking time (secs)", "")
76 parkingtime.rmempty = true
77 parkingtime:depends({ parkenabled = "1" })
78
79 parkpos = featurepark:option(Value, "parkpos", "Range of extensions for call parking", "")
80 parkpos.rmempty = true
81 parkpos:depends({ parkenabled = "1" })
82
83 pickupexten = featurepark:option(Value, "pickupexten", "Pickup extension", "")
84 pickupexten.rmempty = true
85 pickupexten:depends({ parkenabled = "1" })
86
87 transferdigittimeout = featurepark:option(Value, "transferdigittimeout", "Seconds to wait between digits when transferring", "")
88 transferdigittimeout.rmempty = true
89 transferdigittimeout:depends({ parkenabled = "1" })
90
91 xferfailsound = featurepark:option(Value, "xferfailsound", "sound when attended transfer is complete", "")
92 xferfailsound.rmempty = true
93 xferfailsound:depends({ parkenabled = "1" })
94
95 xfersound = featurepark:option(Value, "xfersound", "Sound when attended transfer fails", "")
96 xfersound.rmempty = true
97 xfersound:depends({ parkenabled = "1" })
98
99
100 return cbimap