Rewrite MWI and CallFlow subscribe handlers based on EventConsumer class.
Also on my test VirtualBox/Debian system Lua function `os.clock` produce
very strange result(delta ~0.015 for 1 second) so I switch to `os.time`.
Now to to stop this background Lua scripts it possible send CUSTOM event
with subclass `fusion::XXX::shutdown`. Where XXX is `mwi` or `flow`.
Usage of EventConsumer class
```Lua
-- create new object with timeout one minute
local events = EventConsumer.new(60000)
-- bind to some FS event
events:bind("SHUTDOW", function(self, name, event) ... end)
-- bind to another FS event with subclass
events:bind("CUSTOM::fusion::mwi::shutdown", function(self, name, event) ... end)
-- handle timeout event
events:on("TIMEOUT", function(self, name) ... end)
--run event loop
events:run()
```
|
||
|---|---|---|
| .. | ||
| agent_status | ||
| avmd | ||
| call_block | ||
| conference_center | ||
| dialplan | ||
| event_notify | ||
| failure_handler | ||
| fax | ||
| hangup | ||
| is_local | ||
| missed_calls/resources/templates/en/us | ||
| provision | ||
| ring_groups | ||
| toll_allow | ||
| voicemail | ||
| xml_handler | ||