<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Voip on Nelson Chen's Blog</title><link>https://mindflakes.com/tags/voip/</link><description>Recent content in Voip on Nelson Chen's Blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>Copyright Nelson Chen</copyright><lastBuildDate>Wed, 20 May 2026 19:30:00 -0700</lastBuildDate><atom:link href="https://mindflakes.com/tags/voip/index.xml" rel="self" type="application/rss+xml"/><item><title>Blocking spammy caller names with VoIP.ms Call Hunting</title><link>https://mindflakes.com/posts/2026/05/20/voip-ms-caller-name-blocker/</link><pubDate>Wed, 20 May 2026 19:30:00 -0700</pubDate><guid>https://mindflakes.com/posts/2026/05/20/voip-ms-caller-name-blocker/</guid><description>&lt;p&gt;I made a small &lt;a href="https://github.com/nelsonjchen/cname_blocker_voip"&gt;Rust VoIP.ms CNAME blocker&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The short version is that I wanted to block a caller by name instead of by phone number.&lt;/p&gt;
&lt;p&gt;This sounds like it should be a normal checkbox somewhere. It is not.&lt;/p&gt;
&lt;h2 id="the-missing-filter"&gt;The missing filter&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://voip.ms/"&gt;VoIP.ms&lt;/a&gt; has a pretty capable &lt;a href="https://wiki.voip.ms/article/CallerID_Filtering"&gt;CallerID Filtering&lt;/a&gt; feature. You can filter on specific caller ID numbers, phone book groups, anonymous callers, calls that do not match the North American number format, STIR/SHAKEN attestation level, and wildcard patterns like area-code-ish blocks.&lt;/p&gt;
&lt;p&gt;That is all useful. Unfortunately, it is also very number-shaped.&lt;/p&gt;
&lt;p&gt;There are callers where the number is not the stable part. The useful part is the caller ID.&lt;/p&gt;
&lt;p&gt;VoIP.ms even has a blog post on &lt;a href="https://voip.ms/blog/how-to-stop-spam-calls-voip/"&gt;stopping spam calls&lt;/a&gt; that frames call filtering around numbers, area codes, and anonymous caller status. In the same post, CNAM is described as a way to identify callers before picking up. The &lt;a href="https://wiki.voip.ms/article/Caller_ID"&gt;Caller ID wiki page&lt;/a&gt; also describes incoming Caller ID name lookup as an optional per-DID setting that can display a caller name for US and Canadian callers.&lt;/p&gt;
&lt;p&gt;That is helpful! But identifying a caller and filtering a caller are not the same thing.&lt;/p&gt;
&lt;p&gt;There is also a &lt;a href="https://community.voip.ms/t/blocking-based-on-caller-id/2883"&gt;VoIP.ms Community Forum thread&lt;/a&gt; where someone asked for exactly this: blocking repeated callers by CNAME/CNAM because the caller used a pile of different numbers. A VoIP.ms staff reply said the feature had been suggested before and that there was no ETA.&lt;/p&gt;
&lt;p&gt;So, yes, this is apparently not just me being weird. At least not uniquely weird.&lt;/p&gt;
&lt;h2 id="the-call-hunting-trick"&gt;The Call Hunting trick&lt;/h2&gt;
&lt;p&gt;VoIP.ms has another feature called Call Hunting. The normal idea is that a DID can try multiple destinations in order. If the first one does not take the call, the next one gets a shot.&lt;/p&gt;
&lt;p&gt;So I made a tool that registers to VoIP.ms as a normal SIP endpoint and sits first in a Call Hunting group. It looks at the incoming caller name and then does one of two things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If the caller does not match the block list, it rejects the call with &lt;code&gt;486 Busy Here&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If the caller matches the block list, it answers, plays SIT tones plus a disconnected-style message, and hangs up.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;code&gt;486 Busy Here&lt;/code&gt; part is the whole trick. For normal calls, VoIP.ms treats the first destination as busy and keeps going to the next Call Hunting member, which is the real phone path. The blocker gets out of the way.&lt;/p&gt;
&lt;p&gt;For blocked calls, the blocker answers the call. Once it answers, the hunt stops. My actual phone never rings.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s a bit of a hack, but it is a nice kind of hack. No inbound port forwarding. No PBX to babysit. Just a small SIP endpoint with one job.&lt;/p&gt;
&lt;h2 id="why-twilio-lookup-got-involved"&gt;Why Twilio Lookup got involved&lt;/h2&gt;
&lt;p&gt;The original simple version matched the caller name that VoIP.ms delivered in the SIP call.&lt;/p&gt;
&lt;p&gt;Then reality did the thing where the one field you want is not the field you get.&lt;/p&gt;
&lt;p&gt;For the PCH-style caller I cared about, the VoIP.ms-provided name showed up as a generic city/state-style value. That is not useful enough to block on. Meanwhile, T-Mobile Caller ID showed &lt;code&gt;PCH&lt;/code&gt; for the same number.&lt;/p&gt;
&lt;p&gt;Searching around for &lt;code&gt;PCH&lt;/code&gt; points pretty quickly at Publishers Clearing House, and also at a lot of scam context. &lt;a href="https://scamreport.pch.com/"&gt;PCH has its own scam-report page&lt;/a&gt; saying scammers misuse the PCH name to pretend people won prizes and demand money or personal information. The &lt;a href="https://consumer.ftc.gov/consumer-alerts/2023/12/hang-pch-impersonators"&gt;FTC also has an alert&lt;/a&gt; specifically about PCH impersonators.&lt;/p&gt;
&lt;p&gt;That does not prove T-Mobile and Twilio are using the same database. CNAM is messy enough that I do not want to pretend certainty here. But it did suggest there was a better name source out there than the one I was getting through VoIP.ms.&lt;/p&gt;
&lt;p&gt;So I added optional &lt;a href="https://www.twilio.com/docs/lookup/v2-api"&gt;Twilio Lookup&lt;/a&gt; support. If configured, the blocker can ask Twilio for the caller name and match against that instead. If Twilio does not return a useful name or the lookup fails, the call is allowed through.&lt;/p&gt;
&lt;p&gt;The matching itself is intentionally boring:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;BLOCK_CNAME_PATTERNS&lt;span style="color:#f92672"&gt;=&lt;/span&gt;pch
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Those patterns are case-insensitive and match on token boundaries, so &lt;code&gt;pch&lt;/code&gt; can match &lt;code&gt;PCH&lt;/code&gt; without accidentally matching some longer unrelated word. There is also a regex option for stranger cases.&lt;/p&gt;
&lt;h2 id="the-repo"&gt;The repo&lt;/h2&gt;
&lt;p&gt;The project is here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nelsonjchen/cname_blocker_voip"&gt;https://github.com/nelsonjchen/cname_blocker_voip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It is not trying to be a complete PBX. It is a narrow little tool:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;register outbound to VoIP.ms&lt;/li&gt;
&lt;li&gt;inspect caller name information&lt;/li&gt;
&lt;li&gt;optionally use Twilio Lookup&lt;/li&gt;
&lt;li&gt;let normal calls continue through Call Hunting&lt;/li&gt;
&lt;li&gt;answer only blocked-name calls&lt;/li&gt;
&lt;li&gt;play a local disconnected message&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It is written in Rust, and I deployed it to my TrueNAS box. Resident memory is around 5 MB, which is very satisfying for something that just needs to sit there, stay registered, and be boring until the wrong call shows up.&lt;/p&gt;
&lt;p&gt;I also got a lot of it written with Codex 5.4 Medium. This is a good kind of Codex project: small enough to keep in my head, annoying enough that I did not want to hand-type every SIP-shaped detail myself, and testable enough that I could keep it from becoming pure vibes.&lt;/p&gt;
&lt;p&gt;The README has the actual setup steps.&lt;/p&gt;
&lt;p&gt;The tests do not need real VoIP.ms credentials either. There is a local fake registrar/integration test path that sends matching and non-matching calls, checks that blocked calls get answered, checks that normal calls get &lt;code&gt;486 Busy Here&lt;/code&gt;, and verifies RTP audio makes it through. That made this feel a lot less like a pile of SIP hope.&lt;/p&gt;
&lt;p&gt;Anyway, it works for the annoying thing I wanted to stop.&lt;/p&gt;
&lt;p&gt;I still think VoIP.ms should offer caller-name filtering directly. Until then, this tiny weird SIP detour is doing the job.&lt;/p&gt;</description></item></channel></rss>