Ring Group with DIALSTATUS Routing

Call Handling Asterisk 18+ -- Last reviewed 2026-08-22 ring-group dial failover voicemail Found this useful? Upvote it. ×

Ring Group with DIALSTATUS Routing

Ring all extensions in a group simultaneously. After the Dial() returns, inspect DIALSTATUS to decide what happens next, busy callers hear the busy greeting, unanswered calls go to the unavailable greeting, and unavailable channels get logged.

Dialplan

[ring-sales]
exten => s,1,NoOp(Ring Group - Sales Team)
 same => n,Set(RINGGROUP_EXTS=PJSIP/1001&PJSIP/1002&PJSIP/1003)
 same => n,Dial(${RINGGROUP_EXTS},25,tTr)
 same => n,GotoIf($["${DIALSTATUS}" = "BUSY"]?busy)
 same => n,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?noanswer)
 same => n,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?unavail)
 same => n,Hangup()

 same => n(busy),VoiceMail(1001@default,b)
 same => n,Hangup()

 same => n(noanswer),VoiceMail(1001@default,u)
 same => n,Hangup()

 same => n(unavail),VoiceMail(1001@default,u)
 same => n,Hangup()

How it works

  1. Ampersand (&) in Dial(): PJSIP/1001&PJSIP/1002&PJSIP/1003 rings all three endpoints simultaneously. The first one to answer wins; the others stop ringing.
  2. Dial options tTr: t allows the called party to transfer, T allows the caller to transfer, r generates a ringing indication to the caller instead of music on hold.
  3. DIALSTATUS: After Dial() returns, this variable tells you why: ANSWER (someone picked up), BUSY (all endpoints busy), NOANSWER (timeout with no answer), CHANUNAVAIL (endpointIn PJSIP configuration, the SIP entity Asterisk communicates with: a phone, trunk, or other user agent. Defined by an endpoint section in pjsip.conf. not registered), CANCEL (caller hung up), CONGESTION (network error).
  4. VoiceMailAsterisk's built-in voice messaging system (app_voicemail), configured in voicemail.conf with mailboxes per user. greeting flags: b plays the "busy" greeting, u plays the "unavailable" greeting. This gives the caller appropriate 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. about why they reached voicemail.

Tips

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