diff options
Diffstat (limited to 'asterisk-model.lua')
-rw-r--r-- | asterisk-model.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/asterisk-model.lua b/asterisk-model.lua index 5ce9dd4..6858e6f 100644 --- a/asterisk-model.lua +++ b/asterisk-model.lua @@ -1,5 +1,5 @@ -- Copyright(c) 2007 A. Brodmann - Licensed under terms of GPL2 -module (..., package.seeall) +local mymodule = {} -- Load libraries modelfunctions = require("modelfunctions") @@ -24,23 +24,23 @@ end -- ################################################################################ -- PUBLIC FUNCTIONS -get_status = function() +mymodule.get_status = function() return modelfunctions.getstatus(processname, packagename, "Asterisk Status") end -function get_startstop(self, clientdata) +mymodule.get_startstop = function(self, clientdata) return modelfunctions.get_startstop(processname) end -function startstop_service(self, startstop, action) +mymodule.startstop_service = function(self, startstop, action) return modelfunctions.startstop_service(startstop, action) end -get_file = function(self, clientdata) +mymodule.get_file = function(self, clientdata) return modelfunctions.getfiledetails(clientdata.filename, is_valid_filename) end -update_file = function(self, filedetails) +mymodule.update_file = function(self, filedetails) local ret = modelfunctions.setfiledetails(self, filedetails, is_valid_filename) if not ret.errtxt then posix.chmod(filedetails.value.filename.value, "rw-------") @@ -49,7 +49,7 @@ update_file = function(self, filedetails) return ret end -list_files = function() +mymodule.list_files = function() local retval = {} for file in fs.find(null, baseurl) do local details = fs.stat(file) @@ -61,3 +61,5 @@ list_files = function() table.sort(retval, function(a,b) return a.filename < b.filename end) return cfe({ type="structure", value=retval, label="List of Asterisk files" }) end + +return mymodule |