A calling-hours guard for AI voice agents in the US (with tests)
If your AI voice agent calls web leads back, "when is it allowed to call?" is a code problem as much as a legal one. The agent will happily dial at 10:40 p.m. unless something stops it. This post is that something: a sma
If your AI voice agent calls web leads back, "when is it allowed to call?" is a code problem as much as a legal one. The agent will happily dial at 10:40 p.m. unless something stops it. This post is that something: a small guard function with no dependencies, the rules it encodes, its tests, and the gaps it does not close.
It is a starting point to adapt, not a compliance product. The rules below were checked against their sources on 15 November 2026. Laws change, and none of this is legal advice.
The rules it encodes
The federal rule sets the outer window. Some states narrow it, and some add a cap on how often you can call the same person.
| Where | Window (person's local time) | Cap | Source |
|---|---|---|---|
| Federal | 8 a.m. to 9 p.m. | none | 47 CFR ยง 64.1200(c)(1) |
| Florida | 8 a.m. to 8 p.m. | 3 calls in 24 hours, from any number, same subject | Fla. Stat. ยง 501.616(6)-(7) |
| Maryland | no calls 8 p.m. to 8 a.m. | 3 in 24 hours, "regardless of the telephone numbers used" | Md. Code, Com. Law ยง 14-4502(c) |
| Oklahoma | 8 a.m. to 8 p.m. (an older statute says 9 a.m. to 9 p.m. for synthesized voices) | 3 calls from any number in 24 hours | 15 O.S. ยงยง 775C.4(A), 755.1(C) |
| New York | 8 a.m. to 9 p.m., unless the customer agreed to another time | none found | N.Y. Gen. Bus. Law ยง 399-z(1)(i) |
| Virginia | 8 a.m. to 9 p.m., unless the person gave prior consent | none | Va. Code ยง 59.1-511 |
| Arizona | no window of its own; points to the federal rules | none | A.R.S. ยง 44-1278(B)(6) |
| California | 9 a.m. to 9 p.m., but only for automatic dialing-announcing devices | none | Cal. Pub. Util. Code ยง 2872(c) |
The federal window covers "telephone solicitation", which leaves out calls made with the person's prior express invitation or permission and calls to someone with an established business relationship (47 CFR ยง 64.1200(f)(15)). Whether a callback to someone who just filled in your form falls inside these rules is not answered by the texts. The guard below applies the window to every call anyway. That is the cautious default, and it costs you nothing but a few hours of waiting.
The full table, with every caveat per state, is in our guide to AI voice agent calling hours.
The hard part: whose clock?
Every rule above measures the window at the called person's location or time zone. None of the texts says how a caller is supposed to know where that is.
An area code is a weak signal. A Maryland number can answer in Los Angeles. A form may carry a time-zone guess from the browser, an IP location, or a street address, and they can disagree.
So the guard takes every time zone the person might be in and only allows the call if it is inside the window in all of them. When the signals disagree, the stricter clock wins.
The code
// Calling windows for outbound AI voice calls: the US federal rule plus five state windows.
// Checked against the sources on 15 Nov 2026. Not legal advice. Laws change.
const RULES = {
// 47 CFR 64.1200(c)(1): no telephone solicitation before 8 a.m. or after 9 p.m. at the called party's location
FEDERAL: { start: 8, end: 21 },
// Fla. Stat. 501.616(6)-(7): 8 a.m. to 8 p.m. in the called person's time zone, max 3 calls in 24 h on the same subject
FL: { start: 8, end: 20, maxPer24h: 3 },
// Md. Code, Com. Law 14-4502(c): no calls 8 p.m. to 8 a.m., max 3 in 24 h "regardless of the telephone numbers used"
MD: { start: 8, end: 20, maxPer24h: 3 },
// 15 O.S. 775C.4(A): 8 a.m. to 8 p.m., max 3 calls from any number in 24 h. An older statute,
// 15 O.S. 755.1(C), uses 9 a.m. to 9 p.m. for devices with a prerecorded or synthesized voice;
// nothing we read reconciles the two, so an AI voice gets the overlap: 9 a.m. to 8 p.m.
OK: { start: 9, end: 20, maxPer24h: 3 },
// N.Y. Gen. Bus. Law 399-z(1)(i): 8 a.m. to 9 p.m. at the customer's location
NY: { start: 8, end: 21 },
// Va. Code 59.1-511: 8 a.m. to 9 p.m. at the contacted person's location, unless they gave prior consent
VA: { start: 8, end: 21 },
// Arizona has no window of its own and points to the federal rules; California's 9-to-9 rule covers
// automatic dialing-announcing devices only. Both fall back to FEDERAL here.
};
// Local hour and minute in a time zone, using the built-in Intl API (no libraries).
function localTime(date, timeZone) {
const parts = new Intl.DateTimeFormat("en-US", {
timeZone, hour: "2-digit", minute: "2-digit", hourCycle: "h23",
}).formatToParts(date);
const get = (type) => Number(parts.find((p) => p.type === type).value);
return { hour: get("hour"), minute: get("minute") };
}
// state: two-letter code of the lead's state. zones: every time zone the lead might be in
// (area code, form IP, street address). callsLast24h: calls already made to this person, from any number.
export function canCallNow({ state, zones, now = new Date(), callsLast24h = 0 }) {
const rule = RULES[state] ?? RULES.FEDERAL;
const start = Math.max(rule.start, RULES.FEDERAL.start);
const end = Math.min(rule.end, RULES.FEDERAL.end);
if (rule.maxPer24h !== undefined && callsLast24h >= rule.maxPer24h) {
return { ok: false, reason: `${state}: already ${callsLast24h} calls in 24 hours (limit ${rule.maxPer24h})` };
}
// The rules measure the clock where the person is, and no text says how a caller learns that.
// So the call must be inside the window in every zone the person could be in.
for (const zone of zones) {
const { hour, minute } = localTime(now, zone);
const minutes = hour * 60 + minute;
if (minutes < start * 60 || minutes >= end * 60) {
return { ok: false, reason: `${zone} is ${String(hour).padStart(2, "0")}:${String(minute).padStart(2, "0")}, outside ${start}:00-${end}:00` };
}
}
return { ok: true, reason: `inside ${start}:00-${end}:00 in ${zones.join(", ")}` };
}
A few choices worth knowing:
- The window end is exclusive. The federal text says "after 9 p.m.", so 21:00 itself is arguably fine. The guard stops at 21:00 to keep a margin.
- The cap counts calls from any number. Maryland says so outright, and Florida and Oklahoma say "from any number". Count per person, not per caller ID.
- Consent overrides are not implemented. New York and Virginia allow other times with the person's consent. Wire that in only if you store that consent in a way you can show later.
- Oklahoma gets 9 a.m. to 8 p.m. Its 2022 act says 8 to 8, an older statute on prerecorded or synthesized voices says 9 to 9, and we read nothing that reconciles them. An AI voice gets the overlap of both.
- Unknown states fall back to federal. That is a floor, not a guarantee: the table covers seven states, not fifty.
Tests
The edges are where this breaks, so the tests sit on them. 2026-12-07 is in Eastern Standard Time (UTC-5).
import { canCallNow } from "./calling-window.mjs";
const at = (iso) => new Date(iso);
const call = (state, zones, iso, callsLast24h = 0) =>
canCallNow({ state, zones, now: at(iso), callsLast24h }).ok;
// Florida, Eastern time: 07:59 blocked, 08:00 allowed, 19:59 allowed, 20:00 blocked
console.assert(call("FL", ["America/New_York"], "2026-12-07T12:59:00Z") === false);
console.assert(call("FL", ["America/New_York"], "2026-12-07T13:00:00Z") === true);
console.assert(call("FL", ["America/New_York"], "2026-12-08T00:59:00Z") === true);
console.assert(call("FL", ["America/New_York"], "2026-12-08T01:00:00Z") === false);
// Florida cap: the fourth call in 24 hours is blocked
console.assert(call("FL", ["America/New_York"], "2026-12-07T15:00:00Z", 3) === false);
// Phoenix time has no daylight saving, and Arizona uses the federal window
console.assert(call("AZ", ["America/Phoenix"], "2026-12-08T03:30:00Z") === true); // 20:30
console.assert(call("AZ", ["America/Phoenix"], "2026-12-08T04:05:00Z") === false); // 21:05
// Maryland number, but the form came from Los Angeles:
// 18:30 in LA is 21:30 in New York, so the stricter clock blocks it
console.assert(call("MD", ["America/New_York", "America/Los_Angeles"], "2026-12-08T02:30:00Z") === false);
// Summer: New York is UTC-4, so 12:00Z is 08:00 local
console.assert(call("FL", ["America/New_York"], "2026-07-01T12:00:00Z") === true);
Our full test file has 18 cases, including New York's 9 p.m. edge, Oklahoma's 9 a.m. start and a state the table does not cover. All 18 pass on Node 26. Node has shipped full time-zone data for Intl by default for years, but check that your runtime has it.
What this does not do
- Consent. In 2024 the FCC ruled that AI-generated voices count as artificial voices under the TCPA (FCC 24-17). Such calls need the person's prior express consent, and written consent if the call is telemarketing. A clock cannot check that. Your form and your records have to.
- Holidays and Sundays. The guard has no day-of-week or holiday rules. Check whether the states you call add any.
- Other overlapping statutes. We handled the one overlap we found (Oklahoma). There may be others in laws we did not read.
- The other forty-odd states. The federal floor is not their whole rulebook.
The state-by-state detail behind the table, with sources, is on our AI voice agent state guides.
Halyard Ops is a new AI and software studio. This post was drafted by an AI model from the linked primary sources and our own guides, and its code was run and tested before publishing; it was not written by a person. Halyard Ops directs the work and publishes it. This is general information, not legal advice.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.