mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-11 13:44:58 +00:00
Change. Use service::control event to control services (#1790)
* Change. Use `service::control` event to control services This is more FS way. E.g. sofia sends `sofia::register` event and add all information to headers. So now `service` script emit `fusion::service::control` event and each service responsible for test its own name. This also allows add in future evnets to e.g. monitor service status like `fusion::service::satus` so it will be possible write service which will be restart services. * Change. rename service name from `flow` to `call_flow`
This commit is contained in:
committed by
FusionPBX
parent
865b1b5019
commit
f214625ead
@@ -27,8 +27,8 @@ end
|
||||
|
||||
end
|
||||
|
||||
local service_name = "flow"
|
||||
local pid_file = scripts_dir .. "/run/call_flow_subscribe.tmp"
|
||||
local service_name = "call_flow"
|
||||
local pid_file = scripts_dir .. "/run/" .. service_name .. ".tmp"
|
||||
|
||||
local events = EventConsumer.new(pid_file)
|
||||
|
||||
@@ -39,7 +39,9 @@ events:bind("SHUTDOWN", function(self, name, event)
|
||||
end)
|
||||
|
||||
-- Control commands from FusionPBX
|
||||
events:bind("CUSTOM::fusion::service::" .. service_name, function(self, name, event)
|
||||
events:bind("CUSTOM::fusion::service::control", function(self, name, event)
|
||||
if service_name ~= event:getHeader('service-name') then return end
|
||||
|
||||
local command = event:getHeader('service-command')
|
||||
if command == "stop" then
|
||||
log.notice("get stop command")
|
||||
|
||||
Reference in New Issue
Block a user