Trying to figure out codec usage

Status
Not open for further replies.

ovizii

Forum User
Joined
Nov 20, 2017
Messages
55
Reaction score
1
I'm slightly confused by a few settings regarding codec usage.

Here is my scenario:

1 office
1 PBX in the cloud

10 Users => 20 Endpoints of which 10 3CX windows clients and 10 mobile 3CX clients.

Q1. When defining an extension, I supply provisioning rules with a specific codec order. I assume this order is used if my clients call each other?

Q2. When setting up my trunk which will route all calls to mobile and land line numbers, I setup another codec order. I assume this order is used for all other calls?

Q3. When going to the 3CX PBX, Settings => PBX I find codec settings for internal and external calls. How do these relate to my Q1 and Q2? What will they affect?

I don't use SIP calling, only internal calls and external calls to mobile and land lines going through my trunk provider.
 
When a SIP message is sent from a UA, in the SDP body the device will normally send a list of codecs which it supports (with the preferred codec first).

The called agent will then respond (in a 200 response) with its own SDP details and the devices will negotiate the codec to be used in the session (among other things) based on which they both support.

SDP Body: m=audio: shows the media type (audio/RTP/media) followed by the codecs a=rtpmap:0 pcmu/8000 (for example).

What this means is that despite what you have set and is being sent, based on the reply it may not take your preferred codecs - the 200 OK will tell you.

As you have identified already there are a lot of factors, what the phone/endpoint supports, what the extension on 3CX supports, what the trunking provider supports etc.

G711 mu-law you will find is the commonly used mandatory codec in most cases.

I would normally say trace this with Wireshark and see what they SIP messages in the dialogue say however since you are only using the clients (and thus 3CX tunnel) you may have difficultly capturing what you need.
 
Thanks for the details, that's surely extra information I was only partially aware off.

Yet, my questions still stand. I hope I expressed myself clearly, the intention of Q1-3 was to figure out what exactly and when exactly these 3 different audio codec priorities would be applicable to.
 
OK:

Q1. The extension will provision the phone with the list of codecs you specify in the extension - this is what the device should state it wants to use when a call is made.

As standard PCMU, PCMA, G722, G729.

Q2. Codecs for the trunk when connecting to the provider a "Generic trunk" uses G.711 U-law, G.711 A-law, GSM-FR but this can vary per provider.

Q3. From the PBX interface:

Codec Priority for Local/Internal Calls:

These codecs are only apparent for local extension to extension calls. And if you have PBX delivers audio turned on, using call recording or (I imagine) extensions using STUN perhaps as they use this setting also.

Codec Priority for External Calls:

Anything other, however my assumption is that these will be default unless specified otherwise by the trunk etc.

Notes:

PCMU = G711 Ulaw
PCMA = G711 alaw
G722 is a wideband codec (which are non-mandatory).
G729 is a compression codec (DTMF, fax transmissions, and high-quality audio cannot be transported reliably with this codec).
 
Thanks that clarified all of those questions but here is a last one:

Did I understand correctly that in my case where I only have calls between extensions and calls to external recipients which go through my trunk, the settings I provision to my various 3CX clients (Q1) never get used as for calls to other internal extensions the settings of Q3 and for calls to external recipients the settings in Q2 are being used?

Or, if i got this wrong then Q1 and Q2 are being used and Q3 never gets used?

I see an overlap in these settings because I don't have direct SIP calls and one of these 3 settings apply to SIP calls. (my guess is that Q3 applies to SIP calls)
 
Direct SIP calls apply to phones using remote STUN as their setup/provisioning method (it could also apply to remote SIP connected FXS Gateways I suppose also).

The audio for all these types of calls has to travel back to the PBX and back up to the remote site again, where tunneled audio does not.

You are using tunneled devices (SIP clients have in-built tunnels unless the setting is turned off in the client default setting) and would fall under external codecs ("The codec will be used for calls to remote apps") this would surmise this is Apps such as the softphone application for Windows, Iphone, Android etc.

Getting a reliable trace (if possible) would tell us more.
 
Thanks for the reply. I know most of what you said BUT I am struggling to connect it to the 3CX admin interface and my Q1-3

Direct SIP calls apply to phones using remote STUN as their setup/provisioning method (it could also apply to remote SIP connected FXS Gateways I suppose also).

The audio for all these types of calls has to travel back to the PBX and back up to the remote site again, where tunneled audio does not.

i.e. does Q1 or Q3 apply to Direct SIP calls?
(btw. you're right, all my 3CX use the built-in tunnel and I am not using any device with remote STUN)

I thought audio traveled directly between two SIP devices when making direct SIP calls but I might be wrong.

Getting a reliable trace (if possible) would tell us more.
I could supply one but I don't have a problem to fix, I am simply trying to understand which of the Q1-3 settings applies to which type of calls :and you have helped me out a lot so far :-)
----------------------

after your help this is my conclusion:

  1. Q3 - external call settings: applies to calls from my 3CX clients to each other
  2. Q3 - internal call settings: - no idea what this applies to - possibly to internal phones which I don't have in my setup?
  3. Q2 - trunk settings: when a call from a 3CX client which goes through a trunk, the settings in Q1 and Q2 are compared and the first codec these 2 agree on is used between my 3CX client and the trunk provider.
  4. Q1 extenson settings: is redundant in my setup as I don't make direct SIP calls where these settings would apply.
 
Status
Not open for further replies.

Forum statistics

Threads
111,893
Messages
589,598
Members
164,761
Latest member
SaschaA_