r/twilio
Two real gotchas from wiring DTMF and outbound calls through a Twilio Elastic SIP Trunk into LiveKit
- upvotes
- 1
- comments
- 0
Post
Highlighted: the lines this signal was extracted from
Sharing a couple of concrete findings from building a voice AI agent on a Twilio Elastic SIP Trunk (origination + a credential-list trunk for outbound), in case they save someone else a debugging session. No product, no link, just what broke and how it got fixed. DTMF: in-band tone detection (a Goertzel filter over the audio) and speech-to-text transcription both failed to read real keypad input reliably. Tone-only calls produced zero transcript from the STT model, and feeding the same tone-decoder a spoken sentence instead of tones invented over a hundred phantom keypresses that were never pressed. RFC 4733 named RTP events, surfaced in LiveKit as room.on("sip_dtmf_received"), worked cleanly instead, real digits, no audio-domain guessing. Geo permissions: a real outbound call attempt to a number outside Twilio's default allowed set failed with a SIP 403 until enabling that country under Voice > Settings > Geo permissions. This is separate from the trial-account destination-verification restriction, worth checking both if a call fails silently with no obvious error in your own logs. Also worth checking explicitly: firewall/security-group rules that scope inbound RTP media to the same CIDR ranges as SIP signalling. Twilio's media gateways are a separate published block (168.86.128.0/18, ports 10000-60000 UDP) from where signalling originates. Calls can still succeed if...
Keep reading with a free account
The rest of this post, and every signal for Twilio, is in your free account.