mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-03-11 19:18:46 +00:00
Add. Support multiple events. (#1736)
Now subscriber stops and remove pid files when FS shutdown. So if you use Status->Services you will see correct status.
This commit is contained in:
committed by
FusionPBX
parent
e6567d6d8d
commit
3d1f5b6866
@@ -1,10 +1,23 @@
|
||||
local ievents = function(events, ...)
|
||||
if type(events) == 'string' then
|
||||
events = freeswitch.EventConsumer(events)
|
||||
elseif type(events) == 'table' then
|
||||
local array = events
|
||||
events = freeswitch.EventConsumer()
|
||||
for _, event in ipairs(array) do
|
||||
local base, sub
|
||||
if type(event) == 'table' then
|
||||
base, sub = event[1], event[2]
|
||||
else
|
||||
base = event
|
||||
end
|
||||
if not sub then events:bind(base)
|
||||
else events:bind(base, sub) end
|
||||
end
|
||||
end
|
||||
|
||||
local block, timeout = ...
|
||||
if timeout == 0 then block, timeout = 0, 0 end
|
||||
if timeout and (timeout == 0) then block, timeout = 0, 0 end
|
||||
timeout = timeout or 0
|
||||
|
||||
return function()
|
||||
|
||||
Reference in New Issue
Block a user