Creating a Ring Group with Cascading Style Ring Delay

Got tied up again last Friday, so once again I consult my excuse oracle, the delay for last week’s #FridayFun was due to an intermittent media crash.

A few jobs ago I worked in an office served by a FreePBX system (started on ver. 2.6 IIRC). Inbound calls went to a reception ring group of 1 ext, rang for a few seconds, then failed over to another ring group with more recipients. The receptionist had an uncanny knack of picking up the phone in that split second when their phone stopped ringing for the first ring group, but before it had started ringing for the second. I could never get timing to work cleanly, no matter what I tried.

Many years later, I wrote some simple dialplan for an unrelated purpose, which would have worked perfectly for this use case. The idea is to do everything with a single ring group, but to delay ringing some of the group members. This prevents the ringing from stopping and starting again.

Using the Config Edit module (or the linux editor of your choosing), locate the file /etc/asterisk/extensions_custom.conf and add these lines:

[from-internal-custom]
exten => _**XXX*XXXX,1,Noop(Entering user defined context from-internal-custom in extensions_custom.conf)
exten => _**XXX*XXXX,n,Noop(Calling extension ${EXTEN:-4} with a delay of  ${EXTEN:2:3} seconds)
exten => _**XXX*XXXX,n,Wait(${EXTEN:2:3})
exten => _**XXX*XXXX,n,goto(originate-skipvm,${EXTEN:-4},1)

Save the changes and apply config. This creates a feature code that you can dial in front of extension numbers that will accept a numeric value in seconds to delay ringing.

So if your system has 4 digit extension numbers, and you want to intitiate a call to 4002 with a delay of 10 seconds, then you would dial: **010*4002. Not particularly useful on it’s own, but if you combine these dial strings with a ring group, you could have a list like this:

4000
4001
**010*4002#
**010*4003#
**015*4004#
**015*4005#

With a single ring group, you would have the first two extensions ring immediately, the second two begin ringing after 10 seconds and the final two start ringing after 15 seconds. As ususal, if any device answers, all of the ringing stops and the call proceeds like normal.

I’m using the context originate-skipvm to ensure that the call is not answered by the user’s local voicemail, but there is always a risk that one of the ring group users enables CFD or FMFM which may have unpredictable results. Be sure to test that case if it’s a possibility.

Edit - added the # suffix as required for external numbers in a ring group

5 Likes

Nice! I was actually setting up the dual ring group strategy right now. This is super helpful!

1 Like