https://retellai.com/?utm_source=discord&utm_medium=seo logo
Question dial-to-SIP URI audio transcoding questio...
# ❓・bug-report
s
So i switched my configuration from elastic sip trunk to SIP URI. Why? it is my understanding that elastic sip trunk has low-bitrate codecs and lowers call quality. However since the change i haven't noticed that much of an improvement. I can see that twilio is using The codec PCMU (G.711 µ-law) ✅ PCMU is an uncompressed, high-quality, wideband codec. ✅ It's the default for Twilio SIP and often preferred for voice AI because it's lossless (at ~64 kbps). ✅ No packet loss or jitter was detected. ✅ No transcoding to low-bitrate codecs like G.729, GSM, or downsampled Opus is happening on Twilio’s end. Since the codec is already PCMU, and network jitter/packet loss are clean, your poor call quality is likely caused after Twilio hands the call off to the SIP URI — meaning on the RetellAI / LiveKit SIP bridge side. Here’s what might be happening: ✅ Twilio → SIP Bridge (clean, uncompressed audio) ❌ SIP Bridge → RetellAI Agent (downsampled, transcoded, or limited bandwidth) My question: 1 When using the dial-to-SIP URI method, are incoming SIP calls using G.711 passed through directly, or is the audio transcoded to Opus or another codec internally? If Opus, at what bitrate? Can we enable full-band Opus for best transcription performance?" 2 Are you using WebRTC with a restricted audio setting? Are you limiting bitrate or sample rate?
n
@swek94 Nice analysis of data, but you are looking at the issue from the wrong angle. And I'll explain why: 1. When working with Elastic SIP Trunking or SIP URIs on Twilio, there is no difference - Twilio is designed to support the common telephony codecs - namely: g711u, g711a and g729. 2. As a direct product of the above, Twilio's support for Opus codecs is strictly resereved for their WebRTC clients and streaming interfaces - used by Twilio Flex (it's a business decision). 3. Retell uses LiveKit as it's telephony infrastructure, thus, LiveKit supports g711u, g711a and g722. The g722 codec is an HD Audio codec (which is the default Cloudonix uses when sending calls into Retell). You can pipe your inbound calls to Retell via Cloudonix, which will affectively perform automatic upsampling and transcoding, and will send your inbound calls to Retell over the g722 codec.
s
@nir.simionovich Thanks so much for taking the time to respond. I really appreciate it, especially since I imagine you're a busy guy. Thanks again for clarifying the codec support and the logic behind Twilio's decisions. I’ll go ahead and try piping the inbound calls to Retell via Cloudonix so they get upsampled to G722 as you suggested.
n
If you have issues or question, don't hesitate to ping me over Discord
s
When you use SIP URI, Twilio sends clean G.711 (PCMU) audio. But once it hits Retell's SIP bridge, the audio is likely transcoded to Opus, possibly at a lower bitrate or sample rate. So even though G.711 is high quality, the drop you're hearing probably comes from: Retell converting it to Opus Possible bitrate or sample rate limits (e.g. 16 kHz, 32 kbps) WebRTC settings (like DTX or narrowband)