Commit Graph

134 Commits

Author SHA1 Message Date
FusionPBX 66a5d9e92c Update mkdir.lua 2018-05-30 10:54:01 -06:00
konradSC 8abe5387ae Use Freeswitch for mkdir (#3049)
This change reduces  the strain on the system by running the OS command through Freeswitch rather than directly from Lua. When running directly from Lua it causes RTP jitter in a high capacity system.
2018-05-04 13:32:36 -06:00
Alexey Melnichuk 10b3321042 Change. library loads only needed files. (#2987) 2018-02-11 08:56:01 -07:00
FusionPBX add7004b64 Update find_file.lua 2018-02-10 15:32:36 -07:00
FusionPBX 67b980fa71 Create basename.lua 2018-02-10 13:42:02 -07:00
FusionPBX b5b3edc50a Update find_file.lua 2018-02-10 13:40:45 -07:00
FusionPBX 778f470aef Create is_absolute_path.lua 2018-02-10 13:39:54 -07:00
FusionPBX db531692be Create find_file.lua 2018-02-10 13:38:17 -07:00
FusionPBX e29ea61545 Create play_file.lua 2018-02-10 13:35:07 -07:00
Alexey Melnichuk fab5b5a970 Fix. Use preloaded dialplan more then once. (#2986) 2018-02-10 13:27:07 -07:00
FusionPBX 2cc8cf925d Update send_mail.lua 2018-02-06 18:15:05 -07:00
Mafoo cdd7c2bd97 Enhance - send_mail.lua (#2978)
use the to address when email:smtp_from:var is empty
don't use email:smtp_from_name:var when empty
2018-02-06 17:45:53 -07:00
Mafoo 1c580ce7a1 BugFix - send_mail.lua (#2977)
use correct header to retrieve call_uuid
2018-02-06 17:28:00 -07:00
FusionPBX b9394a2707 Update send_mail.lua
Remove this as it caused a nil error app/hangup/index.lua.
2018-02-05 23:47:36 -07:00
FusionPBX 131f9eea03 Update send_mail.lua
Revert the previous commit as it broke send_email.lua.
2018-02-05 22:23:18 -07:00
FusionPBX f076a8133b Update send_mail.lua
Fix a spelling mistake.
2018-02-02 19:35:02 -07:00
Mafoo 2471fa7844 BugFix - LUA send_mail() (#2975)
take call_uuid from the correct header
use smtp_from_name as part of the from address
2018-02-02 19:33:43 -07:00
Connor Strandt 3f9c9945a7 Formatting and sendmail to use smtp_from fix (#2973)
* Fixed formatting.
* Sendmail to use smtp_from variable

Changed sendmail to use smtp_from as the from address to keep from being blocked by spf check during spam filtering on recieving end.
2018-02-02 01:02:57 -07:00
FusionPBX 57b914d306 Update cache.lua
Make the cache.lua more robust in case of missing key or value.
2018-01-19 18:39:05 -07:00
sergey-mz d8a12163aa Fix spelling (#2950)
* ODBC DSN detection

* Merge remote-tracking branch 'upstream/master'

* Merge remote-tracking branch 'upstream/master'

* Spelling errors
2018-01-05 13:04:26 -07:00
Alexey Melnichuk a7de7f0baa Fix. Use external numbers in ring groups with global outbound routes (#2937) 2017-11-29 00:21:21 -07:00
Alexey Melnichuk 679d4e1fb5 Add. Use `route_to_bridge` module to build routes for ring groups. (#2907)
* Add. Use `route_to_bridge` module to build routes fro ring groups.

This commit has several improvements
1. Select only needed fields. (do not select quite big XML text strings)
2. Filter routes also by context name
3. Filter dialplans also by hostname
4. Handle conditions based not only `destination_number`
5. Handle `break` and `continue` attributes for extensions
6. Escape vars inside dial-string
7. Add log messages similar as FS dialplan do

* Add. `route_to_bridge` set inline vars so it possible use then in next conditions.
Add. `route_to_bridge` can execute basic api commands from allowed lists.
`route_to_bridge` expand all known vars. If var is unknown then it pass as is.
Fix. `export nolocal:` action.

* Fix. Short variable names

* Add. some comments

* Fix. Do not try execute empty string

This produce error messages `[ERR] switch_cpp.cpp:759 No application specified`

* Fix. Export nolocal values.
2017-11-17 07:15:47 -07:00
Alexey Melnichuk 41083c7a8c Fix. crash when using EventCounsumer.ievents iterator. (#2865)
Problem code is
``` Lua
for event in ievents{'SHUTDOWN','CUSTOM::event'} do
end
```
2017-10-06 12:36:23 -06:00
Alexey Melnichuk f308e2a30e Fix. Cache class. (#2755)
* Fix. Cache class.

 * `send_event` raise error so `Cache.del` did not remove key or send any event
 * use `memcache` method by default even if `cache` table does not defined in config
 * `Cache.get` did not return any data when use `memcache` method
 * `Cache.get` did not close file. (Its should not be a big problem because GC should do it by self).
 * `Cache.get` can returns some undefined global value. (if method is `file` and file not exists then method returns global `result` value)
 * `Cache.get` does not need check for file existence
 * Value escaping does not needed for `file` method
 * Needed different key escaping for `memcache` and `file` methods
 * Update self test

* Change. Use random names for temp files.
2017-07-26 09:40:53 -06:00
FusionPBX 4cba425e11 Update cache.lua 2017-07-22 15:18:20 -06:00
FusionPBX 5ddedc8afa Update cache.lua 2017-07-22 15:17:11 -06:00
FusionPBX 1804dcc344 Update cache.lua 2017-07-22 12:38:45 -06:00
FusionPBX cf0fbb0f93 Update cache.lua 2017-07-22 01:09:39 -06:00
FusionPBX 942293debe Update lazy_settings.lua 2017-07-22 00:38:25 -06:00
Alexey Melnichuk c36be184b8 Fix. Stack overflow when calls base actor. (#2706) 2017-06-22 00:14:28 -06:00
Alexey Melnichuk 6fc6e231c8 Add. BLF indication for call forward. (#2664)
* 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>`
2017-06-20 09:23:23 -06:00
Alexey Melnichuk a7d58e14c7 Add. Support DND feature via BLF key (#2606) 2017-05-29 09:50:20 -06:00
Alexey Melnichuk d390270b2e Fix. Improve parameters patterns. (#2218)
E.g. now it handle queries like
```Lua
local sql = "select :J::text as value"
print(dbh:first_value(sql, {J='hello'}))
```
2017-04-22 10:18:10 -06:00
Alexey Melnichuk debfcbbc5b Fix. Escape strings in regex api (#2523) 2017-04-20 07:48:49 -06:00
FusionPBX 02a505e4d2 Update route_to_bridge.lua 2016-12-23 02:16:22 -07:00
FusionPBX b9b3fd6494 Update route_to_bridge.lua 2016-12-23 01:52:19 -07:00
Alexey Melnichuk 915c5dea48 Fix. Fetch correct arrays from settings. (#2162)
* 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.
2016-11-23 03:50:00 -07:00
Alexey Melnichuk 085b6e9419 Fix. Use local `err` variable in `apply_param` (#2152) 2016-11-22 16:48:54 -07:00
Alexey Melnichuk b347917700 Add. Use params in send_mail.lua (#2142) 2016-11-22 11:10:18 -07:00
Alexey Melnichuk a6ac29bd49 Add. Use params in lazy_settings.lua (#2118) 2016-11-21 13:51:39 -07:00
Alexey Melnichuk 3baa517b1d Add. Use params in route_to_bridge.lua (#2119) 2016-11-21 13:51:21 -07:00
Alexey Melnichuk e3e598ce82 Add. Extend database API to support parameters. (#2086) 2016-11-17 11:41:16 -07:00
Chris Black e7fae7587e add built in ability for microsoft bing speech to text (#1960)
* 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
2016-11-03 16:11:21 -06:00
Alexey Melnichuk 4176144da4 Add. attr_xfer analog based on conference. (#1629)
* 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.
2016-08-30 01:10:08 -06:00
DigiDaz 57d2d955f3 Fixed scripts to get multiserver memcache working (#1795) 2016-08-04 11:40:36 -06:00
Alexey Melnichuk 868c7dd153 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`
2016-08-02 14:00:49 -06:00
Alexey Melnichuk 91ce171472 Simplify `is_uuid` function. (#1781)
* 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
2016-07-28 16:49:36 -06:00
Alexey Melnichuk daa3d72014 Add. Support service stop command for odbc_pool. (#1782) 2016-07-28 08:16:54 -06:00
Mafoo e3a3bbcd9f BugFix-add missing default ringback to lua (#1682)
add processing of when ringback is set to default_ringback and correctly
set it to the current value of the globalvar for ringback
2016-07-27 20:06:41 -06:00
Alexey Melnichuk d47151ba8d Add `service` script and make timout optional for EventConsumer ctor (#1775)
* 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`
2016-07-26 11:58:37 -06:00