summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2011-10-03 19:07:21 +0000
committerTed Trask <ttrask01@yahoo.com>2011-10-03 19:07:21 +0000
commit178ffd23c68e3afdd67186ac2b9c3d99e0ea8253 (patch)
tree57948bb694f7b07a24be69f60ed2f7405edf9ac9
parent435378557b71bc71a0e5caed5a8c335b28f98a00 (diff)
downloadacf-freeswitch-178ffd23c68e3afdd67186ac2b9c3d99e0ea8253.tar.bz2
acf-freeswitch-178ffd23c68e3afdd67186ac2b9c3d99e0ea8253.tar.xz
Added reloadxml function
-rw-r--r--freeswitch-controller.lua4
-rw-r--r--freeswitch-listfiles-html.lsp11
-rw-r--r--freeswitch-model.lua9
-rw-r--r--freeswitch.roles4
4 files changed, 25 insertions, 3 deletions
diff --git a/freeswitch-controller.lua b/freeswitch-controller.lua
index 6b459cd..607d718 100644
--- a/freeswitch-controller.lua
+++ b/freeswitch-controller.lua
@@ -27,3 +27,7 @@ end
function deletefile(self)
return self:redirect_to_referrer(self.model.deletefile(self.clientdata.filename))
end
+
+function reloadxml(self)
+ return self:redirect_to_referrer(self.model.reload_xml())
+end
diff --git a/freeswitch-listfiles-html.lsp b/freeswitch-listfiles-html.lsp
index e742961..ae47535 100644
--- a/freeswitch-listfiles-html.lsp
+++ b/freeswitch-listfiles-html.lsp
@@ -2,7 +2,7 @@
require("viewfunctions")
%>
-<% displaycommandresults({"editfile", "deletefile"}, session) %>
+<% displaycommandresults({"editfile", "deletefile", "reloadxml"}, session) %>
<% displaycommandresults({"createfile"}, session, true) %>
<% if viewlibrary and viewlibrary.dispatch_component then
@@ -42,3 +42,12 @@ end %>
createform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/createfile"
displayform(createform)
end %>
+
+<% if viewlibrary.check_permission("reloadxml") then %>
+<H1>Reload XML</H1>
+<DL>
+ <DT>Reload XML</DT>
+ <DD><form action="<%= html.html_escape(page_info.script .. page_info.prefix) %>freeswitch/reloadxml" method="POST">
+ <input class="submit" type="submit" name="reloadxml" value="Reload"></form></DD>
+</DL>
+<% end %>
diff --git a/freeswitch-model.lua b/freeswitch-model.lua
index 149bf32..3c2cb95 100644
--- a/freeswitch-model.lua
+++ b/freeswitch-model.lua
@@ -12,6 +12,8 @@ local processname = "freeswitch"
local packagename = "freeswitch"
local baseurl = "/etc/freeswitch"
+local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin "
+
-- ################################################################################
-- LOCAL FUNCTIONS
@@ -31,6 +33,13 @@ function startstop_service(action)
return modelfunctions.startstop_service(processname, action, {"Start", "Stop", "Restart"})
end
+function reload_xml()
+ local f = io.popen(path.."fs_cli -x reloadxml 2>&1")
+ local result = f:read("*a")
+ f:close()
+ return cfe({ value=result, label="Freeswitch Reload XML result" })
+end
+
get_file = function(filename)
return modelfunctions.getfiledetails(filename, is_valid_filename)
end
diff --git a/freeswitch.roles b/freeswitch.roles
index ce0c26e..ae61a83 100644
--- a/freeswitch.roles
+++ b/freeswitch.roles
@@ -1,3 +1,3 @@
USER=freeswitch:status,freeswitch:startstop,freeswitch:logfile
-EXPERT=freeswitch:listfiles,freeswitch:editfile,freeswitch:createfile,freeswitch:deletefile
-ADMIN=freeswitch:status,freeswitch:startstop,freeswitch:logfile,freeswitch:listfiles,freeswitch:editfile,freeswitch:createfile,freeswitch:deletefile
+EXPERT=freeswitch:listfiles,freeswitch:editfile,freeswitch:createfile,freeswitch:deletefile,freeswitch:reloadxml
+ADMIN=freeswitch:status,freeswitch:startstop,freeswitch:logfile,freeswitch:listfiles,freeswitch:editfile,freeswitch:createfile,freeswitch:deletefile,freeswitch:reloadxml