Skip to content
Back to blog
10 min readBy The dialque Team

Asterisk vs Twilio for self-hosted dialers — when each makes sense

Asterisk gives you total control at the cost of telephony expertise. Twilio is the dev-friendly hosted alternative but priced for global scale, not India bulk. Here is when each is the right answer.

EngineeringTelephony

If you are building or buying a dialer with self-hosting in mind, you eventually hit the same question: do we run Asterisk on our own infrastructure, or use Twilio's Programmable Voice as the underlying telephony platform?

They are answers to the same problem at different levels of abstraction. This post is the trade-off in concrete terms, with India-specific cost numbers and operational considerations.

What each one is

Asterisk

An open-source PBX / softswitch first released in 1999. Runs on Linux. Handles SIP, RTP, codec transcoding, call routing, IVR, recording, conferencing. Used by tens of thousands of self-hosted contact centres globally.

You install Asterisk on a server, configure dialplans (text-based call-flow rules), connect to a SIP trunk provider for PSTN reach, and your phones / agents register to the Asterisk server.

Twilio Programmable Voice

A hosted API. You make HTTP calls to Twilio's REST API and they handle the underlying telephony — PSTN connectivity, codec handling, recording, transcription. You write TwiML (their XML-ish call-flow language) or use webhooks to control behaviour. No infrastructure to operate.

The two-by-two

It is tempting to frame this as "Asterisk = harder + cheaper, Twilio = easier + costlier". That captures most of it but misses important nuance.

| | Asterisk | Twilio | |---|---|---| | Setup time | 2-8 weeks (telephony knowledge required) | 1-3 days | | Per-minute cost in India | ₹0.30 - 0.60 (direct trunk with Vilpower / Tata) | ₹0.90 - 1.50 | | Scale ceiling | Hardware-limited (5,000+ concurrent calls on one VM) | Effectively unlimited | | Customisation | Total — dialplans, AGI, ARI | Limited to what their API exposes | | Operational burden | You manage uptime, patches, security | They do | | Compliance | Easier (data stays on your infra) | Harder (calls traverse Twilio's US infra) | | Number portability | You own the trunk relationship | You own the Twilio numbers; portability out is per Twilio's terms | | Failure modes | Many — codec mismatches, NAT, jitter | Few but opaque |

The cost math in detail

Asterisk on AWS

  • VM: c6i.2xlarge (8 vCPU, 16GB RAM) handles ~300 concurrent calls. ~₹13,000/month on-demand, ~₹7,500 with 1-year RI.
  • Trunk: Direct contract with Vilpower / Tata / Tata Tele. Setup fee ₹5-15k, then per-minute usage.
  • DIDs: ₹400-600 per number per month (cheaper at volume).
  • Bandwidth: ~30-50 KB/s per concurrent call. For 100 concurrent calls = ~5 Mbps. Trivial on AWS.

A 100-concurrent-call setup runs at roughly ₹8,000 (VM) + ₹30,000 (DIDs for 60 numbers) + ₹X (per-minute usage) per month. If usage is 200,000 minutes/month at ₹0.45/min = ₹90,000.

Total: ~₹1.28 lakh/month for 100-concurrent / 200k minutes of capacity.

Twilio equivalent

  • No platform fee (Twilio is per-API call)
  • DIDs: ₹400-800/number/month for Indian numbers
  • Minutes: ~₹1.10/min outbound on average India routes
  • No VM — you run only your application servers

Same 200,000 minutes at ₹1.10 = ₹2.2 lakh/month for the same telephony output. Plus your application infra (which exists in both setups, so it cancels out).

Twilio costs ~1.7x more for the same minutes. The gap widens with volume.

When Asterisk is the right answer

  • High volume (>50,000 minutes/month): the per-minute savings compound. Payback on the operational overhead is fast.
  • Custom routing logic: complex IVRs, language detection, regional routing, dynamic outbound trunk selection. Asterisk dialplans + AGI handle anything; Twilio works within their TwiML model.
  • Compliance requires data residency: DPDP Act, banking regulators, hospital records — call media must stay on your infrastructure.
  • You have someone who knows SIP: even part-time. A telephony-knowledgeable engineer in the team is the precondition.
  • Multi-tenant: you run a contact centre as a service for multiple clients with isolated dialplans.
  • You want true ownership of carrier relationships: trunk + DID contracts are yours; you can switch carriers without re-architecting.

When Twilio is the right answer

  • Low volume (<20,000 minutes/month): per-minute economics do not dominate.
  • You are building a product, not running a contact centre: e.g. a marketplace that needs in-app calling for buyer/seller; an OTP service; a callback widget on a website. Twilio's API + global PSTN reach are unmatched.
  • Global reach: Twilio has DIDs and routing in 100+ countries out of the box. Asterisk requires per-country trunk contracts.
  • You do not have telephony engineers: hiring is expensive and slow. Twilio's API + their docs lets a backend engineer ship in a week.
  • Fast iteration: prototyping new call flows is hours on Twilio, days on Asterisk.

The hybrid path

Several mature setups use both:

  • Asterisk for media (high-volume outbound), Twilio for global PSTN reach: outbound dial campaigns in India go through Asterisk + Vilpower; international outbound or rare-country numbers route through Twilio.
  • Asterisk for the contact-centre stack, Twilio for SMS / WhatsApp / programmable extras: voice on Asterisk, all-other-channels on Twilio.

This is harder to operate (two systems) but combines cost-efficiency with feature breadth.

Where dialque sits

dialque is built on Asterisk for media + Postgres for the queue / call event store + a Next.js admin. Three deployment modes:

  • Cloud-managed: we run the Asterisk + Postgres for you. Cheapest per-active-user. Carrier passthrough — you bring the carrier contract.
  • Self-hosted on your infra: full source, deployable on AWS / GCP / on-prem. Same UX, you operate it.
  • Hybrid: control plane (admin UI, analytics, queue) on our cloud, media servers on your infra.

If you want self-hosting on Twilio, that is not a thing — Twilio is hosted by definition. If you want the operational ease of Twilio without the cost, an Asterisk-based product (dialque, or build it yourself) is the equivalent.

Operational gotchas — Asterisk

  1. NAT and SIP: agents on home / hotel networks behind NAT will see one-way audio if SIP transport is not configured carefully. Solution: use TLS + WebRTC (works through NAT) instead of UDP SIP.
  2. Codec choice: PCMU/PCMA (G.711) is mandatory for compatibility but uses 80 kbps/call. G.722 / Opus halve that but require both endpoints to support them. Most India PSTN trunks are PCMU.
  3. Echo cancellation: tunable in Asterisk; out-of-the-box settings are too conservative for many India routes.
  4. Recording compression: WAV is largest; MP3 is ~1/10. For long-term storage, transcode after the call ends.
  5. Patching: Asterisk security advisories arrive every quarter. Have a process for testing + rolling out updates.

Operational gotchas — Twilio

  1. Rate limits: Twilio API has per-account rate limits (default ~1 req/sec). Burst traffic gets queued or rejected.
  2. Geographic latency: API calls to Twilio's US datacentre add 200-300ms one-way. Application-level workflows that loop back through Twilio multiple times per call become slow.
  3. Number availability: certain Indian number ranges are not stocked. You may need to request specific operator codes.
  4. Cost spikes: a misbehaving call flow that loops can cost hundreds of dollars in a day. Set spending limits early.
  5. Bring-your-own-carrier (BYOC): Twilio supports it (their "Programmable Voice with Voice Insights" tier) but the savings are smaller than going pure Asterisk + direct trunk.

Frequently asked questions

Can I run Asterisk on a t3.small for a 10-agent team?

Yes, with conservative codec selection (PCMU) and few concurrent calls (<30). t3.medium is more comfortable.

Does Twilio support DLT in India?

Yes via their India partnership. Templates and headers need to be registered through Twilio's portal or imported from your Vilpower PE.

What about FreeSWITCH instead of Asterisk?

FreeSWITCH is more modern and scales better for very-high-concurrency (5,000+) deployments. For most India contact-centre workloads (< 1,000 concurrent), Asterisk is fine and has a much larger community / documentation base.

Is Asterisk too old?

The codebase is mature, not dead. Active development is at the FreePBX / Sangoma stewardship. It is unsexy but it works — there are billion-dollar-revenue contact centres running on Asterisk in production today.

The Asterisk vs Twilio choice is fundamentally a build-vs-buy decision applied to telephony. If you are at India scale doing real volume and have any telephony knowledge in-house, Asterisk wins on cost and control. If you are building a product feature with calling baked in, Twilio is the right abstraction. The hybrid path is real for teams that want both.