<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Automation | Ukant Jadia</title><link>https://ukantjadia.github.io/tag/automation/</link><atom:link href="https://ukantjadia.github.io/tag/automation/index.xml" rel="self" type="application/rss+xml"/><description>Automation</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Thu, 12 Nov 2026 18:30:00 +0530</lastBuildDate><image><url>https://ukantjadia.github.io/media/icon_hu5e29e1df12b63ca0c9252c8db4842f1b_8915_512x512_fill_lanczos_center_3.png</url><title>Automation</title><link>https://ukantjadia.github.io/tag/automation/</link></image><item><title>The Dialer That Calls First</title><link>https://ukantjadia.github.io/post/dialer-that-calls-first/</link><pubDate>Thu, 12 Nov 2026 18:30:00 +0530</pubDate><guid>https://ukantjadia.github.io/post/dialer-that-calls-first/</guid><description>&lt;p>Our calling team has 10 to 15 people. Before the dialer, the whole team got about 60 to 70 calls a week where someone picked up.&lt;/p>
&lt;p>Now the same team has 130 to 150 real conversations a week.&lt;/p>
&lt;p>I&amp;rsquo;m a backend engineer and team lead at Caprae Capital, an M&amp;amp;A firm that helps buyers find small businesses to buy. I built the dialer. This post covers what it does, the two mistakes in its first version, and a small piece of code you can reuse.&lt;/p>
&lt;h2 id="the-problem-half-the-list-goes-nowhere">The problem: half the list goes nowhere&lt;/h2>
&lt;p>A cold-call list looks like a full day of work. A lot of it is empty. Kevin Hong, our CEO, has written publicly that about 20% of the numbers on a list are dead and another 30% go straight to voicemail.&lt;/p>
&lt;p>That means a caller can spend half the day on rings, voicemail greetings and &amp;ldquo;this number is not in service&amp;rdquo; before a single owner says hello.&lt;/p>
&lt;h2 id="what-the-dialer-does">What the dialer does&lt;/h2>
&lt;p>Our callers work in one-hour blocks. Before a block starts, the whole list, about 1,000 numbers, goes through the dialer.&lt;/p>
&lt;p>The dialer calls every number first. It listens to the first few seconds of each call and puts the number in one group:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Group&lt;/th>
&lt;th>What happens next&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>A person answered&lt;/td>
&lt;td>Goes to a caller&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Switchboard or front desk&lt;/td>
&lt;td>Goes to a caller, who asks for the owner&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Voicemail&lt;/td>
&lt;td>Skipped for now&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Busy or no answer&lt;/td>
&lt;td>Tried again another time&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Fax, dead or out of service&lt;/td>
&lt;td>Removed from the list&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>When the block starts, the callers only get numbers where a person or a front desk picked up. The hour goes to conversations.&lt;/p>
&lt;h2 id="what-broke-first-switchboards-filed-as-voicemail">What broke first: switchboards filed as voicemail&lt;/h2>
&lt;p>The first version trusted its first guess. The quick listen is good at one question: did a person answer, or a machine?&lt;/p>
&lt;p>A switchboard is a machine too. &amp;ldquo;Thank you for calling, press 1 for sales&amp;rdquo; sounded like voicemail to the first listen, so it went in the voicemail pile. But a switchboard leads to a business with a front desk, and someone there can put you through to the owner.&lt;/p>
&lt;p>The fix was a second listen. Every number marked voicemail, and every number the first listen wasn&amp;rsquo;t sure about, gets checked again on the full recording. If it hears &amp;ldquo;press&amp;rdquo; followed by a number, or the word &amp;ldquo;menu&amp;rdquo;, it marks the number as a switchboard.&lt;/p>
&lt;p>Only the unsure numbers get the second listen, so it stays cheap.&lt;/p>
&lt;h2 id="what-broke-second-results-on-the-wrong-rows">What broke second: results on the wrong rows&lt;/h2>
&lt;p>The dialer writes its result next to each number in the sheet the team uploaded.&lt;/p>
&lt;p>I first matched each result to its row by row number. That works when the sheet&amp;rsquo;s header is on row 1. Real sheets don&amp;rsquo;t always start there. Some begin with a title, a date or a blank line, and every result after that landed on the wrong row.&lt;/p>
&lt;p>Now the dialer matches on the phone number itself. It strips the number to digits, tries it with and without the country code, and uses the row number only when a row has no phone number.&lt;/p>
&lt;h2 id="try-it-match-on-the-number-not-the-row">Try it: match on the number, not the row&lt;/h2>
&lt;p>A small, generic version of the fix, in Python:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="kn">import&lt;/span> &lt;span class="nn">re&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">digits&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">phone&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">str&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">-&amp;gt;&lt;/span> &lt;span class="nb">str&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">re&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">sub&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">r&lt;/span>&lt;span class="s2">&amp;#34;\D&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">phone&lt;/span> &lt;span class="ow">or&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">variants&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">phone&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">str&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">-&amp;gt;&lt;/span> &lt;span class="nb">list&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nb">str&lt;/span>&lt;span class="p">]:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">d&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">digits&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">phone&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># US numbers: try with and without the leading country code 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="n">d&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">d&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">:]]&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">d&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="mi">11&lt;/span> &lt;span class="ow">and&lt;/span> &lt;span class="n">d&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">startswith&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;1&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="k">else&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="n">d&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;1&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="n">d&lt;/span>&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">label_for&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">row_phone&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">str&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">row_index&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">int&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">by_phone&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">dict&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">by_row&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="nb">dict&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">-&amp;gt;&lt;/span> &lt;span class="nb">str&lt;/span> &lt;span class="o">|&lt;/span> &lt;span class="kc">None&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="n">v&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">variants&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">row_phone&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">v&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">by_phone&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">by_phone&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="n">v&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="c1"># primary: the number itself&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">by_row&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">get&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">row_index&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="c1"># fallback: the old row position&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Build &lt;code>by_phone&lt;/code> from your results, keyed by digits. Keep &lt;code>by_row&lt;/code> only for rows with no phone number.&lt;/p>
&lt;h2 id="what-changed-for-the-team">What changed for the team&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Before:&lt;/strong> about 60 to 70 answered calls a week, across 10 to 15 callers.&lt;/li>
&lt;li>&lt;strong>After about three months with the dialer:&lt;/strong> 130 to 150 real conversations a week, with the same team.&lt;/li>
&lt;/ul>
&lt;p>The callers work the same hours as before. The dialer removes the numbers that were never going to answer, so those hours go to people.&lt;/p>
&lt;h2 id="whose-phone-is-it">Whose phone is it?&lt;/h2>
&lt;p>The second listen does one more job: it checks whose phone a number is.&lt;/p>
&lt;p>A voicemail greeting often says a name (&amp;ldquo;Hi, you&amp;rsquo;ve reached Mike&amp;rdquo;), and a person who picks up often says it too (&amp;ldquo;This is Mike&amp;rdquo;). The dialer compares the name it hears with the owner&amp;rsquo;s name on our list, and scores how likely it is that the number is the owner&amp;rsquo;s.&lt;/p>
&lt;p>So before a caller dials, they already know whether they&amp;rsquo;re likely to reach the owner.&lt;/p>
&lt;h2 id="where-the-idea-came-from">Where the idea came from&lt;/h2>
&lt;p>Google has the same problem with business listings. It makes automated calls to businesses to check their opening hours, and it even calls to map out a business&amp;rsquo;s phone menu. A machine makes the repetitive call, and a person only works with the answer. The dialer does the same job for a calling list.&lt;/p>
&lt;h2 id="where-else-this-works">Where else this works&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Email lists:&lt;/strong> check that an address exists before someone writes to it.&lt;/li>
&lt;li>&lt;strong>Any import:&lt;/strong> match records on a stable key (an email, a phone number, an ID), never on the row they arrived in.&lt;/li>
&lt;li>&lt;strong>Any queue a person works through:&lt;/strong> put a cheap machine check in front, and re-check only the unsure cases.&lt;/li>
&lt;/ul>
&lt;h2 id="sources">Sources&lt;/h2>
&lt;ol>
&lt;li>Kevin Hong on LinkedIn, &lt;a href="https://lnkd.in/p/gUM48MQ7" target="_blank" rel="noopener">the &amp;ldquo;dial sniper&amp;rdquo; post&lt;/a> (the 20% dead and 30% voicemail figures).&lt;/li>
&lt;li>Google Business Profile Help, &lt;a href="https://support.google.com/business/answer/7690269" target="_blank" rel="noopener">About automated calls and texts from Google to your business&lt;/a> (the hours checks and phone-menu calls).&lt;/li>
&lt;li>The team numbers (callers, weekly answered calls and conversations) come from Caprae&amp;rsquo;s calling team, November 2026.&lt;/li>
&lt;/ol>
&lt;hr>
&lt;p>&lt;em>Steal Like an Engineer #2. Stolen from: Google.&lt;/em> More from me: &lt;a href="https://www.linkedin.com/in/ukantjadia/" target="_blank" rel="noopener">linkedin.com/in/ukantjadia&lt;/a>.&lt;/p></description></item></channel></rss>