DeskCaller
Craft

A Screening Ruleset for Spam Calls to an AI Agent

Aneeq Iftikhar
Aneeq Iftikhar · Senior Software Engineer, DeskCaller
· 8 min read
Spam call screening ruleset, cover reading 'Nine rules, and what each one blocks by mistake' above 'screening spam calls to an AI agent', beside a glowing blue line-art telephone handset behind a filter grid, with one call passing through in blue and one stopped in red

A human receptionist hangs up on a recorded sales call in about four seconds. An AI agent, unless you tell it otherwise, will be courteous to a robot for two minutes and you will be billed for every second.

Using Retell's published per-minute components, a mid-range configuration is $0.055 voice infrastructure plus $0.015 platform TTS plus $0.045 for GPT-4.1 plus $0.015 telephony, which is $0.130 a minute. Our arithmetic, not their figure: a two-minute spam call costs about 26 cents, and at the top of Retell's own published $0.07 to $0.31 range it is 62 cents. Prices read 5 September 2026.

That is the whole argument for screening, and also the limit of it. Below is what to configure, in order, with the setting names where they exist. Each rule ends with who it blocks by mistake, because a screening rule that turns away real customers is worse than the spam it stopped.

Rule 1. Register the line with the Corporate TPS

Not the consumer TPS. The Corporate TPS is the statutory opt-out register for organisations, and it is free. Registration takes 28 days to take legal effect, so this is a today job that starts working next month.

It matters because it converts nuisance into enforceable breach. PECR regulation 21 prohibits unsolicited marketing calls where "the number allocated to a subscriber in respect of the called line is a number listed" on the register, or where the subscriber has told the caller to stop. Once you are listed, a marketing call is a contravention rather than an irritation.

Blocks by mistake: nothing. There is no downside.

Rule 2. Know that most automated spam is already illegal

PECR regulation 19 bans recorded-message marketing outright without prior consent: a person "shall neither transmit, nor instigate the transmission of, communications comprising recorded matter for direct marketing purposes by means of an automated calling or communication system" except with consent. It also requires the caller not to prevent presentation of their line identity.

So the recorded voice pitching solar panels is not in a grey area. And the penalty ceiling moved: PECR breaches now attract up to £17.5m or 4% of worldwide turnover, since Schedule 1 was substituted on 5 February 2026 under the Data (Use and Access) Act 2025. That is worth knowing when you decide whether to report a persistent caller.

Blocks by mistake: nothing, it is a reporting route rather than a filter.

Rule 3. Do not build spoofing defences your provider already owes you

Ofcom General Condition C6.6 requires that "Where technically feasible, Regulated Providers must: (a) take all reasonable steps to identify calls, other than calls to Emergency Organisations, in relation to which the CLI Data provided is invalid, does not uniquely identify the caller, or does not contain a Telephone Number that is dialable; and (b) prevent those calls from being connected to the called party".

That duty sits on communications providers, not on you. Before you build anything, ask your provider what it blocks upstream.

A sourcing note, because General Conditions get renumbered. We read that text in Ofcom's unofficial consolidated General Conditions, version with effect from 17 January 2025, retrieved from the Internet Archive because ofcom.org.uk refuses automated requests. Ofcom has consolidated again since. Check the current version before relying on the condition number.

One thing to be precise about: the UK does not operate STIR/SHAKEN. The UK mechanism is the Do Not Originate list, run with UK Finance since 2019, covering numbers that organisations use to receive calls but never to make them. Ofcom is explicit that it is not comprehensive.

Blocks by mistake: not applicable, but see rule 9.

Rule 4. Set a silence timeout, the cheapest signal you have

No classifier, no lookup, no extra latency. If nobody speaks, end the call. Twilio's <Gather> has timeout, default 5 seconds, plus speechTimeout, and actionOnEmptyResult defaulting to false. Vapi exposes a silence timeout and reports silence-timed-out as an endedReason.

Dead air is the signature of an autodialler that has not connected an agent, and it costs nothing to detect.

Blocks by mistake: a caller who needs longer to speak. Set it generously, 8 to 10 seconds rather than 3, and never combine a tight silence timeout with a tight speech threshold.

Rule 5. Turn on voicemail and machine detection, then read the small print

Retell documents voicemail and IVR detection at "under 30ms" of added latency, with voicemail_reached and ivr_reached as disconnection reasons, but it runs only for the first three minutes of a call. Vapi's voicemail detection has beepMaxAwaitSeconds, default 30, range 0 to 60, with a documented warning that going below 15 to 20 seconds truncates your message.

Twilio's answering machine detection is the mature implementation and its tunables are worth knowing: MachineDetectionTimeout 3 to 59 seconds, default 30; MachineDetectionSpeechThreshold 1000 to 6000ms, default 2400; MachineDetectionSpeechEndThreshold 500 to 5000ms, default 1200; MachineDetectionSilenceTimeout 2000 to 10000ms, default 5000.

Two caveats before you trust it. Twilio documents roughly four seconds of latency at default settings and warns that tightening it degrades accuracy. And the 94% accuracy figure everyone quotes is from a blog post dated March 2017, covers the US and Canada only, and publishes no methodology. Do not carry it into a UK deployment as a current number.

Blocks by mistake: a caller who pauses before speaking, and a slow-answering switchboard. Four seconds of silence at the top of every call is also a real cost to your genuine callers.

Rule 6. Do the arithmetic before you add latency

Screening is not free. If you add a four-second check to every inbound call to save a two-minute spam call, the break-even is where 4 seconds times all calls equals 120 seconds times spam calls, which is a spam rate of 3.3%. Our arithmetic, and the 120 seconds is an assumption rather than a measured figure.

So the question is not "is spam annoying" but "is more than one call in thirty spam". Below that, per-call screening latency costs you more than it saves, and you are better off with rules 1, 4 and 9 alone.

Blocks by mistake: nothing, this is the rule that stops you over-applying the others.

Rule 7. Measure your own rate before tuning anything

The published figures do not describe your line. Hiya reported 32% of unknown UK calls flagged as spam in Q4 2024, but that is measured on consumer handsets, as a share of calls from numbers not in the person's address book. It says nothing about a business line, and the same reporting also quotes 3% fraud and 29% nuisance as shares of all calls, a different denominator. The two framings cannot be combined.

Use your own platform's termination reasons instead. Vapi exposes silence-timed-out, voicemail, exceeded-max-duration and an assistant-received-no-audio error. Count those over a fortnight and you have your real rate, from billing data you already pay for.

Blocks by mistake: nothing.

Rule 8. Never block on withheld number alone

This is the rule most likely to be got wrong, and the evidence against it is unusually direct.

Derbyshire Healthcare NHS Foundation Trust stopped calling patients from withheld numbers and moved to a published number, saying "Some people have phones that don't allow 'withheld numbers' to get through, to stop nuisance cold calling." The IOPC issued a formal recommendation to Avon and Somerset Constabulary after officers called a family with caller ID withheld during a threat-to-life incident, and the family could not call back.

There is also a technical distinction worth understanding. BT's Anonymous Call Rejection blocks numbers deliberately withheld, but not numbers presenting as merely unavailable, which is how many international and interconnect calls arrive. Withheld and unavailable are different states and a naive rule treats them as one.

Blocks by mistake: hospitals, GP surgeries, police, and any caller behind a switchboard that presents nothing useful.

Rule 9. Allowlists must not be your only route in

If you allowlist known numbers and treat everything else as suspect, you will block Relay UK. Calls through the relay service present the relay TextNumber, not the disabled caller's own number: "If they have a caller display unit, they'll see the TextNumber."

That is not merely unhelpful. Relay UK's own guidance states that "refusing to take calls from disabled people that involve a third party, is likely to be a breach of the Equality Act." Section 29 of the Equality Act 2010 puts a direct duty on a service provider not to discriminate in providing a service, and section 29(7) applies the duty to make reasonable adjustments.

Blocks by mistake: deaf and speech-impaired callers, which is the one category where getting it wrong is also unlawful. Any screening rule needs a path where an unrecognised caller can still reach a human.

The order to apply them

  1. CTPS registration, today, because of the 28-day delay.
  2. Ask your provider what it already blocks under C6.6.
  3. Silence timeout, generous.
  4. Measure your actual spam rate for a fortnight from termination reasons.
  5. Only if that rate exceeds roughly 3%, add machine detection and accept its four seconds.
  6. Never block on withheld alone, and always leave a route for an unrecognised caller.

If your own outbound number gets wrongly labelled as spam, that is the mirror image of this problem and the remedy is with the labelling companies rather than a regulator. Hiya, which supplies spam labelling to UK operators, runs a free number registration service and a one-time review for numbers flagged in error.

The related question of what the agent should do with a caller it cannot identify, as opposed to one it wants to reject, is in the transfer guide.

🎙️ Talk to Our AI Agent

Try it now - it's live!