CODEC priority priority

Status
Not open for further replies.

Lee Cramman

Premier Customer
Advanced Certified
Joined
Jul 9, 2018
Messages
694
Reaction score
166
Could someone point me to a resource that explains in what priority 3CX evaluates CODEC priority.

By this I mean that if you have differing priorities but the same CODECs in PBX settings, Hot desk phone, Extension and Endpoint (not always the same thing if you're hot desking) which one overrides which?

My aim is to have all external calls via G711.A and all internal calls via G722.
 
G.711A as the first listed codec on your Trunk and G722 as your first listed codec on your extensions.
 
  • Like
Reactions: Lee Cramman
  • Like
Reactions: Lee Cramman
SIP is a standard, so 3CX will negotiate a Codec based on a set of established rules. You can read through this document if you want all of the info...

https://tools.ietf.org/html/rfc4317

In a nutshell (simple explanation)... the end that initiates a call, will have a list of Codecs to use. It will offer the ones in it's list, and the other end will check to see if those Codec are available in it's list to use. If the call passes to a trunk, and the trunk does not support the original Codec chosen, then transcoding by the PBX will/should occur.
 
Last edited:
  • Like
Reactions: Lee Cramman
Could someone point me to a resource that explains in what priority 3CX evaluates CODEC priority.

By this I mean that if you have differing priorities but the same CODECs in PBX settings, Hot desk phone, Extension and Endpoint (not always the same thing if you're hot desking) which one overrides which?
Please note that during an establishment of a call the codec that will be used as a general rule is the first one matching the providers (in this example) codecs. For example an inbound call arrives at the PBX from the provider with codecs:
  1. G711A
  2. G729
  3. G722
  4. G711U
  5. GSM
and your trunk is setup with codec priority:
  1. G722
  2. G729
  3. G711A
Then the PBX will send a 200 OK will all codecs in the order listed under the trunk settings. The provider can choose any of the 3 codecs we send back but as a general rule the first codec will be used (G711A). The 3CX PBX will also use the first codec offered. To "force" a single coded for all external calls that is not at the top of the providers list then could have a single codec configured under extension settings after you verified that the provider supports it for all call scenarios.

Internal calls are setup the same way but it is easier to setup as the PBX will always choose the top codec offered so if you have 2 endpoints with G722 as their top codec then G722 will be used.

My aim is to have all external calls via G711.A and all internal calls via G722.
This is where things become complicated as there are 2 legs to each call. To have G722 for all internal calls means that you will assign it as the first codec under all extensions. To have G711 for external calls that means that the first codec of the trunk will be G711. So for external calls you will have the leg from the PBX to the provider established with G711 and the leg between the PBX and the extension established with G722. This means that the PBX will need to transcode the audio which might result in some quality loss.
 
  • Like
Reactions: Lee Cramman
Thanks @YiannisH_3CX (and others).

That explains the behaviour I've been seeing. I don't think the quality hit and processor overhead due to transcoding is worth the improvement for internal calls and my provider does not support G722 so I guess I'll stick to G711A across the board for now.
 
  • Like
Reactions: YiannisH_3CX
Glad we could help
 
  • Like
Reactions: Lee Cramman
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
111,901
Messages
589,636
Members
164,768
Latest member
Eagle Man