* 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.
On my system mod_memcached returns `-ERR SOME ERRORS WERE REPORTED` when
memcached service not available. And sofia.conf.lua does not handle this case
and interpret this response as valid one.
Using `cache` class allows handle such errors. Also this class handle all
escaping operation which makes code more clear.
Had an issue with malformed email confirmation where the number_dialed was showing up with a bunch of random repeating strings after it. This resolved it for me. Also fixed a grammar error.
* Merge (#4)
* Added variables to disable call waiting and t.38 faxing
* HT702 config file variables: grandstream_disable_call_waiting, grandstream_disable_fax_t38
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update app_config.php
* Corrected bug with expansion board and call park value. Was 19, should be 16.
* MAC detection for some Grandstream phones (#2486)
Some GS models send the Mac address in the user agent
* Add/Update German and Austrian translations (#2483)
Updates to the following apps:
call_broadcast
call_flows
devices
dialplan_inbound
dialplan_outbound
edit
emails
exec
extensions
fax
fifo
fifo_list
gateways
ivr_menus
* Update destinations.php
* Update xml_cdr_inc.php
* Update status_registrations.php
* Update y000000000028.cfg
* Update y000000000066.cfg
* Update y000000000035.cfg
* Update y000000000065.cfg
* Update y000000000051.cfg
* Update y000000000023.cfg
* Update y000000000025.cfg
* Update y000000000029.cfg
* Update y000000000036.cfg
* Update y000000000038.cfg
* Update y000000000032.cfg
* Update y000000000046.cfg
* Update y000000000000.cfg
* Update y000000000054.cfg
* Update y000000000045.cfg
* Update y000000000069.cfg
* Update y000000000004.cfg
* Update y000000000044.cfg
* Update y000000000044.cfg
* Update y000000000005.cfg
* Update y000000000052.cfg
* Update y000000000007.cfg
* Update y000000000037.cfg
* BugFix for VM Transcription (#2491)
Records as MP3 and skips transcription steps if a user has transcription set to false.
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Yet another ip phone reporting MAC in the UserAgent (#2492)
* Update app_config.php
Begin adding uuid's for key functions.
* Update app_config.php
* Update app_config.php
* Update app_config.php
* Update app_config.php
* Update app_config.php
* Update app_config.php
* Create 560_extension_queue.xml
* Update y000000000037.cfg
* Update y000000000007.cfg
* Update app_config.php
* Update y000000000052.cfg
* Update y000000000028.cfg
* Update y000000000005.cfg
* Update y000000000044.cfg
* Update y000000000044.cfg
* Update y000000000004.cfg
* Update y000000000069.cfg
* Update y000000000045.cfg
* Update y000000000000.cfg
* Update y000000000046.cfg
* Update y000000000032.cfg
* Update y000000000038.cfg
* Update y000000000054.cfg
* Update y000000000036.cfg
* Update y000000000029.cfg
* Update y000000000066.cfg
* Update y000000000035.cfg
* Update y000000000065.cfg
* Update y000000000051.cfg
* Update y000000000023.cfg
* Update y000000000025.cfg
* Update app_config.php
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update app_config.php
* Fix. Add new sip profile setting. (#2500)
* BugFix [master] system information git (#2499)
fix for if the .git folder is present but corrupt
* Fix. Redirect back to correct profile after delete setting. (#2501)
Fix. Add setting (seems need also set sip_profile_uuid)
Change. Order settings by name when output.
* Restore Button + Audiocodes preliminary support (#2502)
* Audiocodes phone support + restore default for vendors
* Restore button
* Restore script
* Update device_vendors.php
* Some FR & ES translation fixes (#2503)
* Update app_config.php
* Update app_config.php
* Create {$mac}.cfg
* Create directory.xml
* Create favorite_setting.xml
* Create y000000000025.cfg
* Fix. Add extension with non numeric extension number. (#2508)
* Update ring_group_edit.php
* Update call_edit.php
* Create 080_default_caller_id
* Update 080_default_caller_id
* Rename 080_default_caller_id to 080_default_caller_id.xml
* Fix. Create needed number of extensions (#2509)
* Update dialplan_edit.php
* Update switch.php
* Update index.php
* Update switch.php
* Update voicemail_edit.php
* Update app_config.php (#2515)
Add the necessary permissions in order to use the database save function (fusion 4.3) when coding for voicemail option adds/deletes/updates.
I realize these voicemail permissions overall will probably get cleaned up even more once the whole app is updated to use the database function, but this is a stop gap measure. I am working on adding voicemail options to the Bulk Account Settings app and I'm stuck without these permissions. The function is kicking a out 403 Forbidden.
* Update app_config.php
* Really use configured transcribe_language for transcription (#2513)
* Fix renaming domains (#2512)
* Make presence for conferences work out of the box (#2514)
Use '@' instead of '-' for separating conference name and domain, which
is what FreeSWITCH mod_conference uses.
* Add. Speed dial respects contacts user. (#2249)
* Add. Speed dial respects contacts user.
One user can not use speed dial numbers from contacts
associated with another user
* Make SQL query more efficient
* Add. Support find contacts by user groups as well
If contact has set any `user` or `group` then only this users can use speed dial numbers
in other case speed dial numbers are global for domain.
* Fixup for renaming domains (#2517)
The previous fix was incomplete, this one should do it.
* Create app_defaults.php
* Update page.lua
* CC Key Support for Call Center (#2518)
* Exit Keys support
* Multilanguage support
* CC Key Support
* Update call_center.php
* Update code to iterate over numbers. (#1727)
* Update code to iterate over numbers.
This code fixes some problems
* range like `009-010` current code produce numbers `009` and `0010`
* range like `200-100` now raise error so it will be easy to debug
* range like `010-20` now generate error.
* `destination` is string so condition `destination == tonumber(sip_from_user)` is always false so change it `destination == sip_from_user`
* Fix. handle ranges like `100-100`
* Update index.lua
* Update start_recording.lua
* Merge (#4)
* Added variables to disable call waiting and t.38 faxing
* HT702 config file variables: grandstream_disable_call_waiting, grandstream_disable_fax_t38
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update {$mac}.cfg
* Update app_config.php
* Corrected bug with expansion board and call park value. Was 19, should be 16.
* MAC detection for some Grandstream phones (#2486)
Some GS models send the Mac address in the user agent
* Add/Update German and Austrian translations (#2483)
Updates to the following apps:
call_broadcast
call_flows
devices
dialplan_inbound
dialplan_outbound
edit
emails
exec
extensions
fax
fifo
fifo_list
gateways
ivr_menus
* Update destinations.php
* Update xml_cdr_inc.php
* Update status_registrations.php
* Update y000000000028.cfg
* Update y000000000066.cfg
* Update y000000000035.cfg
* Update y000000000065.cfg
* Update y000000000051.cfg
* Update y000000000023.cfg
* Update y000000000025.cfg
* Update y000000000029.cfg
* Update y000000000036.cfg
* Update y000000000038.cfg
* Update y000000000032.cfg
* Update y000000000046.cfg
* Update y000000000000.cfg
* Update y000000000054.cfg
* Update y000000000045.cfg
* Update y000000000069.cfg
* Update y000000000004.cfg
* Update y000000000044.cfg
* Update y000000000044.cfg
* Update y000000000005.cfg
* Update y000000000052.cfg
* Update y000000000007.cfg
* Update y000000000037.cfg
* BugFix for VM Transcription (#2491)
Records as MP3 and skips transcription steps if a user has transcription set to false.
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Yet another ip phone reporting MAC in the UserAgent (#2492)
* Update app_config.php
Begin adding uuid's for key functions.
* Update app_config.php
* Update app_config.php
* Update app_config.php
* Update app_config.php
* Update app_config.php
* Update app_config.php
* Create 560_extension_queue.xml
* Update y000000000037.cfg
* Update y000000000007.cfg
* Update app_config.php
* Update y000000000052.cfg
* Update y000000000028.cfg
* Update y000000000005.cfg
* Update y000000000044.cfg
* Update y000000000044.cfg
* Update y000000000004.cfg
* Update y000000000069.cfg
* Update y000000000045.cfg
* Update y000000000000.cfg
* Update y000000000046.cfg
* Update y000000000032.cfg
* Update y000000000038.cfg
* Update y000000000054.cfg
* Update y000000000036.cfg
* Update y000000000029.cfg
* Update y000000000066.cfg
* Update y000000000035.cfg
* Update y000000000065.cfg
* Update y000000000051.cfg
* Update y000000000023.cfg
* Update y000000000025.cfg
* Update app_config.php
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update {$mac}.xml
* Update app_config.php
* Fix. Add new sip profile setting. (#2500)
* BugFix [master] system information git (#2499)
fix for if the .git folder is present but corrupt
* Fix. Redirect back to correct profile after delete setting. (#2501)
Fix. Add setting (seems need also set sip_profile_uuid)
Change. Order settings by name when output.
* Restore Button + Audiocodes preliminary support (#2502)
* Audiocodes phone support + restore default for vendors
* Restore button
* Restore script
* Update device_vendors.php
* Some FR & ES translation fixes (#2503)
* Update app_config.php
* Update app_config.php
* Create {$mac}.cfg
* Create directory.xml
* Create favorite_setting.xml
* Create y000000000025.cfg
* Fix. Add extension with non numeric extension number. (#2508)
* Update ring_group_edit.php
* Update call_edit.php
* Create 080_default_caller_id
* Update 080_default_caller_id
* Rename 080_default_caller_id to 080_default_caller_id.xml
* Fix. Create needed number of extensions (#2509)
* Update dialplan_edit.php
* Update switch.php
* Update index.php
* Update switch.php
* Update voicemail_edit.php
* Update app_config.php (#2515)
Add the necessary permissions in order to use the database save function (fusion 4.3) when coding for voicemail option adds/deletes/updates.
I realize these voicemail permissions overall will probably get cleaned up even more once the whole app is updated to use the database function, but this is a stop gap measure. I am working on adding voicemail options to the Bulk Account Settings app and I'm stuck without these permissions. The function is kicking a out 403 Forbidden.
* Update app_config.php
* Really use configured transcribe_language for transcription (#2513)
* Fix renaming domains (#2512)
* Make presence for conferences work out of the box (#2514)
Use '@' instead of '-' for separating conference name and domain, which
is what FreeSWITCH mod_conference uses.
* Add. Speed dial respects contacts user. (#2249)
* Add. Speed dial respects contacts user.
One user can not use speed dial numbers from contacts
associated with another user
* Make SQL query more efficient
* Add. Support find contacts by user groups as well
If contact has set any `user` or `group` then only this users can use speed dial numbers
in other case speed dial numbers are global for domain.
* Fixup for renaming domains (#2517)
The previous fix was incomplete, this one should do it.
* Create app_defaults.php
* Update page.lua
* CC Key Support for Call Center (#2518)
* Exit Keys support
* Multilanguage support
* CC Key Support
* Update call_center.php
* Update code to iterate over numbers. (#1727)
* Update code to iterate over numbers.
This code fixes some problems
* range like `009-010` current code produce numbers `009` and `0010`
* range like `200-100` now raise error so it will be easy to debug
* range like `010-20` now generate error.
* `destination` is string so condition `destination == tonumber(sip_from_user)` is always false so change it `destination == sip_from_user`
* Fix. handle ranges like `100-100`
* Update app_config.php
* Update app_languages.php
* Update ring_group_edit.php
* Update index.lua
* Update code to iterate over numbers.
This code fixes some problems
* range like `009-010` current code produce numbers `009` and `0010`
* range like `200-100` now raise error so it will be easy to debug
* range like `010-20` now generate error.
* `destination` is string so condition `destination == tonumber(sip_from_user)` is always false so change it `destination == sip_from_user`
* Fix. handle ranges like `100-100`
* Add. Speed dial respects contacts user.
One user can not use speed dial numbers from contacts
associated with another user
* Make SQL query more efficient
* Add. Support find contacts by user groups as well
If contact has set any `user` or `group` then only this users can use speed dial numbers
in other case speed dial numbers are global for domain.
I really don't know if this is an IP phone issue (tested on grandstream) or a new behavior on FreeSWITCH, but in order to add the prefix to the caller id (name or number) correctly, you need to export instead of set.
* Update macro.lua
Add additional macros for the tutorial.
* Create tutorial.lua
* Update index.lua
* Update record_greeting.lua
Add menu variable to route back to appropriate place in the flow.
* Update record_menu.lua
Add menu variable to accommodate the tutorial.
* Update change_password.lua
Add menu variable to accommodate the tutorial.
* Update record_name.lua
Add menu variable to accommodate the tutorial.
* Update voicemail_edit.php
Add option to play tutorial on next login.
* Update app_languages.php
* Update app_config.php
Add voicemail_tutorial to database.
* Update extension_edit.php
Set "voicemail_tutorial" to true for new extensions.
Please do further testing/review and give comments and suggest cleanup, etc.
This bug is only tripped if all of the following are true:
a) fax send fails
b) email notification of fax failure also fails
c) Other?
how to test
- have a 100% working fax to email setup.
- Change Advanced->defaults->email and set the port to be something invalid.
- e.g. smtp port 9999 is invalid
- send a test fax to something without a fax
- e.g. I just faxed my own DID which does NOT have fax answering
- each time the phone rings answer...wait 5 seconds, and then hang up
- note: it will retry sending the fax 5 times so repeat the above.
- on the last try it will give up, and try to send the failure email
- the email will fail (bad port) and then it will insert the failed email into v_emails
- the insert will fail and nothing in v_emails
Error was caused by trying to insert '' into the domain_uuid field.
'' is invalid in a uuid field, but null is okay.
The null is caused by no x-headers being passed. So these two fields end up null:
$headers["X-FusionPBX-Domain-UUID"]
$headers["X-FusionPBX-Email-Type"]
Ignoring unset/uninitialized variables hides bugs.
Fix: feed the X-Header in the calling lua code.
Requires that you have fusionpbx-apps/sms
Doesn’t impact anything if you don’t have it. Must be enabled with
default_setting voicemail_to_sms
Everything is disabled by default and the fields in voicemail_edit.php
are hidden by default.
* Fix. Fetch correct arrays from settings.
Add. Use params in `settings.lua`
* Fix. array from domain settings overwrite entire array from default settings instead of appends it.
When saving Caller ID numbers which are in E-164 format these may include a '/' prefix used to escape '+'. This causes the '/' to be saved with the number which prevents the call from being returned.
The above fixes the issue by removing '/' prefix from the start of the Caller ID number before saving the voicemail message.
* add built in ability for microsoft bing speech to text
* move json.lua to lower case and more error checking in record_message
* Replaced Creative Commons json.lua with lunajson.lua which is MIT license
https://github.com/grafi-tt/lunajson/blob/master/LICENSE
Expected result: The person at extension XXX is unavailable ...
Actual result: The person at is unavailable...
i.e. it doesn't say the extension number.
bug: trying to access local variable voicemail_greet_id outside it's scope...so it doesn't exist and you get this in the logs:
2016-09-18 12:32:54.615249 [ERR] switch_cpp.cpp:977 Error! invalid args.
Fix moves local variable creation outside the inner "if" so it's available for the later table.insert
Moved the UPDATE sip request to the end as it was sending the UPDATE request sometimes before the ACK had been received to the 200OK. This was sometimes causing it to fail.
Also removed a couple of commented out lines.
We've had instances where special characters (other than +) are used in the caller_id_number field which prevents these calls from being detected using the call_block feature. We've resolved this by updating fusionpbx/resources/install/scripts/app/call_block/index.lua line 49 to match only numbers rather than using a gsub replace.
* Add. attr_xfer analog based on conference.
Control DTMF sequence
`*0` transfer `self` to `enter number` state and `peer` leg to conference room
`##` transfer `self` to `enter number` state and hangup `peer` leg
`*#` transfer `self` to conference room and hangup `peer` leg
* Remove spaces.
* Add. Commented action to ring group.
* Remove unsed variable
* Fix cases where time condition are lost
When processing a new condition statement and condition_tag_status == "open",
then there has been a previous condition statement that is in one of three
possible states:
(1) a previous condition of type default has been saved into the
'condition' string and will need to be output as XML with either '>' or '/>'
(2) one or more time conditions have been saved into the
'condition_attribute' string. More time conditions may be added.
After the last time condition it will need to be output as XML with either '>' or '/>'
(3) a previous <condition ....> start tag has already been output as XML
and needs to be closed with a </condition> statement.
The change here checks for all three above situations at the places where
pending condition statements need to be finalized.
Note that when processing condition new statements and we are finalizing
a previous time condition, the XML statement uses the 'condition_break'
value from the previous loop, therefore setting condition_break for the
new condition must be after previous conditions are finalized.
At the start of each new extension, initialize 'condition' and
'condition_attribute'.
* Remove unused variables
* Indent one block to match surrounding code at same level
* Prevent two dialplans uuids being merged into single extension
If a dialplan manager entry ended with an action statement NOT inside
a condition, the generated XML would combine this dialplan uuid with the next
uuid by not closing and reopening a new extension. This change ensures
each dialplan uuid is enclosed in it own <extension></extension>.
Check to see if the number dialed matches an extension if it does then transfer to the extension if it doesn't then transfer the call back to the IVR Menu.
use table.concat as a workaround to spaces in filesames
alternative is adjust all destiantions to quote filenames, but would
require app_defaults catch to fix all exisiting written destinations.
* Add. `force_ping` option for extension
This option force FS send SIP OPTIONS message to
detect if this reged device still available.
* Update language file.
* 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`
* Simplify `is_uuid` function.
Also because it returns now value itself it possible write
```Lua
my_uuid = is_uuid(value1) or is_uuid(value2)
```
* Change. Ensure `is_uuid` returns only boolean value
* 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`
When handling phrases get the specific phrase instead of all of them. Remove the code that tried to build the XML from the file system. Replace it with a 'not found' response so that FreeSWITCH will check the filesystem for the XML of the phrase that was not found.
* Renamed template variable account to voicemail_id and adjusted all
templates
* Added ${voicemail_description}
* Added ${voicemail_name_formatted} (will render the voicemail identifier in accordance with Default/Domain Settings > Voicemail > display_domain_name)
* Updated templates to be consistent spacing
* Updated templates to include use of ${voicemail_name_formatted}
* Changed ${account} to be voicemail_name_formatted instead of id
This corrects the issue in #1760, where the default voicemail message was not being played and instead skipped directly to recording (start recording tone).
Voicemail greeting will not play after being transferred from IVR #1749. Replace session:streamFile( with session:execute("playback", fixes this problem.
* Add. Support `onInterval` method to EventConsumer class
Usage
```Lua
-- execute action each 30 sec
events:onInterval(30*1000, function() end)
-- execute action once after 5 min
events:onIntervalOnce(5*60*1000, function() end)
```
* Fix. Remove timers
* Fix. Reset timer before callback
It allows stop timer inside callback.
Also it produce more accurate interval invocation
if callback take quite a long time.
E.g. Interval = 10 sec and callback took 5 sec then
if we reset timer after this callback then gap between
invocation will be 15 sec.
* Add. Timers now have TimeEvent class type.
Add. `reset` method to IntervalTimer class.
```Lua
events:onIntervalOnce(1000, function(self, timer)
-- timer has type TimeEvent
-- restart timer so it will be invoke again
timer:restart()
-- or reset new interval
-- timer:reset(5000)
end)
```
* Fix. Typo in variable name
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.
Problem that `mod_commands` may load after than `mod_callcenter` and there no function `global_getvar`
So current code just create database with name `INVALID COMMAND!.db`.
Note.
* `inbound` is call to some extension
* `outbound` is call from some extension to external number.
Currently there no way to find call from extension to extension as `outbound`
To configure use `database.backend` option
It can be a string value like `database.backend = 'native'`.
So it will always use same backend.
Or it can be a table value like
```Lua
database.backend = {
main = 'native';
base64 = '';
}
```
Role `database.backend.main` is predefined and it equal to `native` if not set.
If there no role when Database class creates or role unknown role `main` is used
```Lua
dbh = Database.new('system') -- uses role `main`
dbh = Database.new('system', 'main') -- same as previews
dbh = Database.new('system', 'base64') -- uses role `base64`
dbh = Database.new('system', 'test') -- uses role `main`
```
```Lua
local Database = require 'resources.functions.database'
-- Default backend configured via xml_handler.db_backend = 'native'
dbh = Database.new("system")
-- To use other backends you can use
dbh = Database.backend.luasql("system")
```