Asterisk call queues: members, waiting and overflow
A queue decides which eligible member receives a waiting call and what happens when nobody can take it. Configure those outcomes before spending time on announcements. A queue that plays music but has no viable exit can still be incorrectly configured.
Source-reviewed, 19 October 2026. Prepared from the cited documentation. These examples have not been independently tested by Phone Guides. Scope: Asterisk 22, file-based queue configuration, and existing PJSIP endpoints 6001/6002.
Separate membership from availability
A member is a configured queue destination. That destination may be unavailable, paused or already handling a call. Decide whether membership is static in configuration or managed through the appropriate runtime/application interface, and record who owns changes.
The original example below illustrates static members in queues.conf:
[pg-service]
strategy=ringall
timeout=15
retry=3
member => PJSIP/6001
member => PJSIP/6002
It is intentionally a partial queue policy. It does not select your empty-queue, wrap-up, recording, announcement or maximum-waiting-caller rules. Check the matching release's queue configuration sample before filling those choices. With ringall, eligible members are offered the call together; select another documented strategy only when it matches the intended distribution.
Define the caller's full path
Write down the route into the queue, when the caller is answered, how long members ring, the retry interval and how long the caller may remain. Distinguish a per-member ring timeout from the overall waiting policy. Decide what happens when the queue does not exist, no members are eligible, the configured capacity is reached or the caller leaves.
Use the branch-22 Queue application reference for argument positions and returned state. Queue() does not automatically answer the call. If it returns to the dialplan, the following instructions must handle that return deliberately; an application line by itself is not a complete overflow policy.
This entry example answers first, limits queue time to 45 seconds and disables another timeout retry. The empty arguments keep that limit in Queue()'s fifth position. Replace the unavailable prompt with an installed sound and route it according to the service policy:
[pg-queue-entry]
exten => 6090,1,Answer()
same => n,Queue(pg-service,n,,,45)
same => n,Set(PG_QUEUE_RESULT=${QUEUESTATUS})
same => n,GotoIf($["${PG_QUEUE_RESULT}"="TIMEOUT"]?exit)
same => n,GotoIf($["${PG_QUEUE_RESULT}"="FULL"]?exit)
same => n,GotoIf($["${PG_QUEUE_RESULT}"="JOINEMPTY"]?exit)
same => n,GotoIf($["${PG_QUEUE_RESULT}"="LEAVEEMPTY"]?exit)
same => n,GotoIf($["${PG_QUEUE_RESULT}"="JOINUNAVAIL"]?exit)
same => n,GotoIf($["${PG_QUEUE_RESULT}"="LEAVEUNAVAIL"]?exit)
same => n,GotoIf($["${PG_QUEUE_RESULT}"="CONTINUE"]?exit)
same => n,GotoIf($["${PG_QUEUE_RESULT}"="WITHDRAW"]?exit)
same => n,Hangup()
same => n(exit),Playback(queue-unavailable)
same => n,Hangup()
The example's final Hangup() is the explicit default for any other return, including a nonexistent queue. If the service requires voicemail or another destination, put that approved path at exit and review its access and billing behaviour. ABANDONED is a separate variable for reporting; it is not one of the documented QUEUESTATUS values. A caller who disconnects cannot be sent through the caller's fallback.
Handle results without guessing
| Situation | Design decision |
|---|---|
| No eligible members | Reject, offer a stated fallback or wait under a bounded policy |
| Busy members | Ring-in-use and retry behaviour appropriate to the service |
| Maximum waiting time reached | An explicit destination or message, then a defined end |
| Member paused or logged out | Eligibility and staffing visibility |
| Caller hangs up while waiting | Correct reporting and release of the call |
| Transfer after answer | Reporting and ownership of the subsequent call path |
Inspect QUEUESTATUS and relevant documented variables for the actual return case. Do not treat every return as a timeout. Older examples that include macro arguments need review because removed Macro support affected queue call signatures; use the current reference instead of counting commas in an old book.
Inspect and record the operation
Use the installed CLI's queue help and queue show pg-service to inspect membership, state and waiting callers. Compare runtime membership with the system that owns it before reloading configuration. A deliberate runtime pause is not necessarily a file error.
The official queue log reference describes event records for queue behaviour. Keep queue events separate from general call-detail totals: abandoned and answered paths need different interpretation. Preserve time, queue and correlation identifiers in private evidence, with subscriber details protected.
For your own checks, exercise a normally answered call, no eligible members, a paused member, the overall wait limit and caller abandonment. Verify the defined fallback reaches only authorised destinations. Use voicemail or an auto attendant only after deciding that it is the intended overflow path.
Return to Asterisk documentation.