Caller ID in VICIdial: CID groups and the AREACODE fallback
How the VICIdial dialer picks the number a customer sees, in order, why CID groups work without use_custom_cid, and how to check which number went out.

To the point
A CID group works whether or not use_custom_cid is set. The dialer checks a campaign's cid_group_id on every call unless it is exactly ---DISABLED---. The AREACODE setting only adds an older list, used last.
- Six rules in order, first number wins: list group, list override, campaign group, second group, area-code numbers,
campaign_cid. - A group beats the area-code list. A list-level override beats a campaign-level group.
- Anything other than
---DISABLED---is read as a group name, and a missing group falls through silently. vicidial_dial_cid_logrecords which rule won for every call.
We read AST_VDauto_dial.pl on a ViciBox 12 server and followed the lookup line by line.
The order, from the code

The section runs from about line 2100 to 2330 in the version we read, with the group lookup near 2185 and the AREACODE branch near 2309. Line numbers move between releases, so use them to find the place, not as a promise. A value of Y in use_custom_cid uses the lead's own number field instead.
A group picks the number used least so far today, which spreads volume evenly. Nothing in the lookup judges how a number performs. Watching that is your job.
The off value, and the trap in it
Set it up, step by step
The caller ID fields below are from our test server, campaign SUNQ4.
In VICIdial's admin

- Campaign CallerID (
campaign_cid): a number you own and your carrier will present. The manual's recipes set a real number. - Custom CallerID (
use_custom_cid): leave atNunless you use the legacy area-code list. - CID Group (
cid_group_id): a group that has numbers in it. An empty group falls through. - CID Group Failover (
cid_group_id_two): used when the first group found nothing.
In the Trustane console

- Caller ID group: the same as CID Group.
- Default caller ID: the same as Campaign CallerID.
- Custom caller ID: the legacy switch; leave it Off.
The manual does not check that your carrier will present each number. A number it does not recognize is replaced or fails the call, depending on the carrier (which carrier carried a call).
Seeing which number actually went out
Each outbound call writes a row to vicidial_dial_cid_log, with caller_code, call_date, outbound_cid and outbound_cid_type. The type says which rule won: CAMPAIGN_CID, CID_GROUP, CID_GROUP_TWO, AREACODE, CUSTOM_CID, LIST_CID, LIST_CID_GROUP, AGENT and others.
SELECT outbound_cid_type, COUNT(*) AS calls
FROM vicidial_dial_cid_log
WHERE call_date >= CURDATE()
GROUP BY outbound_cid_type;
If you expect CID_GROUP and see CAMPAIGN_CID, the group is disabled, empty or overridden at list level.
Answer rate per number
Join to vicidial_carrier_log, which holds the carrier's verdict in dialstatus (ANSWER, BUSY, NOANSWER, CANCEL, CHANUNAVAIL, CONGESTION). The obvious join is a trap. The carrier table is indexed on uniqueid, call_date and lead_id, not caller_code, so joining the CID log to it on caller_code scans the carrier table once per call. On about 1.1 million rows each it ran 232 seconds and kept running on the server after we disconnected.
Drive it from the carrier table by date and force the order:
SET STATEMENT max_statement_time=25 FOR
SELECT d.outbound_cid, c.dialstatus, COUNT(*) AS calls
FROM vicidial_carrier_log c FORCE INDEX(call_date)
STRAIGHT_JOIN vicidial_dial_cid_log d ON d.caller_code = c.caller_code
WHERE c.call_date >= NOW() - INTERVAL 7 DAY
GROUP BY d.outbound_cid, c.dialstatus;
That took about 0.6 seconds for 65,000 calls. max_statement_time is MariaDB syntax; MySQL uses the MAX_EXECUTION_TIME hint. Keep a time limit on anything you run against a live dialer. The table is only filled when sip_event_logging is on.
A check before go-live
Place a handful of test calls to phones you control. Compare the five latest vicidial_dial_cid_log rows for the campaign with what each handset showed. If they agree, the dialer side is fine and any later complaint is between the carrier and the receiving network. If they disagree, the carrier changed the number on the way out.
What we did not test
Whether spreading calls over more numbers changes answer rates, and how any carrier or handset treats a number. This post covers the dialer's selection logic, which is deterministic and readable.
Questions people ask
Do I need use_custom_cid set to AREACODE for groups to work?
No. Groups are consulted on every call unless cid_group_id is ---DISABLED---.
Which wins, a campaign group or a list override?
The list-level override.
Next steps
Run the first query on a busy campaign and compare the types with what you intended. Check for placeholder campaign_cid values and empty groups. If calls still fail, see why a campaign is not dialing. On hosted VICIdial we can look over your CID setup: see pricing.
VICIdial is a trademark of its owner. Trustane is an independent hosting provider.
Sources
- Trustane notes on caller ID selection, read from AST_VDauto_dial.pl
- Trustane notes on the VICIdial 2.14 manager manual
- Cover photo by cottonbro studio on Pexels
Managed VICIdial hosting


