Time Groups & Time Conditions

FreePBX 2.5 breaks down Time Conditions in to two separate modules: Time Groups and Time Conditions. The reason? To confuse you! Nay, we wouldn’t do that. But in case we did, this should set the record straight.

First, lets have a look at the old way of doing things: For illustrative purposes, we’ll talk about the CEO of a multi billion dollar corporation. Obviously, as the most powerful and best paid person in the company, he does the least amount of work, and when he does, he tires quickly. Fortunately for him, they built his office with tons of amenities – including a power napping station where he takes a daily afternoon nap. There is just one thing they forgot to do: automatically turn off his phone during that period. This is the precise purpose of time conditions.
Until now, a setup like this required a lot of work. First, you would set a time condition for Monday morning from 10:00 am until 12:30pm. You would then set the "Destination if time matches" as your extensions. As the "Destination if time does not match", you would put in the next time condition – 2:00pm to 3:30pm (wish those were your working hours, eh?). But wait – you didn’t create that time condition yet. So you’ll need to save this one, then create the next one. If your still following, you’ll realize that you will run in to this problem again – the ‘condition failed’ destination is not yet created. Or in other words, you need to work backwards, starting from Thursday afternoon, and working up the week from there.

By the time your done, you should have at least 10 different time conditions – just for this one extension. Now imagine if there are 4 other people in the company on the same schedule – were pushing fifty time conditions – for just five extensions! And that not including the usual company widetime conditions – including various work schedule’s, open hours, holidays, etc.

Here to save the day is naftali5’s Abstracted Time Groups and updated Time Conditions, (as implemented by FreePBX project lead – Philippe Lindheimer). In a nut shell, what this upgrade does is it separates the time condition from the destinationallowing for the same ‘set’ of conditions to be ‘reused’ many times. Back to our example. In order to accommodate our tired CEO, we would click on the Time Groups module (assuming that the Time Conditions module is installed) and create a new time group by clicking add a new time group. Enter a description, such as "executive working hours". Now start by creating the first time group (10:00am-12:30 pm, mon-thu) and click Submit. Now pick the "Executive working hours" from the time groups menu, and add the second time group (2:00pm – 3:30pm mon-thu), and click submit. When your done it should look like this:

Time Group

 

Now, click on the Time Condition module. Add a time condition called "CEO’s working hours" and select "Executive working hours" from the time groups drop-down list. Now, simply select the CEO’s extension as the "Destination if time matches" and his voicemail as the "Destination if time does not match" (or send the call wherever you would like – depending on your needs). Bravo! Can it be simpler? If you need to set the same time conditions for other exec’s, just create a new time condition – and reuse the time group as many times as you’d like! The time condition should look something like this:

Time Condition

One more thing:


This solution beautifully and simply addresses our needs and allows for reusing the time groups while keeping the time condition separate. There is just one hiccup: said CEO does not like to be disturbed while he smokes his cigar’s and sips Chardonnay. He needs a simple way to be able to manually override the time conditions and send all his calls to voice mail. That’s what the "Day/Night Mode Association" option is for (assuming you have the day/night module installed). You can set a Day/Night Control with a "Night" destination of the CEO’s voicemail. When ever he needs to smoke his cigars, he can just dial his Day/Night control code – and all his call will be routed to his voicemail.

A more down-to-earth use of Day/Night mode association: just because you set your businesses time conditions, doesn’t meant that bad weather wont force you to close early. Use a Day/Night Control to set your business to go in to night mode early. Or have your receptionist do it – without needing to touch your delicate FreePBX gui!

The use of Day/Night controls are endless – and can introduce some form of dynamic call-flow control. What is your best/wildest implementation of Time Groups/Conditions? Lets hear about it in the comments!

Moshe Brevda, FreePBX Development Team
lazytt – FreePBX forums
hi365 – IRC

Leave a Reply