Hold Lead Auto Dialer

Outbound hold-queue auto dialer on Asterisk.

CRM pushes leads into hold_dialer_master_data. Agents join a Socket.IO panel. One process claims rows, originates through AMI, and settles hangups. Mode is Progressive or Predictive from hold_dialer_config. PSTN inbound stays on FreePBX.

Any idle agent No master agent pin AMI originate Outbound only

How the pieces fit

HTTP APICRM upserts leads, closes tickets, schedules callbacks. Does not originate.
Socket hubAgent ready/pause, dashboard snapshot, dialer phases.
EnginesProgressive: one call per idle agent. Predictive: customer first, then any idle agent.
AMIDevice state, originate, bridge, MOH. Shared AMI_CALLERID. No inbound park.

Roster is hold_dialer_employee for module_id = hold_dialer. Skills are unused. form_type is stored for CRM/logging only. AMI only tracks roster extensions. Config reloads every 30 seconds; switching dialer_type waits until the floor is idle.

Life of a lead

  1. CRM POST /api/leads upserts by oli_id. Status is Pending, or Callback if a callback priority has a time.
  2. Any idle ready agent claims the row: Calling, reserved. call_count does not increment here.
  3. Progressive originates the agent channel with shared AMI_CALLERID. Predictive originates the customer Local channel, then bridges any idle agent on answer.
  4. Hangup writes hold_dialer_call_attempts (that is where the agent is stored).
  5. Not Connected retries on [2,2,2,2]. Abandoned retries in 5 minutes. At 8 NCs the row moves to hold_dialer_disposed.

Master has no agent_id column. Sending it on the API is a 400. Connected agent is on hold_dialer_call_attempts only. Agent SIP phones never show the customer number.

Dial status

StatusMeaningClaimed again?
PendingIn the poolYes, any idle agent
CallbackWaiting on callback_scheduled_atWhen due, any idle agent
CallingReserved, originate in flightNo
ReceivedTalkedNo (unless redial)
Not ConnectedNo answer / busy / congestionAfter [2,2,2,2] next_retry_at
AbandonedCustomer left while waiting (predictive)After 5 minutes
RejectedCancel / invalid / reject causeNo
DisposedNC cap or CRM CloseNo — archived off master

Tables this process owns

TableRole
hold_dialer_employeeRoster, panel pause/active. Skills unused for claim
hold_dialer_configMode, wrap, ratio, retry, hours
hold_dialer_priorityQueue order, callback flag (id 2)
hold_dialer_master_dataWorking leads. No agent pin
hold_dialer_disposedFinal Disposal archive
hold_dialer_call_attemptsEvery settle, with agent + hold seconds
hold_dialer_agent_declinesSIP deny on a live hold
hold_dialer_agent_pausesPanel pause intervals

What this dialer does not do