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`