Ring Group with Fallback to Voicemail

Call Handling -- Last reviewed 2026-06-13 Found this useful? Upvote it. ×

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

  1. 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 in globals.conf instead.
  2. Parallel ring: Ampersand-separated endpoints in Dial() ring simultaneously. The first to answer wins; the remaining channels stop ringing immediately.
  3. Timeout: The 20 in Dial() is the ring timeout in seconds. After 20 seconds with no answer, Dial() returns with DIALSTATUS=NOANSWER.
  4. CANCEL guard: If the caller hangs up during ringing, DIALSTATUS is CANCEL. Jumping to done avoids attempting to play voicemail prompts to a disconnected channel.
  5. Voicemail flag u: Plays the "unavailable" greeting. Use b instead if you want the busy greeting when all endpoints were active.

Tips

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.

Moderated before publishing. Email never shown.
Related Snippets