* Add. BLF indication for call forward.
To display general status of CallForward use blf like `forward+<extension>`
To display status for specific phone number use blf like `forward+<extension>/<number>`
* Fix. Escape variable in regex expression.
* Fix. Sync DND and CF blf.
* Add. `blf_subscribe` service which can handle all custom subscriptions.
To run for specific protocol it possible run as `luarun blf_subscribe.lua <PROTO>`
This commit allows create call flow extension with some feature code (e.g. `*401`)
Then on the phone you can configure BLF like `flow+*401` and use `call_flow_subscribe` to
track current status of this call flow. BLF like `*401` will also works but only if
use `call_flow_monitor` script.
Also it is possible dial `flow+*401` as well as `*401` to toggle call flow state.
* 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`
* Change. Pass pid file first. Because there really no need pass timeout.
Add. `fsc` script to be able shutdown MWI and Call Flow subscribe services.
* Change. rename `fsc` to `service`.
* Change. Use `stop` command instead of `shutdown`
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()
```
* Add. Handler for SUBSCRIBE method for call flow application.
Usage:
1. Run form fs_cli `luarun call_flow_subscribe`
2. Create new call flow extension and set feature code to `flow+<EXTENSION>`(e.g. `flow+401`).
3. Set on the phone BLF key to `flow+401`
This code based on `mod_valet_parking`.
* Add. prevent running 2 copy of script.
Remove some unused vars and simplify implementation.
* Fix. Use correct protocol for send event.
* Fix. Do escape SQL arguments
* Fix. escape `+` sign in call flow extension.