<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: dev0miky</title>
    <description>The latest articles on DEV Community by dev0miky (@dev0miky).</description>
    <link>https://dev.to/dev0miky</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3942632%2Fc820c483-f8dc-4fde-898a-adc0d748dbea.jpeg</url>
      <title>DEV Community: dev0miky</title>
      <link>https://dev.to/dev0miky</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dev0miky"/>
    <language>en</language>
    <item>
      <title>I built an open-source alternative to ViciDial. Here's the stack, and the bugs that ate my nights.</title>
      <dc:creator>dev0miky</dc:creator>
      <pubDate>Wed, 20 May 2026 15:51:06 +0000</pubDate>
      <link>https://dev.to/dev0miky/i-built-an-open-source-alternative-to-vicidial-heres-the-stack-and-the-bugs-that-ate-my-nights-3636</link>
      <guid>https://dev.to/dev0miky/i-built-an-open-source-alternative-to-vicidial-heres-the-stack-and-the-bugs-that-ate-my-nights-3636</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsu8qj356v9as5pzu6wl4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsu8qj356v9as5pzu6wl4.png" alt=" " width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I started building the thing I actually wanted to deploy. It's on GitHub now, AGPL-3.0. This is a write-up of the architecture and, more usefully, the bugs that cost me real sleep.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The stack, and why&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kamailio&lt;/strong&gt; at the SIP edge — high CPS, and &lt;code&gt;secsipid&lt;/code&gt; for STIR/SHAKEN&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FreeSWITCH&lt;/strong&gt; for media — &lt;code&gt;bgapi originate&lt;/code&gt;, &lt;code&gt;mod_avmd&lt;/code&gt;, ESL, a Lua script per call&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Go&lt;/strong&gt; for the engine — pacing, lead claiming with &lt;code&gt;SELECT FOR UPDATE SKIP LOCKED&lt;/code&gt;, a per-call state machine driven off ESL events&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Postgres with row-level security&lt;/strong&gt; for multi-tenancy — isolation enforced by the database, not by hoping every query has the right &lt;code&gt;WHERE tenant_id =&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React&lt;/strong&gt; console for campaigns, leads, scripts, and reports&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The split that people question most is Kamailio-in-front-of-FreeSWITCH. At small scale it's arguably overkill, but Kamailio is the right tool for SIP routing and CPS, and FreeSWITCH is the right tool for media — keeping them separate means I can scale the media tier without touching the edge.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Multi-tenancy I actually trust&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every business row carries a &lt;code&gt;tenant_id&lt;/code&gt;, and Postgres RLS policies key off a session variable the API sets per request. Even a buggy query physically can't read another tenant's rows, because the database refuses. After years of seeing tenant isolation implemented as "we're careful with our WHERE clauses," letting the DB enforce it was the part I felt best about.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The bugs that ate my nights&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Press-1 never dialed.&lt;/strong&gt; I'd pivoted to bridging to external agents, and ripped out the internal-agent concept — but the press-1 pacing still gated on "available agents," which was now always zero. So a press-1 campaign would go live and do nothing. Fix was making press-1 fill to capacity like broadcast and letting the operator cap concurrency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MP3 greetings played as silence.&lt;/strong&gt; FreeSWITCH can't decode MP3 without &lt;code&gt;mod_shout&lt;/code&gt;, which wasn't loaded. Loaded it — and the audio sounded terrible, because it was resampling a 44.1kHz stereo file down to 8kHz telephony on every single call. The real fix was transcoding uploads to 8kHz mono PCM WAV with ffmpeg at upload time, so &lt;code&gt;mod_sndfile&lt;/code&gt; just plays them natively. Obvious in hindsight; not obvious at midnight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Press 1 does nothing" — a full night gone.&lt;/strong&gt; In Lua, &lt;code&gt;session:execute("playback", file)&lt;/code&gt; &lt;em&gt;eats&lt;/em&gt; DTMF digits. My greeting playback was swallowing the keypress before the &lt;code&gt;read&lt;/code&gt; after it ever listened. The call would fall straight through to the no-input hangup, so from the outside it looked like pressing 1 hung up the call. The fix is the canonical primitive — &lt;code&gt;session:playAndGetDigits()&lt;/code&gt; — which plays the prompt and collects the digit in one step without eating it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Answering-machine detection without paying for it.&lt;/strong&gt; The old &lt;code&gt;mod_amd&lt;/code&gt; isn't in current builds and the maintained &lt;code&gt;mod_com_amd&lt;/code&gt; went commercial. So I built voicemail-drop on &lt;code&gt;mod_avmd&lt;/code&gt; (beep detection): the broadcast Lua starts avmd, plays the message, and on the beep event replays it after the tone so a clean copy lands on the voicemail. It's a little hacky, but it's free and it works.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Where it is now&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Pre-release, honestly. The press-1 and broadcast flows work end to end — originate, AMD, greeting, keypress, bridge, recording — but there's no production carrier wired up yet (I've been testing over a Linphone gateway, which has its own DTMF adventures), STIR/SHAKEN signing is configured in Kamailio but unproven against a real carrier, and there's no agent softphone app.&lt;/p&gt;

&lt;p&gt;If you've shipped real outbound telephony, I'd genuinely like to know what I got wrong before I point real traffic at it.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/dev0miky/Outbound-calling-system-P1-Broadcast" rel="noopener noreferrer"&gt;https://github.com/dev0miky/Outbound-calling-system-P1-Broadcast&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's AGPL and self-hostable. Not selling anything — I just wanted the dialer I couldn't find.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>go</category>
      <category>opensource</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
