Skip to content

Demo Part 1 Step 1 Trunk to Queue Basic

Andrey Egorov edited this page May 18, 2026 · 2 revisions

Import: part-1-step-1-trunk-to-queue-basic.json

Goal

Complete the smallest queue scenario:

  • answer an inbound trunk call
  • let the caller choose Support or Sales
  • place the caller into the selected queue
  • play hold music and periodic queue-position prompts
  • dispatch directly to a live agent
  • play a plain offline announcement if nobody is online

What This Example Completes

  • queue placement
  • queue Placed, Dispatch, and Offline handling
  • a stable hold loop
  • direct agent bridge from queue dispatch

Why This Works

  • put_support and put_sales place the current caller leg into the daemon-owned queue, so queue events later refer to the same live caller.
  • play_music runs in background mode, so hold music can continue while queue_stat and play_stat run on top of it.
  • wait_music_loop is a 30-second call.wait with Interrupt On = call_queue_removed. It acts as the queue timer, but also stops quietly if the queue engine has already removed the caller from live waiting.
  • the Interrupted branch of wait_music_loop is intentionally empty. Once queue has removed the caller, the loop must not continue into another queue stats cycle.
  • wait_agent is dial-scoped only. It does not use Master Leg ID, because queue itself already owns caller-leg cleanup and aborts the queue dial if the caller disappears.
  • bridge_agent uses the queued caller leg from dispatch_entry, so the dispatch branch can bridge the agent directly to the live waiting caller without callback logic.
  • play_offline has Stop Other Media = true, so hold music is removed before the offline announcement starts.

How to Test

  1. Import the workflow.
  2. Activate it.
  3. Register queue agents from internal.
  4. Place a trunk call.
  5. Press 1 for Support or 2 for Sales.

Expected Result

Situation Result
agent becomes available queued caller is bridged directly to the agent
queue stays busy caller hears hold music and queue-position prompts
no online representatives caller hears the plain offline announcement

What The Next Example Adds

Part 1 / Step 2 keeps the same queue core and replaces the plain offline announcement with an AI handoff.

Clone this wiki locally