Overview
In-house outbound and inbound dialer on Asterisk.
CRM pushes leads into sales_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 sales_dialer_config. Inbound PSTN is always on.
How the pieces fit
Roster is sales_dialer_employee for module_id = sales-dialer. Skills JSON must include the lead form_type. Optional priority_ids allowlist lead priority_id (empty = all). Auto-claim needs skill and priority on the same agent. AMI only tracks those extensions. Config reloads every 30 seconds; switching dialer_type waits until the floor is idle.
Engine
Progressive Agent-first AMI originate. One live outbound per desk. Guide →Engine
Predictive Customer-first Local originate, ratio pacing, unlimited hold, decline cooldown. Guide →PSTN
Inbound Park on hold music, look up by phone, offer a skilled idle agent. Blocks outbound on that desk. Guide →Lead type
Callback Time gate on callback priorities. Matching skill + priority when due (sticky pins optional). CRM pending callbacks and dispositions. Guide →Shared
Settle & retry Hangup map, claim order (fresh Fresh Assign before a fresh Callback), placement modes (redial/sticky/untouched fresh = progressive place), fresh lead allotment cap, wrap, attendance sessions, missed activities. Guide →Reference
HTTP API Auth, lead push (form_group), callbacks / dispositions, missed activities, login/logout sessions, pause reasons, health.
Guide →
Life of a lead
- CRM
POST /api/leadsupserts byoli_idand mints a newdata_id(returned on the 201). Status is Pending, or Callback if a callback priority has a time. - An idle ready agent with matching skill and priority allowlist claims the row:
Calling, reserved.call_countdoes not increment here. A fresh Fresh Assign drains before a fresh Callback; Not Connected stays after those — see Claim order. - Auto-dial: Progressive originates the agent channel first; Predictive originates the customer Local, then bridges a skilled agent. Socket redial / On demand, sticky, and untouched Fresh Assign always use agent-first progressive place — even on a Predictive floor. See Placement modes.
- Fresh allotment: an untouched Fresh Assign lead is allotted to the agent on the first both-way connect (the customer answers and is bridged). The row goes to
sales_dialer_lead_allotmentsand counts against the agent's dailyfresh_lead_limit(IST day;NULLunlimited,0none,Nmax). Ringing the agent alone does not allot. See Fresh lead allotment. - Hangup settles master + a row on
sales_dialer_call_attempts(agent, attemptcall_type=outgoing/incoming/redial, and the masterdata_idat settle). Floor badgestatus.call_typestays Progressive / Predictive. - Not Connected retries on
retry_patternuntilmax_tries. Abandoned is not on that cycle. Received / Rejected / Disposed stop unless socket redial, a new CRM push, or a CRM pending callback. Redial NC does not bumpcall_count. - After a bridged outgoing / redial call the agent has
MISSED_ACTIVITY_GRACE_MINUTES(default 10) to store a callback or disposition from the CRM. Otherwise outbound is paused (inbound still rings). See Missed activities. - Attendance: Ready opens
sales_dialer_agent_sessions; Logout / midnight day-reset close them. Report:GET /api/agent-sessions.
Master has no general agent_id column on push (400 if sent). Connected agent is on sales_dialer_call_attempts only. Optional sticky pins come from pending-callbacks — see Stickiness.
Dial status
| Status | Meaning | Claimed again? |
|---|---|---|
| Pending | In the pool | Yes, skill + priority allowlist |
| Callback | Waiting on callback_scheduled_at | When due, skill + priority allowlist |
| Calling | Reserved, originate in flight | No |
| Received | Talked | No (unless redial) |
| Not Connected | No answer / busy / congestion | After retry_pattern / retry_seconds |
| Abandoned | Customer left while waiting (predictive / inbound) | After retry_seconds (or existing next_retry_at) |
| Rejected | Cancel / invalid / reject cause | No (unless redial) |
| Disposed | NC cap, or CRM final disposition | No unless redial, a new CRM push, or a CRM pending callback |
Tables this process owns
| Table | Role |
|---|---|
sales_dialer_employee | Roster, skills, priority_ids, panel pause/active |
sales_dialer_config | Mode, wrap, ratio, retry, hours, isMaintainance |
sales_dialer_priority | Queue order, callback flags |
sales_dialer_master_data | Leads. No agent pin |
sales_dialer_call_attempts | Every settle, with agent, hold seconds, master data_id snapshot, previous_dial_status (master at claim), call_type (outgoing / incoming / redial), and system work_status / sub_disposition on NC / Abandoned / Rejected |
sales_dialer_agent_declines | SIP deny on a live hold (same call_type values) |
sales_dialer_agent_pauses | Panel pause intervals |
sales_dialer_agent_sessions | Login / logout attendance (logged_in_at / logged_out_at) |
sales_dialer_api_call_log | Hangup webhook posts |
sales_dialer_after_hours_calls | After-hours DID misses (announce path only) |
sales_dialer_pending_callbacks | CRM callbacks / final dispositions held until the live call settles |
sales_dialer_missed_activities | Bridged outgoing / redial calls awaiting a CRM callback or disposition (outbound block) |
What this dialer does not do
- Pin a lead to one employee on master.
- Cap hold time (
hold_timeout_secondsis unused leftover). - Apply a drop-rate brake (
max_abandon_rateis unused). - Originate through
call.php. - Count Abandoned toward
max_tries. - Hang a live call when maintenance turns on (only new originates / redials / inbound offers stop).