summaryrefslogtreecommitdiffstats
path: root/freeswitch-controller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'freeswitch-controller.lua')
-rw-r--r--freeswitch-controller.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/freeswitch-controller.lua b/freeswitch-controller.lua
new file mode 100644
index 0000000..04d6ea7
--- /dev/null
+++ b/freeswitch-controller.lua
@@ -0,0 +1,21 @@
+module (..., package.seeall)
+
+require("controllerfunctions")
+
+default_action = "status"
+
+status = function( self )
+ return self.model.get_status()
+end
+
+startstop = function( self )
+ return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.clientdata)
+end
+
+listfiles = function( self )
+ return self.model.list_files()
+end
+
+edit = function( self )
+ return controllerfunctions.handle_form(self, function() return self.model.get_file(self.clientdata.filename) end, self.model.update_file, self.clientdata, "Save", "Edit File", "File Saved")
+end