NYSE: IDT
Stay ahead with IDT Express
Products

Discover how our products can revolutionize the way you communicate and collaborate.

Voice

Explore our advanced voice solutions designed to optimize your communication workflows.

Diverse range of DID number solutions designed to enhance your communication capabilities.

Experience unparalleled communication efficiency with our advanced SIP Trunking Solutions.

Cutting-edge technology to proactively detect and neutralize spam flags on your DID Numbers.

Enable your customers to connect with your business by dialing a toll-free number.

AI voice agents that handle calls, capture leads, and provide customer support automatically, anytime.
Messaging

Wherever your audience is, our platform ensures seamless messaging across diverse channels.

Build customer journeys by fostering interactive conversations, all within the framework of your app. 

Connect with your audience in a simple and effective way through our cutting-edge SMS platform. 

BYOC

Harness the power of IDT as your chosen carrier while leveraging your platform’s advanced features and services.

Integrate Twilio with our robust carrier routing platform to achieve unparalleled Voice termination system.

Experience reliable and high-quality communication services while leveraging the advanced capabilities of Genesys. 

Integrate IDT with the collaborative strength of MS Teams, unlocking efficient and feature-rich communication. 

Experience the power of our carrier network seamlessly connected to Plivo through our cutting-edge BYOC solution. 

Tools

Experience the power of our online voice tools, designed to simplify communication management. 

Ensure the authenticity and integrity of outbound calls with our STIR/SHAKEN Verification Check tool. 

User-friendly tool to verify the reputation of your business number, ensuring that it remains trusted. 

Compare and gain insights into outbound call expenses, optimize budget, and make informed decisions. 

Easily estimate and compare the costs associated with different DID numbers providers. 

Compare inbound VoIP rates among top CPaaS providers and optimize your inbound call costs. 

Generate custom SMS templates. 

Resources

Empower yourself with the resources you need to thrive in the dynamic landscape of communication.

Articles covering a wide range of topics.

Discover our video guides.

Get answers to common queries.

Find instructions to make the most of our products.

Stay informed with today's most important news stories

Discover telecom insights and trends.

Find definitions of popular telecom terms.

Discover the upcoming events on our calendar
Company

A global telecom partner built to meet your needs. 

Discover the story behind our commitment to delivering innovative solutions to connect people and businesses worldwide. 

Learn about our robust network infrastructure that spans across the globe, ensuring reliable and secure connectivity. 

Got a question, feedback, or need assistance? Our dedicated team is here to help!

Find partners or sign up for partnership programs.

NYSE: IDT
Learn / Blog

G.711, G.729 or Opus? Choosing Codecs for SIP Trunks by Use Case

|
|  8 min
|
In this article

Voice teams often disagree about which codec to use on their SIP trunks. Some prefer to use G.711 everywhere, because it’s the format the public phone network uses and it rarely causes problems. Others prefer to compress audio wherever they can, because bandwidth costs money and newer codecs can sound better.

A codec is the method used to turn speech into data so it can travel over a network, and then back into sound at the other end. For SIP trunks, the choice usually comes down to three options. G.711 is uncompressed and uses about 87 kbps in each direction per call over a typical Ethernet connection. G.729 is compressed and uses about 31 kbps. Opus has a variable bitrate and can carry higher-quality wideband audio. Each one works best in a different part of the network, so the right approach is to choose the best codec for each segment and convert between codecs as few times as possible.

Both sides of the debate have a point. This article sets out the case for each, compares the three codecs on the factors that matter, and ends with a recommendation for each part of the network.

The case for using G.711 everywhere

G.711 is the codec used across the public phone network, and almost every carrier and session border controller (SBC) supports it. As a result, calls agree on G.711 without surprises.

Because G.711 doesn’t compress the audio, it carries more than speech cleanly. That includes the tones you hear when someone presses a key on a phone keypad, fax signals in some cases, and the quiet background sounds that make a call feel natural. It also adds almost no processing delay. Most importantly, when both your trunk and the carrier’s network use G.711, nothing needs to be converted, which removes a whole category of audio quality problems.

The drawback is bandwidth. When audio is sent in 20-millisecond packets, a G.711 call uses about 87 kbps in each direction once the network headers are included. Fifty simultaneous calls therefore need around 4.4 Mbps in each direction. On a modern data center connection that’s a small amount, but on a busy connection at a branch office it can cause problems.

The case for compression

G.729 carries a call using about 31 kbps in each direction with the same packet size, which is roughly a third of what G.711 needs. On limited connections, such as satellite links or branch offices with slow internet, that difference determines how many calls the connection can carry.

G.729’s main drawback used to be licensing cost, but that’s largely no longer an issue because the patents covering it have expired. Today, most SBCs and phone systems support it.

Opus offers a different advantage. It’s a modern, flexible codec that adjusts its bitrate to network conditions and can carry wideband audio, which sounds noticeably clearer than standard telephone audio. It’s also the standard codec in WebRTC, the technology behind most calling in web browsers and apps. For platforms where calls stay entirely on IP networks, Opus can be both more efficient and better-sounding than G.711.

Comparing the three codecs

The table below scores each codec from 1 to 3 on the factors that matter most for a SIP trunk, where a higher score is better.

FactorG.711G.729Opus
Bandwidth efficiency133
Audio quality on calls to and from the phone network212
Audio quality on calls that stay on IP networks213
Support from carriers and SBCs321
Handling of fax and keypad tones211
Processing load and delay322
Resilience to lost packets123

A few of these scores need explaining.

Opus on calls to and from the phone network (2). Although Opus can carry wideband audio, a call to or from an ordinary phone is limited by the phone network, which only carries standard telephone audio. Once a call reaches the phone network, the extra quality is lost, whichever codec the IP side used.

Opus support from carriers (1). Opus is widely supported in browsers and modern platforms, but far fewer carrier SIP trunks offer it than offer G.711. On the connection to the carrier, using Opus therefore often means converting the audio.

Fax and keypad tones. Compressed codecs distort fax signals and tones sent within the audio. For this reason, keypad tones should be sent as separate events using a standard called RFC 4733, and fax should use T.38, whichever voice codec you choose.

The hidden cost of converting audio

Whenever a call switches from one codec to another, a device has to decode the audio and encode it again. This process, called transcoding, uses processing capacity, adds a few milliseconds of delay and slightly reduces audio quality. The loss is greater when two compressed codecs are used one after the other.

The worst case is a call that is converted more than once, for example compressed with one codec, converted to a second and then converted again. Each step reduces quality, so a call that sounds fine in testing can sound noticeably worse in everyday use because of a conversion nobody knew about.

Transcoding also puts a concentrated load on specific devices. SBCs can only convert a limited number of calls at once, and if they run out of capacity at busy times, calls fail or sound poor in ways that are easily mistaken for carrier problems. If your platform connects Microsoft Teams to a carrier, the SBC is almost certainly converting audio, and our guide to what breaks in Teams Direct Routing explains why that capacity needs planning.

Our recommendation: choose by network segment

Each side of the debate is right about a different part of the network. The best approach is therefore to choose a codec for each segment and keep the number of conversions between segments as low as possible.

Network segmentFirst choiceReason
Your SBC to the carrierG.711Matches the phone network and avoids conversion on the carrier side
Branch office with a slow connectionG.729Uses about a third of the bandwidth per call
Users in browsers or apps (WebRTC)OpusBuilt in, adjusts to network conditions and supports wideband audio
Internal calls between IP devicesOpus or G.722Wideband quality where the phone network isn’t involved
FaxT.38Compressed voice codecs distort fax
Keypad tonesRFC 4733 eventsWorks reliably with any voice codec

Alongside the table, follow three rules. First, offer G.711 as the first choice on the carrier trunk unless bandwidth makes that impossible. Second, convert audio only once, at a single point that you’ve sized for peak traffic. Third, test with the kinds of calls you actually handle, including hold music, IVR prompts, menus that rely on keypad tones and calls to mobile networks.

How packet size affects bandwidth

The bandwidth figures in this article assume that audio is sent in 20-millisecond packets, which is the most common default. This setting, called packetization time or ptime, controls how much audio goes into each packet, and it affects both bandwidth and delay.

Longer packets, such as 30 or 40 milliseconds, carry more audio for each set of network headers. As a result, overhead falls and each call uses less bandwidth. The trade-off is slightly more delay and a bigger gap in the audio when a packet is lost. Shorter packets have the opposite effect. For G.729, where headers make up a large share of each packet, moving from 20 to 30 milliseconds makes a noticeable difference on slow connections.

Both ends of the call must agree on the packet size, and some carriers only accept certain values. For that reason, keep the setting at 20 milliseconds unless bandwidth forces a change. If you do change it, test calls to mobile and international numbers, where extra delay is noticed first.

Testing your codec choices before rollout

Codec choices that look sensible on paper can behave differently in real use, so test them before rolling them out widely. Make test calls across the routes that matter to you, including calls from office and remote users, calls to mobiles and landlines, domestic and international calls, and calls that pass through your IVR and hold music.

During testing, listen for clipped speech, robotic-sounding audio when packets are lost and muffled hold music, which compressed codecs handle poorly. Also check that keypad menus and any fax workflows still work. Finally, record which codec was actually agreed on each part of the call, because a test that sounds fine may have quietly switched to a codec you didn’t plan to use.

It’s also worth remembering that codec selection is based on a list of preferences rather than a fixed choice. If the other side doesn’t support your first preference, the call automatically uses the next one on the list. Checking the agreed codec in your call records from time to time ensures that a configuration change doesn’t move traffic to an unplanned codec without anyone noticing.

Voice AI and short automated calls

Speech recognition generally works better with wideband audio, which leads some voice AI teams to use Opus from end to end. That helps when callers reach you through an app or a browser. For calls from ordinary phones, however, the audio arriving from the phone network is standard telephone quality, so using G.711 on the trunk preserves all the quality that’s available. In practice, the bigger improvements usually come from avoiding extra conversions and lost packets rather than from the choice of codec. Our SIP trunking for AI agents hub covers this setup in more detail.

For short automated calls, such as verification codes read out to users, clear speech matters more than saving bandwidth. Numbers read by a text-to-speech system are easy to mishear on a heavily compressed or unreliable connection, which is why our post on voice OTP fallback recommends G.711 for those calls.

Planning bandwidth once you’ve chosen

After you’ve chosen a codec for each segment, planning bandwidth is a simple calculation. Multiply the bandwidth per call for that codec by your peak number of simultaneous calls, then add a margin of around 20% for signaling and short bursts of traffic. Do this for each connection rather than for each site, because a branch office’s internet link and the data center’s carrier connection carry different traffic.

If you’re replacing older phone lines, include this calculation in the network stage of the project; our PRI to SIP migration runbook shows where it fits. If audio stops working in one direction after you change codecs, the cause is usually network address translation or the firewall rather than the codec itself, and our guide to fixing one-way audio explains what to check.

Checking codec support with your carrier

Before you finalize your design, ask your carrier which codecs it supports on its trunks and in what order of preference, whether it converts audio on its side, and how it handles fax and keypad tones. The answers will tell you where conversion needs to happen in your setup.

IDT Express provides SIP trunking from 40+ locations, so platforms can connect each site to a nearby point of presence and keep the carrier side on a single, predictable codec plan. When you plan your design, confirm with the team which codecs are available on your trunks. Our SIP trunking page gives an overview of the service.

Frequently asked questions

Which codec is best for SIP trunks?

G.711 is usually best between your SBC and the carrier, because it matches the public phone network and avoids converting audio. Use G.729 where bandwidth is limited, and Opus for calls in browsers, apps or entirely on IP networks.

How much bandwidth does a SIP call use?

When audio is sent in standard 20-millisecond packets over Ethernet, a G.711 call uses about 87 kbps in each direction and a G.729 call about 31 kbps. Opus varies depending on the bitrate it’s set to use.

Does G.729 still need a license?

The patents covering G.729 have expired, so licensing is no longer the obstacle it once was. Most SBCs and phone systems support it without a separate codec license.

Can you send fax over a SIP trunk?

Yes, but use T.38 rather than sending fax through a voice codec. Compressed voice codecs distort fax signals, and even G.711 can be unreliable for fax over IP networks.

What is transcoding and why does it matter?

Transcoding means converting a call from one codec to another. It uses processing capacity, adds a little delay and reduces audio quality, especially when it happens more than once on the same call.

Explore SIP trunking

If you’re planning codecs for a new SIP setup, explore IDT Express SIP trunking and check codec support for your trunks.

Share this article

Leave a Reply

Required fields are marked *

Rate this article


Tags

Meet our wholesale voice routing

Fulfill all your voice calling needs with our category leading wholesale A-Z Voice Termination.
Try IDT Express for a $25 Credit

Get $25 Free Trial Credit

Get IDT Express articles in your inbox

The best source of information in the telecom industry. Join us.

    Most Popular

    08-byoc-for-contact-center-platforms
    |
    |  8 min
    Bring-your-own-carrier (BYOC) is often presented as a way to pay...
    06-fixing-one-way-audio-and-nat-problems-on-sip-trunks
    |
    |  9 min
    One-way audio is a problem on SIP calls where the...
    05-per-channel-metered-or-bundled
    |
    |  9 min
    SIP trunk providers usually price their service in one of...