Ring Group with Fallback to Voicemail
Ring Group with Fallback to Voicemail
Ring all members of a group simultaneously. If nobody answers within the timeout, send the caller to a shared group mailbox. This is the foundation pattern for a small team where any member can pick up, and no call should go unanswered without leaving a message.
Dialplan
[ring-sales]
exten => s,1,NoOp(Sales Ring Group)
same => n,Set(RINGGROUP_EXTS=PJSIP/1001&PJSIP/1002&PJSIP/1003)
same => n,Dial(${RINGGROUP_EXTS},20,tT)
same => n,GotoIf($["${DIALSTATUS}" = "CANCEL"]?done)
same => n,VoiceMail(sales@default,u)
same => n(done),Hangup()
Shared Mailbox
Define the group mailbox in voicemail.conf. This gives the team a single inbox and a dedicated greeting any member can record.
[default]
sales => 1234,Sales Team,sales@example.com
How it works
- RINGGROUP_EXTS: Storing the member list in a channel variable keeps the
Dial()line readable and makes it easy to update membership in one place. For a list that changes rarely, move it to a global variable inglobals.confinstead. - Parallel ring: Ampersand-separated endpoints in
Dial()ring simultaneously. The first to answer wins; the remaining channels stop ringing immediately. - Timeout: The
20inDial()is the ring timeout in seconds. After 20 seconds with no answer,Dial()returns withDIALSTATUS=NOANSWER. - CANCEL guard: If the caller hangs up during ringing,
DIALSTATUSisCANCEL. Jumping todoneavoids attempting to play voicemail prompts to a disconnected channel. - Voicemail flag
u: Plays the "unavailable" greeting. Usebinstead if you want the busy greeting when all endpoints were active.
Tips
- Record the group greeting from any phone: dial
*98, log in with the sales mailbox number and PIN, then select option 1 (unavailable greeting). - To route inbound DID calls to this context, use
Goto(ring-sales,s,1)from your trunk handler rather than duplicating the dial logic. - For a larger group, store
RINGGROUP_EXTSas a global inglobals.confso membership changes require no dialplan reload. - To ring members one at a time instead of all at once, chain multiple
Dial()calls and checkDIALSTATUSafter each. - For separate handling of busy, unavailable, and congestion outcomes, see Ring Group with DIALSTATUS Routing.
Ring groups vs. queues
A ring group and a queue both ring multiple people, but they behave differently when everyone is busy or nobody answers.
With a ring group, the call goes somewhere else (voicemail, an IVR, another extension) the moment the timeout expires. The caller never waits. This pattern suits small teams with low call volume where a missed call is better handled by a voicemail than by holding indefinitely.
A queue holds the caller in place until an agent becomes available, with music on hold and optional position announcements. Agents can log in and out dynamically, and Asterisk tracks statistics like wait time and abandonment rate. Use a queue when callers are expected to wait and agent availability changes throughout the day.
If you find yourself adding maxlen, wrap-up time, or agent login/logout logic to a ring group, that's a sign it should be a queue. See Queue with Failover for a working starting point.
User Notes
Know a tip or gotcha for this topic? Share it below and help others.
Contribute a note
Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.