summaryrefslogtreecommitdiffstats
path: root/freeswitch-controller.lua
blob: 6b459cdc87f9e86949e9084168beca35a4f564e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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

editfile = 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

function createfile(self)
	return controllerfunctions.handle_form(self, self.model.getnewfile, self.model.createfile, self.clientdata, "Create", "Create New Freeswitch File", "Freeswitch File Created")
end

function deletefile(self)
	return self:redirect_to_referrer(self.model.deletefile(self.clientdata.filename))
end