Enqueue

Enqueue

The enqueue command places a caller into a queue.

{
  "verb": "enqueue",
  "name": "support",
  "actionHook": "/queue-action",
  "waitHook": "/queue-wait"
}

You can use the following attributes with the enqueue command:

Option Description Required
name Name of the queue. Yes
priority (Added in 0.8.3-4) Optional priority value between 0 and 999. Calls are dequeued in priority order, lowest to highest. No (default: 999)
actionHook A webhook to invoke when the operation completes. If a call is dequeued through the leave verb, the webhook is immediately invoked. If the call has been bridged to another party via the dequeue verb, the webhook is invoked after both parties have disconnected. If no webhook is provided, execution will continue with the next verb in the current application. See below for specified request parameters. No
waitHook A webhook to invoke while the caller is in the queue. The only allowed verbs in the application returned from this webhook are say, play, pause, and leave. See below for additional request parameters. No

The actionHook webhook will contain the following additional parameters:

  • queueSid: The unique identifier for the queue.
  • queueResult: The completion reason:
    • 'hangup' – The call was abandoned while in the queue.
    • 'leave' – A leave verb caused the call to exit the queue.
    • 'bridged' – A dequeue verb caused the call to be bridged to another call.
    • 'error' – A system error of some kind occurred.
  • queueTime – The number of seconds the call spent in the queue.
  • queueSize – The number of calls remaining in the queue.
  • queuePosition – The zero-based position of the call in the queue before it was removed.
  • callSid – The unique identifier for the call.
  • callId – The SIP Call-ID for the call.

The waitHook webhook will contain the following additional parameters:

  • queueSid: The unique identifier for the queue.
  • queuePosition: The current zero-based position in the queue.
  • queueTime: The current number of seconds the call has spent in the queue.
  • queueSize: The current number of calls in the queue.

You can also optionally receive queue webhook notifications any time a member joins or leaves a queue.

Ready To Get Started?