We have disabled our voicemail for the switchboard during business hours. The voicemail is switched on during non-business hours with an unavailable message. To make it works we created a time condition with a time group.
I’d like to ask if it is possible with an automated way to disable the time condition when someone is recording the temporary message for the switchboard number. The idea is when a temporary message is on the voicemail should be activated regardless of business hours or non-business hours. As soon as the temporary message is deleted, the time condition should kick in again.
I thought to create another time condition that comes first. However, for destination match, there are no criteria for voicemail temporary messages.
Fun exercise for this morning. The Dynamic Routes module’s primary purpose is to branch call flow based on a dynamic condition. We just need to figure out what changes when there is a temp message set for a mailbox.
When you have a temp greeting enabled for a mailbox, the file temp.wav will exist in the voicemail file structure. You need to test for the existence of this file. The following Asterisk expression will return true if mailbox 6006 is set with a temporary message, otherwise it returns null:
If you use that as an Asterisk Variable condition in a dynroute, update it for the vm box in question, then you can set the default destination to where the normal operation, and a match condition set to true when it’s enabled.
without the ! as the prefix to the dynamic route and it also works. Great
Looks like all is fine - I want to test it on Monday when the time condition is active and the voicemail is switched off. But I guess the dynamic route always comes first.
It doesn’t return a ‘true’, it returns a string with the value of “true” which is not the same thing , if you want the obverse, i.e. a string of “false” you would need to add the || (or) condition which would be returned if the && (and) failed on the ‘test’ ( here within the [[…]] construct )
I think you could also have an unconditional " ; echo -n $?", although the truth sense may be inverted, and I don’t know if FreePBX can cope with quoting the ;.
without the echo statement, it WOULD return a boolean but you need to either assign to a variable for further process or do the asterisk ?here,. . :there,.. (and,or) dialplan test construct immediately inline, if you omit either ‘? or :’ then the dialplan will just ‘continue’ without branching for that test