I'm taking on new voice AI and automation builds this quarter. See what I build →
Blog

Google Voice would not sell me a number, so I built my own dialer

Azzaz SiddiquiCustom Software4 min read
A phone keypad with a number readout, connected by a dotted carrier route on either side.

I needed a US number to make outbound calls. That is a solved problem if you live almost anywhere else: sign up for Google Voice or any of a dozen consumer VoIP apps, and you are done in ten minutes.

From Pakistan, none of them would onboard me, and I don't mean "expensive" or "degraded". They refused at signup. The pattern repeats often enough that I have stopped treating it as bad luck: consumer products encode assumptions about where you live, and when you fall outside them there is no support ticket that fixes it.

Buying the carrier API instead

Every one of those products is a wrapper over a carrier API. Telnyx, Twilio and their peers sell the same capability without the consumer packaging, and they sell it to me. The trade is that you now own the client, the call state, and the audio path.

That turned out to be a smaller job than the refusals implied. The stack is deliberately boring:

React SPA  ──WebRTC──>  Telnyx  ──PSTN──>  the actual phone
    │
    └──REST/WS──>  Express API  (call state, history, recordings)

An Express API holds the call state and history, a React SPA is the softphone, and Telnyx handles the hard part: being a carrier. It has been placing real calls since early August.

The part that surprised me is how little code sits between "a call is happening" and "my database knows about it". Carrier platforms are event-driven: they POST call lifecycle events at you, and your job is mostly to not lose them.

[ ts ]
// Call events arrive as webhooks. Verify, then record — never trust the payload.
app.post('/webhooks/call', async (req, res) => {
    if (!verifySignature(req)) return res.sendStatus(401)

    // Acknowledge immediately. Carriers retry aggressively on a slow response,
    // and a duplicate event is much cheaper than a timeout storm.
    res.sendStatus(200)

    const { event_type, payload } = req.body.data

    await calls.upsert({
        // The carrier's own call id is the idempotency key — the same event
        // replayed twice must not produce two rows.
        id: payload.call_control_id,
        status: event_type,
        from: payload.from,
        to: payload.to,
        occurredAt: new Date(payload.occurred_at)
    })
})

Two things in there are load-bearing. Responding 200 before doing the work stops retry storms, because carriers treat a slow handler as a failed one. And keying the write on the carrier's own call id means a replayed webhook overwrites instead of duplicating, which matters because you will get replays.

The pricing detail nobody documents

The advertised price for a US local number was $1/month. The invoice is $2/month.

The gap is an emergency-services surcharge that does not appear on the pricing page and is not mentioned during checkout. It is not a large amount of money, but it is a 100% error against the number I had used for planning. If you are sizing a build where every user gets a number, that error compounds straight into your unit economics.

I don't read this as Telnyx being dishonest. Carrier pricing pages are marketing, and the invoice is the real price list. Buy one number, run it for a full cycle, and read the bill before you model anything.

When this is the right call

Building your own is correct when:

  • The off-the-shelf product will not sell to you at all
  • You need call state inside your own system anyway, not in someone's dashboard
  • The per-seat pricing of the packaged product exceeds the carrier cost by enough to pay for the build

It is the wrong call when a product will happily onboard you and you just want to avoid a subscription. The carrier API is cheaper per minute and much more expensive per hour of your attention.

What I would tell someone starting this

Prototype against the carrier's API before you design anything. Most of the risk sits in audio (codec negotiation, NAT traversal, and what happens on a bad network), and none of that shows up in the REST documentation you will read first.

[ Custom software ]

I build the software and the infrastructure under it.

Architecture first, then the codebase, then the deployment. If you are starting a build, or you have inherited one that has become hard to change, I can tell you where it stands.