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 channelA single call leg passing through Asterisk. Channels represent connections to endpoints and are what dialplan applications act on. 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 voicemailAsterisk's built-in voice messaging system (app_voicemail), configured in voicemail.conf with mailboxes per user. 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 contextA named section of the dialplan that groups extensions. Calls enter a specific context and can only reach extensions visible from it, making contexts the basic unit of call routing and security., use
Goto(ring-sales,s,1)from your trunkA connection between Asterisk and another PBX or an ITSP/carrier, used to send and receive external calls. handler rather than duplicating the dial logic. - For a larger group, store
RINGGROUP_EXTSas a global inglobals.confso membership changes require no dialplanThe core call-routing configuration of Asterisk, written mostly in extensions.conf as contexts, extensions, and priorities that decide how every call is handled. Full definition → 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 queueAn Asterisk call queue (app_queue) that parks incoming calls and distributes them to logged-in agents according to a chosen ring strategy. 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 extensionA dialplan entry that matches a dialed number or pattern within a context and triggers a sequence of prioritized steps.) 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.