Don't see it? Ask!

Friday, September 26, 2008

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 relies 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 Linheimer). 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 Conditionsmodule 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:

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:

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


Continue reading...

Tuesday, September 23, 2008

Queue weights vs. Queue priorities

FreePBX version 2.5 seems to be coming along real nicely and hopefully will be out of beta any day minute now, with way over 500(!) bug fixes and closed tickets, and an elephant load of cool new features. A big tip of the hat to Philippe Lindheimer, the FreePBX projects leader, under who's leadership (and hard work) this great milestone has been achieved. The Chinese are fond of saying "An army of a thousand is easy to find, but, ah, how difficult to find a general." How true! Without Philippe's guidance and unique vision of the project, it would probably long be covered in moldy green with every release bumping the bug to feature ratio by 3:.001. Thank you Philippe for making FreePBX what it is!

Lets have a look at two new cool features in FreePBX 2.5: Queue weights and Queue priorities. We'll start with the Queue priorities module. Queue priorities essentially allows you to give a call a greater priority in a queue. Think of it as the First Class check-in counter - only your standing in the same line as the 'commoners'. Once you mark a caller with higher priority, their position in the queue is automatically promoted - so that their call gets answered quicker than the others. To illustrate: if Jack is waiting in a queue with priority 1 and Jill comes along at priority 10 - who do you think is going to be answered first? Being that Jill is the holder of a First Class ticket - she will be answered first even if Jack is holding for a longer time! Neat, eh? Now add Jake, holding 'only' a business class ticket - say with priority 5, where will he go? Being that he is the second highest priority he will be second in our example - after Jill (10) but before Jack (0).

Queue weights does something similar only in reverse. It gives the queue a priority (called a weight) versus the other queues. If that sounds confusing, then try this: imagine, back to our airport, that instead of all the people standing at one check-in counter there are three counters - one for first class, one for business class, and one for the rest of us. Unfortunately, all the people that usually man the counters ran off to the OTTS, and only Sally stayed on to check in the passengers. So now we have people waiting in three different lines and Sally needs to decide whom to check in first. As I'm sure you guessed, Sally will first check-in those waiting at the first class counter as they have the highest weight, or importance to Sally and her self centered, money hungry, step-on-the-little-guys enterprise).

Another application of call weights (and I bet this one will hit a bit closer to home): the small business. I'm talking about the (more or less) one man business where the sales guy is also the janitor, the CEO is also the secretary, and the technician is also the delivery man. And all three are one and the same guy. But in order to give the big company appearance, you set up a PBX with fancyshmancy stuff like ivr's and queues and music on hold. (Yes you! C'mon, don't look at me like that - you know that's what got the geek in you attracted to asterisk in the first place...). Anyway so your sales/management/technical/maintenance/logistic team (aka you) have all your phone(s) logged in to the different queues. Obviously its business (sales) before pleasure (nothing like pulling an allnighter trying to fiddle with that new linux app that you got off some guy on IRC, trying to impress an old client), and you want to receive the calls in the sales queue before those in the technical assistance queue. This is where call weights comes in to the picture: you can set the weight of the sales queue to be higher than that of the technical support queue, and, like the magic that asterisk is, callers in the sales queue will always come out ahead of the callers in the technical queue (you should of never logged in to that one to begin with anyway - its usually full of annoying clients who need help after trying to "fix" their system).

Truth is, in that last example, you could do exactly the same thing with queue priorities - give the people calling for sales a higher priority (vs. giving the queue a higher weight). But being the geek that you are, you want to impress your family and friends' clients by announcing their estimated hold time - and position in the queue. Now what happens if you have a caller that was already told that they are next in line and someone with a higher priority call comes in? You guessed it - grandma gets pushed to the back of line in favor of your basket-ball buddy! Granny will be kinda pissed when she hears that she is now number two in the queue. So you need to know you environment before deciding which strategies to take.

That's not to say that Queue Priorities doesn't have merits of its own. When that little mom and pop, garage based business grows up and becomes Google or HP (hey - you can do it!) and you have a large call center with different departments, there will often be a situation where after talking to someone in department X the caller will be transferred over to someone in department Y. But being that they already waited in the queue for dept. X its only fair that they shouldn't have to wait again. This is a very practical application of Queue Priorities: the guy in dept. X transfers the caller to a destination that sets their priority higher in the Y queue, so that they get answered right away, and don't have to wait again.

Two more points: you might be wondering what happens when two or more callers enter a queue at a higher priority? All the people at a given priority get treated just like people usually get treated in a queue, first come first server (fifo), so that all the people at, say, priority 10 will have their calls answered (again fifo), and then people at priority 5, and so on. Last but not least, we previously mentioned the lines at the airport. In the UK people call those a queue (as in "I'm standing in the queue"). But you already knew that.



Continue reading...