* luci/app/asterisk: more work on cbi models

This commit is contained in:
Jo-Philipp Wich 2008-10-23 15:42:12 +00:00
parent b601dd75c1
commit 406400a198
8 changed files with 66 additions and 60 deletions

View file

@ -19,9 +19,9 @@ dialplan = cbimap:section(TypedSection, "dialplan", "Section dialplan", "")
dialplan.addremove = true dialplan.addremove = true
dialplan.dynamic = true dialplan.dynamic = true
include = dialplan:option(Value, "include", "", "") include = dialplan:option(MultiValue, "include", "Include zones and plans", "")
include.rmempty = true 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 = cbimap:section(TypedSection, "dialplanexten", "Dialplan Extension", "")
dialplanexten.anonymous = true dialplanexten.anonymous = true
@ -73,24 +73,30 @@ dialplanvoice.dynamic = true
dialzone = cbimap:section(TypedSection, "dialzone", "Dial Zones for Dialplan", "") dialzone = cbimap:section(TypedSection, "dialzone", "Dial Zones for Dialplan", "")
dialzone.addremove = true dialzone.addremove = true
dialzone.template = "cbi/tblsection"
addprefix = dialzone:option(Value, "addprefix", "Prefix to add matching dialplans", "") addprefix = dialzone:option(Value, "addprefix", "Prefix to add matching dialplans", "")
addprefix.rmempty = true addprefix.rmempty = true
international = dialzone:option(DynamicList, "international", "Match International prefix", "") --international = dialzone:option(DynamicList, "international", "Match International prefix", "")
international = dialzone:option(Value, "international", "Match International prefix", "")
international.rmempty = true international.rmempty = true
localprefix = dialzone:option(Value, "localprefix", "Prefix (0) to add/remove to/from international numbers", "") localprefix = dialzone:option(Value, "localprefix", "Prefix (0) to add/remove to/from intl. numbers", "")
localprefix.rmempty = true localprefix.rmempty = true
localzone = dialzone:option(Value, "localzone", "", "") localzone = dialzone:option(Value, "localzone", "Dialzone for intl. numbers matched as local", "")
localzone.rmempty = true 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 = dialzone:option(Value, "match", "Match plan", "")
match.rmempty = true match.rmempty = true
uses = dialzone:option(Value, "uses", "Connection to use", "") uses = dialzone:option(ListValue, "uses", "Connection to use", "")
uses.rmempty = true 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 return cbimap

View file

@ -21,8 +21,10 @@ iax.addremove = true
alwaysinternational = iax:option(Flag, "alwaysinternational", "Always Dial International", "") alwaysinternational = iax:option(Flag, "alwaysinternational", "Always Dial International", "")
alwaysinternational.optional = true alwaysinternational.optional = true
context = iax:option(Value, "context", "", "") context = iax:option(ListValue, "context", "Context to use", "")
context.optional = true context.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
cbimap.uci:foreach( "asterisk", "dialplan", function(s) context:value(s['.name']) end )
cbimap.uci:foreach( "asterisk", "dialzone", function(s) context:value(s['.name']) end )
countrycode = iax:option(Value, "countrycode", "Country Code for connection", "") countrycode = iax:option(Value, "countrycode", "Country Code for connection", "")
countrycode.optional = true countrycode.optional = true

View file

@ -15,21 +15,19 @@ $Id$
cbimap = Map("asterisk", "asterisk", "") cbimap = Map("asterisk", "asterisk", "")
meetme = cbimap:section(TypedSection, "meetme", "Meetme Conference", "")
adminpin = meetme:option(Value, "adminpin", "Admin PIN", "")
adminpin.rmempty = true
pin = meetme:option(Value, "pin", "Meeting PIN", "")
pin.rmempty = true
meetmegeneral = cbimap:section(TypedSection, "meetmegeneral", "Meetme Conference General Options", "") meetmegeneral = cbimap:section(TypedSection, "meetmegeneral", "Meetme Conference General Options", "")
meetmegeneral.anonymous = true
meetmegeneral.addremove = true
audiobuffers = meetmegeneral:option(Value, "audiobuffers", "Number of 20ms audio buffers to be used", "") audiobuffers = meetmegeneral:option(Value, "audiobuffers", "Number of 20ms audio buffers to be used", "")
audiobuffers.rmempty = true
meetme = cbimap:section(TypedSection, "meetme", "Meetme Conference", "")
meetme.addremove = true
adminpin = meetme:option(Value, "adminpin", "Admin PIN", "")
adminpin.password = true
pin = meetme:option(Value, "pin", "Meeting PIN", "")
pin.password = true
return cbimap return cbimap

View file

@ -34,78 +34,78 @@ parkcall.rmempty = true
featurepark = cbimap:section(TypedSection, "featurepark", "Parking Feature", "") featurepark = cbimap:section(TypedSection, "featurepark", "Parking Feature", "")
featurepark.anonymous = true featurepark.anonymous = true
featurepark.addremove = true
parkenabled = featurepark:option(Flag, "parkenabled", "Enable Parking", "")
adsipark = featurepark:option(Flag, "adsipark", "ADSI Park", "") adsipark = featurepark:option(Flag, "adsipark", "ADSI Park", "")
adsipark.rmempty = true adsipark.rmempty = true
adsipark:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) adsipark:depends({ parkenabled = "1" })
atxfernoanswertimeout = featurepark:option(Value, "atxfernoanswertimeout", "Attended transfer timeout (sec)", "") atxfernoanswertimeout = featurepark:option(Value, "atxfernoanswertimeout", "Attended transfer timeout (sec)", "")
atxfernoanswertimeout.rmempty = true atxfernoanswertimeout.rmempty = true
atxfernoanswertimeout:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) atxfernoanswertimeout:depends({ parkenabled = "1" })
automon = featurepark:option(Value, "automon", "One touch record key", "") automon = featurepark:option(Value, "automon", "One touch record key", "")
automon.rmempty = true automon.rmempty = true
automon:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) automon:depends({ parkenabled = "1" })
context = featurepark:option(Value, "context", "Name of call context for parking", "") context = featurepark:option(Value, "context", "Name of call context for parking", "")
context.rmempty = true context.rmempty = true
context:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) context:depends({ parkenabled = "1" })
courtesytone = featurepark:option(Value, "courtesytone", "Sound file to play to parked caller", "") courtesytone = featurepark:option(Value, "courtesytone", "Sound file to play to parked caller", "")
courtesytone.rmempty = true courtesytone.rmempty = true
courtesytone:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) courtesytone:depends({ parkenabled = "1" })
featuredigittimeout = featurepark:option(Value, "featuredigittimeout", "Max time (ms) between digits for feature activation", "") featuredigittimeout = featurepark:option(Value, "featuredigittimeout", "Max time (ms) between digits for feature activation", "")
featuredigittimeout.rmempty = true featuredigittimeout.rmempty = true
featuredigittimeout:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) featuredigittimeout:depends({ parkenabled = "1" })
findslot = featurepark:option(ListValue, "findslot", "Method to Find Parking slot", "") findslot = featurepark:option(ListValue, "findslot", "Method to Find Parking slot", "")
findslot:value("first", "First available slot") findslot:value("first", "First available slot")
findslot:value("next", "Next free parking space") findslot:value("next", "Next free parking space")
findslot.rmempty = true findslot.rmempty = true
findslot:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) findslot:depends({ parkenabled = "1" })
parkedmusicclass = featurepark:option(Value, "parkedmusicclass", "", "") parkedmusicclass = featurepark:option(ListValue, "parkedmusicclass", "Music on Hold class for the parked channel", "")
parkedmusicclass.rmempty = true parkedmusicclass.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk" )
parkedmusicclass:depends({ parkenabled = "1" })
cbimap.uci:foreach( "asterisk", "moh", function(s) parkedmusicclass:value(s['.name']) end )
parkedplay = featurepark:option(ListValue, "parkedplay", "Play courtesy tone to", "") parkedplay = featurepark:option(ListValue, "parkedplay", "Play courtesy tone to", "")
parkedplay:value("caller", "Caller") parkedplay:value("caller", "Caller")
parkedplay:value("parked", "Parked user") parkedplay:value("parked", "Parked user")
parkedplay:value("both", "Both") parkedplay:value("both", "Both")
parkedplay.rmempty = true parkedplay.rmempty = true
parkedplay:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) parkedplay:depends({ parkenabled = "1" })
parkenabled = featurepark:option(Flag, "parkenabled", "Enable Parking", "")
parkenabled.rmempty = true
parkext = featurepark:option(Value, "parkext", "Extension to dial to park", "") parkext = featurepark:option(Value, "parkext", "Extension to dial to park", "")
parkext.rmempty = true parkext.rmempty = true
parkext:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) parkext:depends({ parkenabled = "1" })
parkingtime = featurepark:option(Value, "parkingtime", "Parking time (secs)", "") parkingtime = featurepark:option(Value, "parkingtime", "Parking time (secs)", "")
parkingtime.rmempty = true parkingtime.rmempty = true
parkingtime:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) parkingtime:depends({ parkenabled = "1" })
parkpos = featurepark:option(Value, "parkpos", "Range of extensions for call parking", "") parkpos = featurepark:option(Value, "parkpos", "Range of extensions for call parking", "")
parkpos.rmempty = true parkpos.rmempty = true
parkpos:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) parkpos:depends({ parkenabled = "1" })
pickupexten = featurepark:option(Value, "pickupexten", "Pickup extension", "") pickupexten = featurepark:option(Value, "pickupexten", "Pickup extension", "")
pickupexten.rmempty = true pickupexten.rmempty = true
pickupexten:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) pickupexten:depends({ parkenabled = "1" })
transferdigittimeout = featurepark:option(Value, "transferdigittimeout", "Seconds to wait bewteen digits when transferring", "") transferdigittimeout = featurepark:option(Value, "transferdigittimeout", "Seconds to wait bewteen digits when transferring", "")
transferdigittimeout.rmempty = true transferdigittimeout.rmempty = true
transferdigittimeout:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) transferdigittimeout:depends({ parkenabled = "1" })
xferfailsound = featurepark:option(Value, "xferfailsound", "sound when attended transfer is complete", "") xferfailsound = featurepark:option(Value, "xferfailsound", "sound when attended transfer is complete", "")
xferfailsound.rmempty = true xferfailsound.rmempty = true
xferfailsound:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) xferfailsound:depends({ parkenabled = "1" })
xfersound = featurepark:option(Value, "xfersound", "Sound when attended transfer fails", "") xfersound = featurepark:option(Value, "xfersound", "Sound when attended transfer fails", "")
xfersound.rmempty = true xfersound.rmempty = true
xfersound:depends({ ["asterisk.featurepark.parkenabled"] = "true" }) xfersound:depends({ parkenabled = "1" })
return cbimap return cbimap

View file

@ -28,8 +28,10 @@ canreinvite:value("update", "Use UPDATE rather than INVITE for path redirection"
canreinvite:value("no", "No") canreinvite:value("no", "No")
canreinvite.optional = true canreinvite.optional = true
context = sip:option(Value, "context", "", "") context = sip:option(ListValue, "context", "Context to use", "")
context.optional = true context.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
cbimap.uci:foreach( "asterisk", "dialplan", function(s) context:value(s['.name']) end )
cbimap.uci:foreach( "asterisk", "dialzone", function(s) context:value(s['.name']) end )
countrycode = sip:option(Value, "countrycode", "Country Code for connection", "") countrycode = sip:option(Value, "countrycode", "Country Code for connection", "")
countrycode.optional = true countrycode.optional = true

View file

@ -16,14 +16,12 @@ $Id$
cbimap = Map("asterisk", "asterisk", "") cbimap = Map("asterisk", "asterisk", "")
voicegeneral = cbimap:section(TypedSection, "voicegeneral", "Voicemail general options", "") voicegeneral = cbimap:section(TypedSection, "voicegeneral", "Voicemail general options", "")
voicegeneral.anonymous = true
voicegeneral.addremove = true
serveremail = voicegeneral:option(Value, "serveremail", "From Email address of server", "") serveremail = voicegeneral:option(Value, "serveremail", "From Email address of server", "")
serveremail.rmempty = true
voicemail = cbimap:section(TypedSection, "voicemail", "Voice Mail boxes", "") voicemail = cbimap:section(TypedSection, "voicemail", "Voice Mail boxes", "")
voicemail.addremove = true
attach = voicemail:option(Flag, "attach", "Email contains attachment", "") attach = voicemail:option(Flag, "attach", "Email contains attachment", "")
attach.rmempty = true attach.rmempty = true
@ -37,8 +35,8 @@ name.rmempty = true
password = voicemail:option(Value, "password", "Password", "") password = voicemail:option(Value, "password", "Password", "")
password.rmempty = true password.rmempty = true
zone = voicemail:option(Value, "zone", "", "") zone = voicemail:option(ListValue, "zone", "Voice Zone", "")
zone.rmempty = true cbimap.uci:foreach( "asterisk", "voicezone", function(s) zone:value(s['.name']) end )
voicezone = cbimap:section(TypedSection, "voicezone", "Voice Zone settings", "") voicezone = cbimap:section(TypedSection, "voicezone", "Voice Zone settings", "")

View file

@ -157,7 +157,7 @@ config 'dialplangeneral'
option 'allowtransfer' 'no' option 'allowtransfer' 'no'
config 'dialplan' 'internal' config 'dialplan' 'internal'
option 'include' 'localcall,interstate,smartnumber,emergency,extensions' option 'include' 'localcall interstate smartnumber emergency extensions'
config 'dialplanvoice' config 'dialplanvoice'
option 'dialplan' 'internal' option 'dialplan' 'internal'
@ -180,7 +180,7 @@ config 'dialplanmeetme'
option 'room' '' option 'room' ''
config 'dialplan' 'localinternational' config 'dialplan' 'localinternational'
option 'include' 'mobile,interstate' option 'include' 'mobile interstate'
config 'dialzone' 'interstate' config 'dialzone' 'interstate'
option 'uses' 'SIP/providerphone' option 'uses' 'SIP/providerphone'

View file

@ -2660,7 +2660,7 @@ config variable
option name 'realm' option name 'realm'
option title 'SIP realm' option title 'SIP realm'
option section 'asterisk.sipgeneral' option section 'asterisk.sipgeneral'
option datatype 'domain' option datatype 'host'
config section config section
@ -3223,7 +3223,7 @@ config section
option title 'Parking Feature' option title 'Parking Feature'
option package 'asterisk' option package 'asterisk'
option named false option named false
option unique false option unique true
option dynamic false option dynamic false
option required false option required false
@ -3377,7 +3377,7 @@ config section
option title 'Feature Key maps' option title 'Feature Key maps'
option package 'asterisk' option package 'asterisk'
option named false option named false
option unique false option unique true
option dynamic false option dynamic false
option required false option required false
@ -3443,7 +3443,7 @@ config section
option title 'Meetme Conference General Options' option title 'Meetme Conference General Options'
option package 'asterisk' option package 'asterisk'
option named false option named false
option unique false option unique true
option dynamic false option dynamic false
option required false option required false
@ -3459,7 +3459,7 @@ config section
option title 'Meetme Conference' option title 'Meetme Conference'
option package 'asterisk' option package 'asterisk'
option named true option named true
option unique true option unique false
option dynamic false option dynamic false
option required false option required false
@ -3551,7 +3551,7 @@ config section
option title 'Voicemail general options' option title 'Voicemail general options'
option package 'asterisk' option package 'asterisk'
option named false option named false
option unique false option unique true
option dynamic false option dynamic false
option required false option required false
@ -3567,7 +3567,7 @@ config section
option title 'Voice Mail boxes' option title 'Voice Mail boxes'
option package 'asterisk' option package 'asterisk'
option named true option named true
option unique true option unique false
option dynamic false option dynamic false
option required false option required false