Welcome to The Technical Corner, a roughly bi-weekly Series of Articles on FreePBX. These article come out in the blog along with other News and Announcements that are communicated regularly. Below you can see the book pages that are consolidated from this series presented alphabetically.
In addition, to the regular articles there are related tid-bits that are further included in the related content table that follows.
We hope you find these articles useful.
One of the most common issues that people come up against is that they've rolled out one FreePBX machine, and now they want another, somewhere else. And to make it just that little bit harder, they want to link them together. At first, this can be a bit daunting, but it's not - when you know how.
One of the first things you need to know, is that there are two 'entry points' in the freePBX dialplan. They are 'from-trunk' and 'from-internal'. When a call is sent into the 'from-trunk' context, it is routed through the 'DID' logic, and treated as if it's an external call. A call sent into the 'from-internal' context is treated as if it was dialed from a normal SIP, IAX or Zap extension of your PABX.
Normally, when you're linking two freePBX machines together, you want the users pretty much be unaware that there are two machines, so you need a dialplan set up so that calls are treated that way. This means you need to have a little bit of forward planning if you don't want your outbound routes and trunk setup to be pretty messy. As an example, let's set up a couple of pretend freePBX machine here:
freePBX Machine 'office1'
deny=all
allow=g729&alaw
type=friend
host=office2
qualify=yes
context=from-internaldeny=all
allow=g729&alaw
type=friend
host=office1
qualify=yes
context=from-internal
Making Follow Me and
VmX Locater Work Together
These two powerful features are designed to work together so you can have the ultimate solution for your personal needs. Instead of choosing one or the other, why not have the caller choose what they want: leave voicemail now, or try to locate you?
Let’s describe some behaviors that we would like to achieve and then go about showing you how easy it is to configure this scenario.
Desired Call Flow
Let’s walk through the steps required to enable this very powerful and easy to configure setup. First we configure the user’s unavailable and busy greetings in voicemail. Next we enable VmX Locater for this user and create their Follow Me feature. Lastly, we configure our user’s VmX Locater and Follow Me settings from the User Portal (ARI).
Create the Messages
Let’s begin. Here are a couple of examples for the Unavailable and Busy messages:
Unavailable:
“I am not able to get
the phone right now. You can leave me a message after the beep or if this is
urgent, you can press 1 now to have the system try to find me. If it can not
find me you will be returned here to leave me a message”
Busy:
“I am either on
another line or not reachable at this time. Please leave me a message after the
beep.”
Enable the Features
in FreePBX
Now that we have the two messages, we will set out to configure what was described above. The flow chart in Figure 1 describes our desired behavior.
We must first enable both the Follow Me and VmX Locater features in FreePBX. Navigate to the desired extension/user GUI screen and enable the VmX Locater feature. We will use extension 200 in our example. You will need both Voicemail Status Enabled and VmX Locater™ Enabled as shown in Figure 2.
Figure 2
The rest will be done in the ARI User Portal. Before going there, we will also create the initial Follow Me feature as shown in Figure 3. So while you are in the Extension/User GUI, click on the Add Follow Me Settings (or Edit Follow Me Settings if one already exists). You are taken to a screen similar to Figure 3.
Figure 3
The important things to set here are the desired Ring Strategy and the Destination if not answered. (These can not be set in the User Portal) Our favorite Ring Strategy is the RingallV2-prim which you can read more about in one of our past articles here. To accomplish the goals we have set, you will want to choose the Voicemail <200> John Smith (busy) Destination. We will configure the remaining settings in the User Portal.
Configure the
Features in the User Portal (ARI)
With these features setup, we (or the user) move to the ARI User Portal to finish. (Since you probably do not want to give normal user’s access to FreePBX if you care about the integrity of your phone system.)
Log into the User Portal Recording Interface. (This is the Recordings tab at the top of the FreePBX Screen, or navigate to it directly). Next choose Follow Me on the Left navigation section. Figure 4 shows what we have chosen to configure.
We have chosen the following configurations:
Enable:
Unchecked – which means that phone calls will not automatically be sent to our Follow Me setup. This makes it only accessible through the VmX Locater.
Follow Me List:
We list the numbers that we want in our Follow Me list. Note that we must include our own extension if we want it rung as well. Also note, there is no ‘#’ required at the end of an external number. The system figures this out by itself.
Ring First For:
We like the initial ring time. This is not really necessary in the example we are describing but makes it more convenient if you like to switch back and forth between using Follow Me directly or only through the VmX Locater. You can leave it at 0 if it does not apply to you.
Ring Follow Me List for:
Make sure this time is long enough for the user to answer their cell phone and press 1 to confirm the call if using confirmation.
Use Confirmation:
Checking this box will assure that all calls sent to an outside line (vs. internal FreePBX extensions) will require the user to confirm the call by pressing 1. This keeps calls from dropping into cell phone voicemail, answering machines or other undesired landing spots.
That provides our desired Follow Me configuration. We must now setup the VmX Locater configuration to. Choose the VmX™ Locater menu option and you will be presented with a screen as shown in Figure 5.
We have configured the options as follows:
Use When:
By checking unavailable but not busy we are configuring the system as drawn in Figure 1. If the phone is busy, or the caller has already flowed through the Follow Me process and was sent to the busy destination if no answer then you do not want them to be able to choose to keep trying your Follow Me.
Voicemail Instructions:
This is a personal preference. If checked the caller will be presented with the standard voicemail system instructions concerning leaving a message, reviewing their message, etc. after playing your greetings. Un-checking this box will disable that system message.
Press 0:
If you have a personal assistant or alternative choice for
what to do when people press 0, you can uncheck this box and provide the number
here. Otherwise the system default for zero-ing out of voicemail will be used.
Press 1:
Checking the Send to Follow-Me is what does our magic and makes sure that this option gets sent to Follow Me even though we had disabled it in the previous section.
Press 2:
If you really want to complicate your caller’s lives you can present them with yet another option and put a number in for option 2. Some people also choose to use this option but not “announce” that it is available. We’ll leave it to the reader’s imagination of how they may choose to use this option. (And for those of you who like to look under the hood, there are also options 3-9 that can be programmed but are not exposed in the GUI.)
Summary
That is all there is to it. You can now go back and review Figure 1 to see the call flow that is presented to callers when they try to reach you. Both voicemail messages are recorded in the Voicemail system by the user as they would always do so. The Follow-Me and VmX Locater configurations are controlled by the user in their ARI User Portal once created and enabled by the Administrator. They can then easily manage their own configuration, whether they choose the one described here or other preferences.
We hope this has been another useful addition to our Technical Corner. We will will return to the Under the Hood series in our next article.
I didn't get a lot of feedback from last week's article on what you wanted to hear so I scanned the forums a bit and decided the IVR generated enough questions that I would put together an article going into a bit of depth on this. Well - it grew a lot longer then anticipated but here you go. I hope this is useful, please provide comments, feedback and let us know what you want to hear about next week if you want these informational series to continue!
-philippel
IVRs - Standard Abilities, Tips and Tricks
An IVR, or Digital Receptionist, is one of the powerful features that users of freePBX™ take advantage of when designing their call handling options. The IVR can be used as a simple means to answer the phone and direct callers to different departments, or to create much more complex trees of information sources, and beyond.
Common questions repeated on freePBX™ and other forums range from basic operation, how to expose access to internal features such as voicemail checking, and more complex tasks like integrating remote extensions connected through Dundi to enable direct extension dialing across a cluster.
This article will begin by giving an overview of the built in abilities and covering some more standard but subtle techniques of using the timeout (t) and invalid (i) extensions, and exposing feature codes into your IVR. Also, hooking into an IVR with a custom context to do more customized applications, and a bit about how Asterisk resolves extensions so you can understand and debug such custom changes will be discussed.
Overview of Standard Features
Prior to configuring specific IVR options, choose if the IVR should allow direct extension dialing and/or ‘dial-by-name’ directory dialing. The directory dialing simply exposes the directory application which must be installed and enabled in the Feature Code menu. On most systems you will have a single choice for Directory Context: Default. The directory segregates groups of users based on the voicemail context they are assigned. Unless you have created different voicemail contexts when configuring voicemail, everyone will be available in the directory. Otherwise, it lets you limit the directory dialing to those contexts. (We will not elaborate any further on this aspect and assume you only have default as your voicemail context for the sake of this article).
The enable direct dial option is fairly straight forward but still leads to occasional confusion. Choosing that will allow any local extension to be dialed by its extension number. Furthermore, if that extension has a Follow-Me configured, the Follow-Me will be used. (As a side note – it will also be used in directory dialing above). Only the extensions are exposed which leads to common questions when users are trying to direct dial Ring Groups, Queues, Conference Rooms, etc. These are not exposed by checking this box, nor would we want them exposed for good reason. Exposing these is described below.
IVR Options
The next section of the IVR GUI provides the means to specify what action to take when a given option is pressed. For each menu choice you may configure:
In most cases, these are fairly straight forward. You may have a Ring Group setup for “Sales” and provide an option where you tell the caller to press 1 for “Sales”. So you put in 1 as your option, and choose the “Sales” Ring Group. Another example may be the need to expose a “meet-me” conference room. You may want to treat this like the above example, press 3 for the conference room. Alternatively, you may want to use the same conference room number that is used internally so people don’t have to remember another number. The solution is simple, if your conference room number is 7666 (R-O-O-M) you can simply put 7666 as your IVR option (in the left textbox) and then choose that same conference room as the destination.
But how to expose something like voicemail system access at the IVR when there are no destinations listed? Voicemail access or other feature codes do not show up as destinations to the IVR or anywhere else in freePBX™ until you expose them as a Misc Destination. Since this article is about IVRs, I will leave it to the reader to work this exercise on his or her own. Go to the Misc Destinations module, create a destination for the feature code you want to expose (e.g. voicemail access) and then go back to the IVR and now you should be able to choose your newly created destination in the Misc Destination list.
Next, how do you control the behavior when a user presses an invalid extension or waits to long. Asterisk has two special extensions called the ‘t’ extension and the ‘i’ extensions which are used to handle timeouts and invalid extensions, respectively. When you create an IVR, it will create both of those options by default unless you specifically define your own options for them. The default behavior is to simply play an appropriate message and then loop back to the beginning of the IVR – up to 3 times before it drops the call. This may not be the desired behavior and is easy to override by simply putting ‘i’ or ‘t’ as the option in the same way you would define any other IVR option digits, and then choose an appropriate destination. Maybe you just want it to go back to the beginning of this IVR; you do this by selecting ‘yourself’ as the destination.
This next example will desribe a technique to allow extension dialing at the IVR while ‘blocking’ certain extensions. Assume the boss does not want the general public direct dialing him or her from the IVR but other extensions should be accessible. If a caller dials the boss’s extension, it should go to his or her assistant instead. How do you accomplish this? In this case, you would define an IVR option that is the same as the boss’s extension number and then set the destination for that option to the assistant’s extension. Because of the way the IVR context is created, and how Asterisk works, the caller will now be re-directed to the assistant if they dial the boss’s extension (see details below for a further explanation). (Note - if this technique is used, it will not keep the ‘dial-by-name’ directory from reaching the boss.)
Now, back to the Return to IVR checkbox – what is that and how would you use it. In a more sophisticated IVR tree, where you have IVRs nested under other IVRs, you often want an option to offer the selection of: “to return to the previous menu, press 9 now” (where 9 is an arbitrary option). This is what Return to IVR does and is available in both the IVR and Announcement modules. Specifically, if this IVR was called as a child from another IVR, and the user presses that option, it will return up one level. You still need to define an alternate destination on the right – to handle the case where this IVR is not called as a child – but this will always be ignored if the box is checked and this IVR was called from another.
Let’s look at a simple example from above. We want to redefine the invalid ‘i’ option to go back to the top of the current IVR – however, we want to play a custom message first. How can we accomplish this? The simple way would be to define the ‘i’ option and choose as its destination an invalid option announcement that you previously created. But don’t check the Return to IVR here. Instead, check it in the announcement module where you define the invalid option announcement that you have chosen for the ‘i’ option. The end results when a user presses an invalid option, they will go to the announcement you specified. Since the announcement has Return to IVR checked, it will return back to this IVR after it plays its message, having the desired result.
A more sophisticated example might be creating a child IVR that provides directions to your facility. The parent IVR would choose the Directions IVR as its destination when someone wants directions. In the Directions IVR, you may have directions from the airport, highway, etc. Each of those would call an appropriate announcement module destination with the directions. You would also include an option saying ‘to return to the previous menu, press 9’ (for example). So now option ‘9’ becomes the option where you check Return to IVR and when pressed, it will return to which ever IVR called it. So, for example, if you have a day and night IVR you use, you can have both of them provide an option for directions and both point to this same Directions IVR. The return path will always be back to the correct IVR. Of course, you will also want to check Return to IVR in each of the announcements that provide the directions.
Hooking into an IVR with custom extensions
Let’s start by looking at the Asterisk dial plan that is generated from a fairly simple IVR that has two options and the ‘i’ extension redefined, in addition to enabling directory dialing and direct extension dialing:
[ivr-7]
include => ivr-7-custom
include => ext-findmefollow
include => ext-local
include => app-directory
exten => #,1,Goto(app-directory,#,1)
exten => h,1,Hangup
exten => s,1,Set(LOOPCOUNT=0)
exten => s,n,Set(__DIR-CONTEXT=default)
exten => s,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT})
exten => s,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => s,n,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Set(TIMEOUT(digit)=3)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n,Background(custom/welcome)
exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup
exten => 1,1,dbDel(${BLKVM_OVERRIDE})
exten => 1,n,Set(__NODEST=)
exten => 1,n,Goto(ext-group,444,1)
exten => 2,1,dbDel(${BLKVM_OVERRIDE})
exten => 2,n,Set(__NODEST=)
exten => 2,n,Goto(ext-local,${VM_PREFIX}201,1)
exten => i,1,dbDel(${BLKVM_OVERRIDE})
exten => i,n,Set(__NODEST=)
exten => i,n,Goto(app-announcement-2,s,1)
exten => t,1,Goto(loop,1)
exten => loop,1,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
exten => loop,n,GotoIf($[${LOOPCOUNT} > 2]?hang,1)
exten => loop,n,Goto(ivr-7,s,begin)
exten => return,1,Set(_IVR_CONTEXT=${CONTEXT})
exten => return,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT_${CONTEXT}})
exten => return,n,Goto(ivr-7,s,begin)
exten => fax,1,Goto(ext-fax,in_fax,1)
; end of
[ivr-7]You will notice the includes at the top. The first is IVR-7-custom is included at the very top. The name of this context will not change since the ‘7’ is a unique identifier that is auto-generated. Now you can safely use this context in extensions_custom.conf. The subsequent pair of included contexts are ext-findmefollow and then ext-local. These are included as a result of choosing direct extension dialing. Lastly, app-directory is included as well as the next “goto” extension as a result of the Directory Dialing choice we made. Beyond that, we will not go into detail on the code that is generated except to note a couple of observations. Since the ‘i’ extension has been defined, it does not “goto” the auto-generated ‘loop’ code. Instead, it goes to an announcement we have defined that plays a custom invalid message and then Returns to IVR as we described previously. Timeouts will still go to the auto generated loop since we did not redefine them.
Now let’s talk about standard Asterisk flow so you can understand how and where to insert custom contexts to do specialized tasks. A common source of confusion is the include statement. Often custom dialplan instructions are put into a custom context such as ivr-7-custom and then nothing happens. Here is why: when a call comes in to this IVR, it is directed to the ‘s’ extension which means it will go through the normal flow up until playing the background command and then it will stop and wait the response timeout (TIMEOUT(response)) time for digits to be pressed (and if none are pressed, it will look for the ‘t’ extension). Once digits are pressed, it will scan the entire context, ignoring any includes to see if it can find a match. If no match is found, it will then go to the first include and repeat the process recursively within that context (including other contexts that are included within them). If nothing is found, it will then check the next include – and so-forth, until it finds a match. (And if none are found – since we have defined the ‘i’ extension, the call will eventually go to the dialplan defined at the ‘i’ extensions.) The important point to take away here is that it will never even look at the included contexts if it finds an acceptable match in the main context.
We will use the example blocking the boss’s extension from above to see how this flow works. Assume the boss’s extension is 301. In this dialplan there is no 301 within the ivr-7 context, so it now starts to check the includes until it eventually finds extension 301 in ext-findmefollow or ext-local. Since we didn’t want this behavior, we created a new option for the boss’s extension to send callers to the administrative assistant (in this example, 220). We now have the following additional code inserted:
exten => 301,1,dbDel(${BLKVM_OVERRIDE})
exten => 301,n,Set(__NODEST=)
exten => 301,n,Goto(ext-local,220,1)
since this is defined within this context, Asterisk will search no further, it will never look at the included ext-local or ext-findmefollow context (even though they come first), and direct the caller to extension 220 in its place.
If you want to do something a little more ‘general’ such as enable any meet-me room that is configured within this IVR, or maybe allow direct dialing via a Dundi setup that you have created. This is where the custom includes come in. Let’s use the conference room example. This is where you want to take advantage of
include => ivr-7-custom
to easily expose all of your meet-me rooms. You could define each one individually as described earlier, but then you would have to manually add options here each time you added something from the conference module.
Within extensions_custom.conf – you can simply add the following 2 lines which would result in this specific IVR having access to all your conference rooms:
[ivr-7-custom] include => ext-meetme
That’s it. Now when someone dials a conference room extension at the IVR, it will first look for it within the IVR’s main context, and when it doesn’t find it, it will start going through the included contexts, which leads it to the ext-meetme where these are defined. Now you have the desired behavior since any new conference room that is created gets put into ext-meetme. Taking this same approach, you can expose other aspects of the dial plan in this same way. If you have a Dundi setup, and want to give access to extensions defined in a Dundi context you have created, you could put it here as well and they could be direct dialed from this IVR.
Beware if you start using custom contexts like this. Make sure you really understand what you are doing since it is easy to create security holes or result in undesirable or unpredictable behavior.
Summary
The IVR is a powerful tool that can be used to create simple welcome messages and call routing, or more complex IVR trees with subroutine-like return capabilities. You can use the existing GUI along with other modules like Misc Destinations and Announcements to expose additional functionality to the IVR and change default behaviors to your preferences. To dig further into it, you can write your own custom contexts to control and expose abilities although it requires an understanding of the way Asterisk prioritizes and processes extensions to get the achieved results. This should only be done by users who really understand the implications and consequences.
We hope you find this article useful, please post comments and questions, and let us know what you want to hear in the next series!
-philippel
This week’s FreePBX® Technical Series will discuss the different Ring Group and Follow-Me ring strategies in FreePBX® 2.2 and what is coming next. The basic modes will be discussed and the question: “What is that –prim” version of all the strategies?” will be answered. Next week, new enhancements and new Ring Strategies that are forth coming will be described (or available now if you are adventurous and like to run the development branch).
-philippel
Ring Group and Follow-Me Ring Strategies (1 of 2)
Basics
Before proceeding, some background is in order. The core behavior used by both Ring Groups and Follow-Me are implemented in the dialparties.agi script along with some associated macros. It is not a built in feature of Asterisk. Since both use the exact same mechanism, everything discussed here will apply to both unless specific differences are highlighted. The Follow-Me module is a direct descendant from Ring Groups because of the number of users who were using Ring Groups as personal follow-me setups. Since then, it has evolved quite a bit and more differences have been introduced.
The Three Core Ring Strategies
Today’s core strategies include the ringall, hunt and memoryhunt. These are reasonably described in the tooltip when you hover over the ring strategy field.
simply rings all the extensions listed in the Extension/Follow-Me List for the Ring time specified below it.
this will ring each number listed in the Extension list in the order that it appears. The Ring time specified below tells it how long to ring each extension during each iteration of its hunt..
this is very similar to the hunt strategy just described. The difference being, instead of trying each extension listed individually, it progressively adds the next extension in the list and rings it along with all the previous extensions for the Ring time during each iteration of the hunt.
One side note to mention when it comes to Follow-Me, there is no reason why you must include your own extension in the Follow-Me List. If you don’t want it to ring, it may be left out.
Follow-Me has one more option that might be considered part of the Ring Strategy, the Initial Ring Time. It is often desirable for a Follow-Me user to ring his or her extension for some amount of time before taking the drastic measure of ringing a number of cell phones and other phones that may be listed in their Follow-Me List. If someone is sitting at his or her desk, this avoids a “fire drill” every time the phone rings. That is the purpose of this mode; it will ring only the extension for the determined time – unless set to 0 seconds which disables the Initial Ring. There is another subtle benefit in using this Initial Ring Time that will be touched on below when discussing the “-prim” versions of the Ring Strategies.
So What is This “-prim” Anyhow?
This will be answered by describing a scenario. For example, you would like people to be able to reach you as you are on the road a fair amount of time, so you have set yourself up with a Follow-Me to ring your primary extension desk phone and cell phone. You are also like many users and have a desk phone with multiple line appearances. While you are at your desk, on a call with a client, another call comes in. You can see who is calling and if it were urgent you could easily put your current client on hold and answer the incoming call. You choose not to take this second call, but to your distraction, your Follow-Me starts ringing your cell phone. How do you stop that?
This is exactly what the “-prim” modes are designed to handle. The Ring Strategies are all the same as described above with a subtle difference. First, the status of your prim-ary extension is checked. If the line is occupied, it will not go on to ring the other phones in the Extension/Follow-Me List. In the current implementation of both Ring Groups and Follow-Me, the primary extension is defined as the first extension listed in the Extension/Follow-Me List.
Now, after you have implemented the “-prim” version of your favorite Ring Strategy, the same call comes in while you are on the phone. However, this time the ‘fire drill of ringing phones’ has been eliminated. You choose not to pickup the second line appearance and the second call rolls over to voicemail while you give the current client the attention they deserve.
What Happens When I Press DND and Have “-prim” Selected?
Continuing the previous scenario; you are now off the phone with your client who has just given you 30 minutes to get him a quote for an order he wants to place. You can’t be interrupted, so you hit DND (Do Not Disturb) on your phone. However, you did not have the “-prim” mode selected. Another call comes in and, although your desk phone obediently keeps silent, your cell phone distracts you again!
Back to the “-prim” mode and how it might be able to help here; and some subtle but desirable behaviors that occur when using the Initial Ring Time option with Follow-Me (not available with Ring Groups). In addition to checking the state of the primary extension as previously described, dialparties.agi also checks if the primary extension has DND set before ringing the Extension/Follow-Me List. If set, it will not ring any of the other extensions and simply fail over to the configured destination (usually voicemail).
Many phones implement DND without using the FreePBX® DND feature code. These phones will implement DND locally and when a call comes in they simply reject the call by sending a “Busy Here” SIP message back to Asterisk. There is no standard way to “query” the phone and determine its state prior to making a decision about ringing the other extensions – so even with a “-prim” mode set, you may still end up with your other phones ringing. How might you deal with this situation?
When an Initial Ring Time is set on your Follow-Me, an additional benefit is obtained. Prior to ringing all your Follow-Me List, FreePBX® will only ring your primary extension for the allotted time as previously described. If it receives a “Busy Here” back from the phone, and you are running in “-prim” mode, it will not go and ring the other listed extensions since it assumes the primary is occupied. This results in the desired behavior on phones that implement DND locally.
Summary and Next Week
Different Ring Strategies available for a Ring Group or Follow-Me and a description of what the mysterious “-prim” version of those strategies is all about and why you may want to use them have been discussed in this FreePBX® article. Some subtle behaviors of how these interact with DND have also been clarified.
Next week this freePBX® series will go over some up and coming Ring Strategies. The improved ringall strategy: ringallv2, as well as firstavailable and firstnotonphone. Also the following subtle issue (that you may or may not have ever noticed) will be discussed: When someone calls you while your are on the phone and choose not to answer, they get the unavailable greeting; why can’t they get the busy greeting instead? We will tell you why and what has been implemented to optionally change this behavior.
As always, we at FreePBX® hope you find this series helpful. Please provide comments, feedback and suggestions for what to write about next!
-philippel
In last week’s FreePBX® Technical Series we reviewed the current ring strategies: ringall, hunt and memoryhunt. We clarified the mystery of the “-prim” postfix on these and discussed some subtle behaviors between DND implemented in FreePBX® (server side) versus locally on the phone. This week we will review some up and coming Ring Strategies and fill you in on a secret to enable the voicemail busy message when your multi-line phone is never actually busy.
New Ring Strategies
We’ll start with the ringallv2 strategy - only available in Follow-Me. You may be asking: what’s so hard about ringing all the phones at once that you need “yet another version” of the same thing? Consider a Follow-Me setup that begins with an Initial Ring (to avoid those “fire drills”) followed by the list of cell phones, home office phones, etc. that all ring together if not answered. A call comes in and eventually goes to voicemail (because, sometimes, we really don’t want to be found). Now, check your phone’s missed calls; there is not one, but two missed calls from that one phone call (which many people find rather annoying). Here’s another quirk you may have run into. A call comes in, it rings, you go to pick it up and just at the moment you answer it hangs up, leaving dead air for you to talk to while your second line and other Follow-Me List of phones start ringing again. If you have experienced this, you know it is very annoying. What is going on?
Under most Ring Strategies, the phone is controlled as follows: First, ring the primary phone for the Initial Ring time if set. If the phone is not answered, then Asterisk times out, and goes back and re-rings the phone along with the rest of the phones in the list. This results in two calls, and thus 2 missed calls. It also creates the opportunity to pick up the receiver during the transition from the first to the second call, resulting in the “dead air.”
The ringallv2 strategy is about changing these subtle, but annoying, behaviors. In this strategy, FreePBX® forks two “threads” of control. The first rings your primary extension while the second thread sleeps for a while (the Initial Ring time). If you haven’t answered within that time, the second thread kicks in and starts to ring the other phones (while the first thread continues ringing your primary extension – thus no more hang-up or double missed calls). That’s about it. There is a lot of complexity behind the scene to make sure the “-prim” modes work and DND information is correctly communicated between the threads – but the result is a well behaved Ring Strategy. (We’ll warn you though – the CDR records can start to get a bit interesting when using this strategy – and if you toss call confirmation into the mix, it gets really fun).
The next two strategies: firstavailable and firstnotonphone introduce new behavior. We will warn you ahead of time, that none of us are big users of these strategies (yet). So, if you find any incorrect behavior in what we describe next, please point it out to us so we can correct the article (or correct the behavior – which ever is appropriate).
These strategies try to mimic behavior that is closer to the traditional telephony hunt group which is quite different from the FreePBX® definition of the two hunt strategies. The firstavailable strategy will hunt through the list of extensions until it gets to one that is available to ring. At that point, it will try no further and continue ringing that line for the Ring Time duration and, if not successful, it will skip to the configured destination if no answer. If the line has Call Waiting, it is defined as being available. The firstnotonphone is a subtle but potentially important variation to firstavailable. The system will not only try to hunt until reaching an available extension, but it will continue to progress down the list until reaching an extension that is completely un-occupied. The difference here is that firstavailable will consider an occupied line with Call Waiting as available, but firstonphone will not. So if it rings an occupied line with Call Waiting enabled and gets no answer, firstonphone will continue to hunt for another extension, firstavailable would not.
The implication of using an external number versus an extension with these strategies will result in un-determined behavior since FreePBX® will not have any information as to the state of those numbers. You should keep this in mind when choosing these Ring Strategies.
Voicemail Busy Message on Multi-Line Phones
Consider this common scenario: You have a phone with multiple line appearances or Call Waiting. While on the line, another call comes in which you ignore. Today the caller receives the unavailable voicemail greeting, not the busy greeting. Which do you want them to receive? Before FreePBX® 2.3, the caller is always presented with the unavailable greeting unless you have specifically controlled the greeting type through an explicit destination.
Many of us would prefer to present a caller with the busy greeting in this scenario. To change to this behavior, you will want to note the new setting in, CWINUSEBUSY, in amportal.conf that enables this mode if set to “yes.” (The default behavior remains the same in order to preserve backward compatibility, so you must go in and set this.)
Summary
To recap, we reinvented the ringall strategy, ringallv2, on Follow-Me in addition to providing two new strategies, firstavailable and firstnotonphone that mimic the behavior of old style hunt groups. We also revealed the secret of why the voicemail busy message may never get played to your callers and how to rectify that, if you want.
Please post to us to let us know what you think of the FreePBX® Technical Series and if you find it useful. We look forward to hearing from you. In the mean time, we hope you've had a chance to load our recent FreePBX 2.2.2 Release and now we are going to get busy bringing you the 2.3 beta program we promised.
-philippe (on behalf of the FreePBX® team)
Overriding a Time Condition with a feature code is a request that has been asked for since as long as Time Conditions have been available in FreePBX. It comes up regularly on the forums and there have been many custom versions implemented and posted to solve this problem. We have introduced a Day/Night Control module to provide this ability as mentioned in an announcement a few weeks ago.
The module has been put into FreePBX version 2.3 and we hope by now has gotten plenty of testing. Some users were confused on how to use this module in conjunction with a Time Condition so we felt a short write-up in our technical series is in order.
The Day/Night Control module is similar to many other modules in the system. You can create multiple daynight feature codes and each can be used as a destination from within FreePBX as well as provide two destinations of their own. The feature code itself is nothing more than a two way toggle switch. You can change it to either DAY or NIGHT and the state is toggled each time you dial the feature code.
Let’s walk through a standard example of how one might use this in conjunction with an existing Time Condtion. You have an Inbound Route for your main Company DID, that points to a Time Condition set to ring your receptionist at queue 1200 during the normal business hours of 8:00am to 5:00pm Monday-Friday. After hours, it rings the After Hours IVR. You would like to provide an ability to override the Time Condition with a daynight feature code.
How do we do this when there is no reference to the Time Condition in the Day/Night Control module. Lets step through this example and see how:
That’s it. What you have created looks like this:
Example of Day/Night Control Feature Code used with a Time Condition
Now you can dial *280, optionally entering a password if configured, and change between the Day mode, where the call continues to be controlled by the Time Condition, or the Night mode, where the call is routed around the Time Condition to the normal After Hours IVR.
Accessing the Day/Night Control from Outside
Down in the comments Dirk brought up and excellent question. He needs to be able to enable/disable the feature code from an outside line: "but how can I do this from an outside line?" Normally you would define a Misc Destination to this feature code and then point a DID or IVR option to that destination. However, it turns out this wasn't really implemented quite right to allow you to do this (mental note - change that in a future release...). However, you can still use the Misc Destination module to accomplish this task. Here's how:
There are plenty of other ways you can use the daynight feature code and there is no need to do it in conjunction with a Time Condition. It is simply a module that can be chosen as a destination by other modules and provides a two way toggle switch to continue the call routing to either its Day or Night destinations. As always, we hope that you enjoy these technical series and would very much like to see some suggestions of what you would like to read about (or we may decide no one is reading these and stop writing...).
--Philippe
For some people, Follow-Me does the trick. If I'm not at my desk, start looking for me always. For others, they may not want this unless the caller really needs to reach them. You can configure complicated IVRs, ringgroups, etc. to chain together but this is not manageable on a large scale. So how do you give everyone the ability to provide options to be located, on demand and that the user can manage. That's where the Voicemail VmX Locater comes in ...
You get a call and are not there, it goes to voicemail. Wouldn't it be nice if you could change your voicemail message to read something like: "I'm not here, press # to leave me a message now. If it is urgent, press 1 to reach my cell, or 0 to get my assistant ..." You get the idea.
The VmX Locater introduces a mini-IVR for each and every voicemail box that it is enabled for. You enable it from freePBX in the extensions/user screen. The user configures it from their ARI portal.
How does it work?
The user records their unavailable and busy messages as always. They provide instructions to the caller, "press 1 ..." (Or maybe they don't, and only tell certain people that the options are there).
Next, the GUI provides 3 choices (it is designed to have more, I just limited this in the GUI):
You can choose to have the IVR apply when unavailable, busy or both. For example, if you are busy you may not want someone to start ringing your cell phone, so disable it for busy. Lastly, when they do enter voicemail you can choose whether or not they will simply get a 'beep' or Allison's standard instructions.
That's it. From a user and caller's perspective, they don't realize that the voicemail's busy and unavailable greetings have been hi-jacked to provide this functionality on top of the voicemail system. It acts seamlessly. (About the only glitch I've encountered is - if you call your own voicemail box and then click '*' to get into the system, you have to hit '*' twice when listening to the greeting.)
I've put this in 2.3.0 alpha right now (SVN trunk branch). No decision has been made yet whether we will back port this to 2.2.1 when that is released.
As a side note to all this, if you use Follow-Me, you will find that the ARI enhancements will also allow your users to access some of their Follow-Me settings, as well as CFB and CFU. A real benefit for users always requesting changes.
Have fun!