3CX Codec Configuration:
G.711, G.729, A-Law & U-Law
The definitive guide to configuring voice codecs in 3CX PBX β choose the right codec for your network, set it correctly, and achieve perfect call quality on every SIP trunk.
Codec configuration is one of the most misunderstood β and most impactful β settings in a 3CX PBX deployment. Choose the wrong codec, set it in the wrong location, or create a codec mismatch between your 3CX and your SIP trunk, and you will experience one-way audio, dropped calls, poor voice quality, or excessive bandwidth consumption. This guide explains every major codec used in 3CX β G.711 (U-Law and A-Law), G.729, and G.722 β covering what each codec is, how to configure it in 3CX's admin console, how to match it to your SIP trunk's requirements, and how to diagnose and fix codec-related call quality problems. Whether you are configuring a fresh 3CX installation or troubleshooting existing audio issues, this is the complete reference you need.
π Table of Contents
- What Are VoIP Codecs and Why Do They Matter in 3CX?
- The Four Essential 3CX Codecs Explained
- G.711 U-Law vs A-Law: What's the Difference?
- G.729: The Bandwidth-Saver Codec
- Full Codec Comparison: Quality, Bandwidth, Latency & Use Case
- Bandwidth Calculator: How Many Calls Can Your Connection Handle?
- How to Configure Codecs in 3CX (Step-by-Step)
- Matching Codecs to Your SIP Trunk Provider
- Troubleshooting Codec-Related Call Problems in 3CX
- Codec Best Practice by Scenario
- Frequently Asked Questions
- Related Articles
1. What Are VoIP Codecs and Why Do They Matter in 3CX?
A codec β short for coder-decoder β is an algorithm that converts the analog sound of your voice into digital data packets that can be transmitted over an IP network, and then decodes those packets back into audio at the receiving end. Every VoIP call uses a codec, whether you know it or not. The codec you select determines three critical call characteristics: voice quality, bandwidth consumption, and CPU load.
In 3CX, codecs are configured in multiple places β at the SIP trunk level (how your 3CX talks to your carrier's network), at the extension level (how your 3CX talks to your phones and softphone clients), and in global settings that affect all connections. Getting these settings right β and making sure they match across every layer β is essential for reliable, high-quality calls.
The most common VoIP call problems are codec problems: one-way audio (where you can hear the other party but they cannot hear you, or vice versa) almost always points to a codec negotiation failure. Calls that drop after exactly 30 or 60 seconds are frequently caused by a codec mismatch during re-INVITE. And poor audio quality with distortion or choppy voice is often the result of using a compressed codec over a connection that has inconsistent latency. Understanding your codecs eliminates the majority of 3CX audio issues permanently. For setup guidance, see our full guide: Guide to Setup SIP Trunk in 3CX.
Codec Issues in 3CX? Our Engineers Resolve Them Fast
NetViaVoice provides expert 3CX codec configuration, SIP trunk setup, and call quality troubleshooting. Contact us now for same-day resolution.
2. The Four Essential 3CX Codecs Explained
3CX supports multiple codecs, but four are by far the most commonly used in real-world deployments. Here is a quick-reference overview of each, before we dive into the details:
3. G.711 U-Law vs A-Law: What's the Difference?
G.711 U-Law (PCMU) and G.711 A-Law (PCMA) are two variants of the same underlying codec standard β both deliver identical audio quality (MOS score of 4.1) and use the same 64 Kbps bitrate. The only difference is the companding algorithm used to encode the audio: U-Law uses a ΞΌ-law (mu-law) encoding curve optimised for North American telephone networks, while A-Law uses a different curve optimised for European and most international PSTN standards.
π U-Law vs A-Law β Regional Guide
- G.711 U-Law (PCMU): Used by carriers in the United States, Canada, and Japan. If your SIP trunk connects to a US or Canadian PSTN carrier, U-Law is almost always the required primary codec.
- G.711 A-Law (PCMA): Used by carriers in Europe, UK, Australia, most of Asia, Africa, and Latin America. International SIP trunks connecting to European or Asian PSTN networks typically require A-Law.
- In 3CX: Configure both U-Law and A-Law in your codec list β let 3CX negotiate with the carrier. Place the codec matching your carrier's region first in priority order.
- NetViaVoice trunks: Our SIP trunks support both U-Law and A-Law automatically. We recommend placing G.711 U-Law first for US trunks and G.711 A-Law first for international trunks.
In the SIP INVITE message, your codec choice appears in the SDP (Session Description Protocol) offer. U-Law has a fixed payload type of 0 and A-Law has a payload type of 8. When you see a=rtpmap:0 PCMU/8000 in a SIP trace, that is U-Law; a=rtpmap:8 PCMA/8000 is A-Law. Knowing this makes reading SIP traces and diagnosing codec negotiation issues straightforward.
4. G.729: The Bandwidth-Saver Codec
G.729 uses sophisticated Conjugate-Structure Algebraic-Code-Excited Linear Prediction (CS-ACELP) compression to squeeze a voice call into just 8 Kbps β compared to G.711's 64 Kbps. This makes it eight times more bandwidth-efficient, making it the codec of choice for situations where internet bandwidth is constrained or where a large number of concurrent calls must share a limited connection.
π‘ G.729 β When to Use It and When to Avoid It
β Use G.729 Whenβ¦
- Your internet connection is limited (under 10 Mbps for 10+ concurrent calls)
- You are connecting remote offices over a low-bandwidth WAN link or VPN
- You are deploying over a mobile data connection (4G/LTE for remote workers)
- Your SIP trunk carrier explicitly requires or prefers G.729
- You need to maximise the number of concurrent calls on a fixed bandwidth budget
β Avoid G.729 Whenβ¦
- You have adequate bandwidth β G.711 always delivers better audio quality
- Your calls frequently use hold music, as G.729 compression artifacts degrade music significantly
- You use fax over IP (G.729 is incompatible with T.38 fax transmission)
- Your SIP trunk requires G.711 (most US PSTN carriers do) and transcoding is not available
- You prioritise voice naturalness β G.729 can sound slightly "digitised" under poor network conditions
Important note on G.729 licensing: G.729 was historically a licensed codec. In modern 3CX versions (V18 and later), G.729 is fully included without additional licensing fees. However, some older hardware endpoints still require a per-channel G.729 license from the device manufacturer β check your IP phone documentation.
5. Full Codec Comparison: Quality, Bandwidth, Latency & Use Case
| Property | G.711 U-Law | G.711 A-Law | G.729 | G.722 (HD) |
|---|---|---|---|---|
| Bitrate | 64 Kbps | 64 Kbps | 8 Kbps | 64 Kbps |
| With IP/RTP overhead | ~87 Kbps | ~87 Kbps | ~31 Kbps | ~87 Kbps |
| MOS Score | 4.1 | 4.1 | 3.9 | 4.5 |
| Audio bandwidth | 3.4 kHz (narrowband) | 3.4 kHz (narrowband) | 3.4 kHz (narrowband) | 7 kHz (wideband) |
| Compression | None (PCM) | None (PCM) | 8:1 (CS-ACELP) | None (ADPCM) |
| Algorithmic delay | 0.125 ms | 0.125 ms | 15 ms | 1.5 ms |
| CPU load | Low | Low | Medium | Low |
| Fax (T.38) compatible | β Yes | β Yes | β No | β No |
| DTMF transmission | In-band or RFC 2833 | In-band or RFC 2833 | RFC 2833 required | RFC 2833 |
| Best for | US/Canada SIP trunks | International SIP trunks | Low-bandwidth links | Internal HD calls |
| NetViaVoice recommendation | Primary for US trunks | Primary for intl trunks | Secondary/fallback | Internal extensions |
6. Bandwidth Calculator: How Many Calls Can Your Connection Handle?
Each simultaneous VoIP call consumes bandwidth in both directions. The bandwidth per call depends on the codec and the RTP packet size (typically 20ms packetisation). Include IP, UDP, and RTP headers, and the actual bandwidth per call is slightly higher than the raw codec bitrate:
| Connection Speed | Max Concurrent (G.711) | Max Concurrent (G.729) | Recommended for |
|---|---|---|---|
| 10 Mbps | ~57 calls | ~161 calls | Small office (5β15 users) |
| 25 Mbps | ~143 calls | ~403 calls | Medium office (15β40 users) |
| 50 Mbps | ~287 calls | ~806 calls | Large office (40β100 users) |
| 100 Mbps | ~574 calls | 1600+ calls | Enterprise / Call Centre |
| 4G Mobile (10 Mbps) | ~28 calls* | ~80 calls* | Remote workers (with QoS) |
Important: Never allocate 100% of your bandwidth to voice. Reserve at least 20β30% headroom for data traffic, jitter buffers, and network fluctuations. Always implement QoS (Quality of Service) rules on your router to prioritise RTP voice packets over general internet traffic.
7. How to Configure Codecs in 3CX (Step-by-Step)
3CX allows codec configuration at three levels: globally, per SIP trunk, and per extension group. Trunk-level settings override global defaults when negotiating with your carrier. Here is the step-by-step configuration for each:
Configuring Codecs on a SIP Trunk in 3CX
Log into the 3CX Management Console
Open your browser and navigate to your 3CX management URL. Log in with your administrator credentials.
Navigate to SIP Trunks
In the left sidebar, go to Admin β SIP Trunks. Select the trunk you want to configure codecs for.
Open the "Options" Tab
Within the trunk configuration, click the Options tab. Scroll to the Codecs section. You will see a list of available codecs with checkboxes and drag handles for priority ordering.
Enable and Order Your Codecs
Check the codecs you want to enable. Drag to reorder β the codec at the top is offered first in the SDP. For NetViaVoice US trunks: place G.711 U-Law first, then A-Law, then G.729 as fallback.
Set DTMF Mode
In the same Options tab, set DTMF mode to RFC 2833. This is required with G.729 (which cannot carry in-band DTMF) and is the safest setting for all codecs in a SIP Trunking environment.
Save and Test
Click Save. Make a test call β check both outbound (from 3CX to PSTN) and inbound (from PSTN to 3CX extension). Verify two-way audio, DTMF functionality (press numbers through IVR), and hold music if applicable.
Configuring Global Extension Codecs
To set codecs for internal extensions and phones, navigate to Admin β Advanced β Codec Settings. Here you configure the codecs offered to SIP phones and softphone clients. For internal calls between extensions, enable G.722 as the top priority β this gives your internal calls HD voice quality at no extra bandwidth cost compared to G.711.
8. Matching Codecs to Your SIP Trunk Provider
The most critical codec configuration step is ensuring your 3CX codec settings match what your SIP trunk provider supports and expects. A codec mismatch β where your 3CX offers a codec the carrier does not support, or vice versa β results in SIP negotiation failure and one-way or no audio. For NetViaVoice SIP trunk configuration in 3CX, see our dedicated guide: 3CX Configuration Guide β NetViaVoice.
| Scenario | Recommended Primary Codec | Fallback | Notes |
|---|---|---|---|
| NetViaVoice US SIP Trunk | G.711 U-Law (PCMU) | G.711 A-Law | US PSTN standard β always U-Law first |
| NetViaVoice UK/EU Trunk | G.711 A-Law (PCMA) | G.711 U-Law | European PSTN standard β A-Law first |
| Low-Bandwidth Remote Site | G.729 | G.711 U-Law | Confirm trunk provider supports G.729 |
| Internal Extensions Only | G.722 (HD) | G.711 U-Law | HD quality at same bandwidth as G.711 |
| Mixed US + International | G.711 U-Law | G.711 A-Law, G.729 | U-Law negotiates to A-Law automatically |
| Fax over IP lines | G.711 U-Law or A-Law | T.38 passthrough | Never use G.729 on fax lines |
9. Troubleshooting Codec-Related Call Problems in 3CX
π§ 3CX Codec Troubleshooting Guide
Problem: One-Way Audio (you hear caller, they cannot hear you β or vice versa)
Cause: Codec negotiation mismatch between 3CX and the SIP trunk, or NAT traversal issue preventing RTP packets from reaching the remote party.
- Enable SIP tracing in 3CX (Admin β Advanced β SIP Tracing) and capture a failing call
- Look for the codec agreed in the 200 OK response vs the re-INVITE β they must match
- Ensure your 3CX firewall rules allow RTP traffic on UDP ports 9000β10999 (or your configured range)
- Check that STUN and ICE are correctly configured in Admin β Network β STUN
Problem: Call Drops After 30β60 Seconds
Cause: Most commonly a codec re-INVITE rejection β the SIP trunk sends a re-INVITE to refresh the session and 3CX responds with a codec it did not originally offer, causing the carrier to reject and terminate.
- Enable
Disable re-INVITEon the SIP trunk Options tab as a temporary test - Review SIP traces for a
488 Not Acceptable Hereresponse to a re-INVITE - Ensure the codec list on the trunk has not changed between initial INVITE and re-INVITE
Problem: Choppy or Distorted Audio with G.729
Cause: G.729's compression is sensitive to packet loss and jitter. Even 1β2% packet loss degrades G.729 audio noticeably because the decoder cannot reconstruct compressed audio from incomplete data.
- Run an MOS/jitter test β if jitter exceeds 30ms or packet loss exceeds 0.5%, switch to G.711
- Implement QoS rules marking VoIP packets as DSCP EF (Expedited Forwarding)
- Increase the jitter buffer size in 3CX: Admin β Advanced β Voice Settings
Problem: DTMF Not Working (IVR keypresses not recognised)
Cause: When using G.729, in-band DTMF cannot be transmitted through the compressed audio β DTMF tones are filtered out by the codec. RFC 2833 out-of-band DTMF is required.
- Set DTMF mode to
RFC 2833on both the SIP trunk and the extension settings in 3CX - Confirm your SIP trunk carrier supports and responds to RFC 2833 telephone-event packets
- In SIP trace, look for
a=rtpmap:101 telephone-event/8000in the SDP β this confirms RFC 2833 is negotiated
10. Codec Best Practice by Scenario
Different deployment scenarios call for different codec strategies. Here are the recommended configurations for the most common 3CX use cases in 2026:
Office with Fibre / 50+ Mbps
Plenty of bandwidth. Prioritise quality over compression. Use G.711 U-Law for trunk, G.722 for internal extensions.
G.711 + G.722 internallyRemote Worker on Home Broadband
QoS not controllable end-to-end. Use G.711 β G.729's compression is more sensitive to home broadband jitter spikes.
G.711 U-Law preferredMobile Softphone (4G/5G)
Variable bandwidth. G.729 or Opus codec for 3CX mobile app. Reduces data usage significantly for mobile users.
G.729 or Opus (mobile app)SIP Trunk to US PSTN
Always G.711 U-Law as primary. US PSTN carriers universally support PCMU. A-Law as second priority for fallback.
G.711 U-Law firstSIP Trunk to UK/EU PSTN
G.711 A-Law as primary for European carrier compatibility. U-Law as second. G.729 optional third for low-BW sites.
G.711 A-Law firstFax Lines
G.711 U-Law or A-Law only. Never G.729 or G.722. Enable T.38 fax passthrough for maximum fax reliability.
G.711 + T.38 onlyFor advanced 3CX SIP trunk configuration, including bridge trunk vs generic SIP trunk selection which affects codec negotiation behaviour, read our comparison: 3CX Bridge Trunk vs Generic SIP Trunk. And for call forwarding configuration that interacts with codec settings, see: Remote Call Forwarding Setup Guide.
11. Frequently Asked Questions
For the best possible call quality in 3CX, the answer depends on whether you are configuring internal calls or SIP trunk calls:
- Internal calls (extension to extension): Use G.722 (wideband HD) as your primary codec. It uses the same bandwidth as G.711 but delivers noticeably higher audio clarity β 7 kHz frequency range vs G.711's 3.4 kHz. Most modern IP phones and 3CX softphones support G.722.
- SIP trunk calls (to PSTN): Use G.711 U-Law for US/Canadian trunks or G.711 A-Law for international/European trunks. G.711 delivers the highest quality available on PSTN-connected calls (MOS 4.1) with zero compression.
- Avoid G.729 unless bandwidth is a genuine constraint β while it is acceptable quality (MOS 3.9), it introduces compression artifacts and is more sensitive to network jitter than G.711.
For NetViaVoice SIP trunks specifically, we recommend: G.711 U-Law β G.711 A-Law β G.729 as your priority order on the trunk codec list.
One-way audio is one of the most common 3CX problems, and it has two primary causes β one codec-related and one network-related:
- Codec mismatch: If 3CX and the remote party (SIP trunk or endpoint) cannot agree on a common codec during SIP negotiation, only one direction of audio may be established using a fallback codec while the other direction fails. Enable SIP tracing in 3CX and look for
488 Not Acceptable Hereresponses or asymmetric codecs in INVITE vs 200 OK. - NAT/Firewall issue: This is actually the most common cause of one-way audio. If RTP packets from the remote party cannot reach your 3CX server due to NAT traversal problems, audio only flows in one direction. Ensure your firewall has UDP ports 9000β10999 open and that 3CX is configured with the correct external IP address under Admin β Network.
To distinguish between the two: if the issue is codec-related, you will see it in SIP traces. If it is NAT-related, the SIP negotiation will succeed (200 OK with matching codec) but RTP will not flow correctly β visible in a Wireshark packet capture.
In modern versions of 3CX (V18 and later), G.729 does not require a separate license β it is fully included in all 3CX licensing tiers at no extra cost. This was a point of confusion in earlier 3CX versions and with competing PBX platforms where G.729 required a per-channel or per-system license purchase due to patent royalties.
However, there is an important distinction to be aware of: while 3CX's software G.729 transcoding is license-free, some physical IP phones and hardware endpoints from manufacturers like Polycom, Cisco, or Grandstream still require a G.729 license purchased separately from the device manufacturer. This is a device-level requirement, not a 3CX requirement. Check your endpoint's documentation or manufacturer support page to determine whether a hardware G.729 license is needed.
For most softphone deployments using 3CX's own iOS, Android, or Windows clients, G.729 is fully available without any additional licensing.
G.711 U-Law (PCMU, SDP payload type 0) and G.711 A-Law (PCMA, SDP payload type 8) are two variants of the same G.711 codec standard. They are technically identical in audio quality and bandwidth β both deliver a MOS score of 4.1 and consume 64 Kbps (approximately 87 Kbps with headers).
The sole difference is the companding algorithm β the mathematical curve used to convert analog voice amplitude to digital values:
- U-Law (ΞΌ-law, PCMU): Used in North America (US, Canada) and Japan. SIP payload type 0.
- A-Law (PCMA): Used in Europe, UK, Australia, and most international markets. SIP payload type 8.
In 3CX, you should configure both in your codec list and place the one matching your SIP trunk's geographic market at the top. When a carrier receives your SIP INVITE, they will select the first codec in your offer that they support. For NetViaVoice US trunks: U-Law first. For international trunks: A-Law first.
Calls dropping after exactly 30, 60, or 90 seconds in 3CX are almost always caused by a SIP re-INVITE codec mismatch or session timer failure β not a network dropout. The SIP protocol requires periodic re-INVITEs to refresh the call session, and if the codec offered in the re-INVITE does not match the originally negotiated codec, the carrier rejects the refresh and terminates the call.
Here is how to diagnose and fix it:
- Enable SIP Tracing in 3CX: Admin β Advanced β SIP Tracing β Start trace
- Make a call and let it run until it drops. Stop the trace and search for
488 Not Acceptable HereorBYEmessages around the 30-second mark - If you see a re-INVITE being rejected, compare the codec in the original INVITE vs the re-INVITE β they should be identical
- As a temporary fix, enable Disable re-INVITE on the SIP trunk Options tab β this stops 3CX from sending re-INVITEs and eliminates this failure mode
- Long-term fix: ensure your codec list is consistent and that your SIP trunk supports session refresh
For full 3CX SIP trunk troubleshooting, read our guide: Guide to Setup SIP Trunk in 3CX.
βοΈ Need Expert 3CX Codec Configuration Help?
NetViaVoice engineers configure 3CX SIP trunks, codecs, and call routing daily. Whether you are starting fresh or troubleshooting audio issues, our team resolves 3CX codec problems fast β with full support for all NetViaVoice SIP Trunking customers at zero extra charge.