transcoding and Ring Group

Status
Not open for further replies.

nobody

Bronze Partner
Joined
Aug 15, 2017
Messages
500
Reaction score
57
I sometimes wondering why transcoding on the pbx is in effect, therefore reducing the Call-Quality to a rather not acceptable value, even if the called or calling party uses G711. Today I maybe found a reason: If the calling party uses G711, but if the Call first goes to a ring group, and then is picked up by a phone connected to this ring group, if seems, that even if I set the phones codecs to prefer G711, the pbx rules for internal calls take precedence, and call will then be transcoded by the pbx to G722 (metallic hissing, not acceptable IMO).
If I make an outgoing call to the same caller the call is done without transcoding in G711

Why is the called handled this way, even if it is an external call?
 
Last edited:
Hi,

What does trunk provider support, do they send the call to you in G711 (see Trunk Settings>Options)?
This covers the route from provider to your PBX


What do the phones support, is G711 their first codec (see Extension settings>Provisioning)?
This covers the route from your desk phones to the PBX

If both the above don't have a common codec, transcoding will take place. You need to find who in the pipeline does not have G711 (PCMA/PCMU) at the top of their codec priority list

You can also check your Settings > General Settings ands push PCMA/PCMU up the list for Local and External calls
 
PBX ist still V15.
Provider uses G711 (incoming out outgoing), i monitored this using wireshark
Phone (yealink T58A) has G711(PCMA) on top priority
PBX has G711 for external calls on top
PBX has G722 for internal calls on top
I attached a picture. This is the call when monitoring the IP Adresse of the phone.
The incoming call goes to a Ring group, where this phone is associated.
192.168.49.78 is the PBX ip address
192.168.49.94 is the phone ip address
The phone shows "HD" on the display.
If I would monitor the comunication between provider and pbx, I only will see G711 packets.
 

Attachments

  • sip-g722.JPG
    sip-g722.JPG
    31.7 KB · Views: 6
PBX has G722 for internal calls on top

Since your Local / Internal Calls codec is set to G722 on top of PCMA PCMU, try to move it down the list below those two.

10381
 
I already tried this out before, and it fixes the problem, Thats why I wrote the post. But this is a workaround for a bug in my opinion. If there is no difference for internal or external calls why is this feature availible?
Also it is possible to make a connection not using transcoding - phone, pbx and call all support the codec of the incoming call. This would be the preferred way in all cases, because transcoding introduces quality problems.
 
  • Like
Reactions: nitrox
It's there because some times transcoding is necessary, it covers more scenarios and allows flexibility (ie. if you happen to use endpoints that don't have a common codec, or if you wish to use a less bandwidth costly codec for your own reasons).

As an example, if a call enters the PBX, and the PBX will establish the next leg towards an endpoint that does not support the incoming codec, it will transcode (which is a positive thing - better chances to have audio).

In your case, you simply wish to avoid unnecessary transcoding (which is also a positive thing - less cpu load and audio remains unaltered) so simply rearrange your PBX and devices codecs to what your provider sends and you will end up with the least cases that will require transcoding.
 
You do not realize there is a bug in the software?
If a rule which should only match internal calls acts on external calls, I would call this a bug.

The second thing is that these rules work in a way which will not lead to the best possible audio quality if the first rule of the pbx always wins, instead the probability for transcoding rises. Example:
incoming Call with G711, pbx top prio is G722, phone trop priority is G711, but accepts G722: pbx wins->transcoding (bad)
incoming Call with G722, pbx top prio is G722, phone top prio is G711 but will accept G722: no transcoding(good)
incoming Call with G729, pbx top prio is G722, phone prio is G711, pbx wins, transcoding (bad)

So what currently is happening: any external call is either transcoded to G722 (even if call, phone and pbx would be able to agree to the codec of the call). Only If someone calls with G722 I will get an acceptable audio.
The only way to fix this is to set the trunk to accepty only G711a, then set the pbx prio to G711a, but this would bear the risk of some calls beeing not connected or forcing the calling side to do transcoding. Why then there are differenty codecs exist anyway? Why is there an option of codecs if the first is chosen in all cases (assuming the phone is able to use it)?

Or: How should the rules in the pbx settings behave?

The correct way in my opinion to use the pbx codec table is:
The pbx table should be used to pick a replacement codec only if no common codec for call,pbx,phone is found in the list of the pbx codecs. Only in this case the preferred codec should be tried first, then the second...
Also the table for the internal calls should only act on internal calls, the table for external only on external calls, otherwise two tables are only irritating.
 
I understand and will attempt to describe in more detail so you can better comprehend the reasoning behind my previous post, and if anything is unclear please let me know and I will be happy to expand further. So here goes:

When a call arrives from the provider, the PBX will answer call leg 1 with whatever codec the provider sends as a first match (provider wins).

When the PBX creates call leg 2 (from the IVR to the extension), this new call leg is now an internal call from the IVR extension to the user extension. The phone will answer the call with whatever codec the PBX sends as a first match (pbx wins, but has preserved the the provider's original codec).

Generally speaking, whoever initiates a call leg decides the codec priority. So if everyone downstream from the provider has the same codec priority, my original statement should hold true and we will transcode only if we have no choice.

There are some exceptions to the rule (i.e extension to extension calls without the PBX Delivers Audio option) but if you follow the above method I reckon you will find it satisfactory.
 
Good, then I will continue for a new round:
Given what you tell is correct, the system behaves correct.
The "external Call" codec list is used for any call which the pbx originates outward to a trunk.
the "internal Call" codec list is used for any call which the pbx makes to extensions.
Fine with me and understood.

Still, when making an internal call (when an external call arrives) should be made with more intelligence, I think, the primary goal is call quality, given that a call can be routed to an extension. If quality cannot be guaranteed, then, quality has to be reduced (use transcoding).
I woud not complain if the transcoding quality is be better than it currently is, especially when trancoding from G722 to G711.
The current behaviour of the pbx trying to use the first codec regardless of the codec the incoming call uses is wrong. Instead, first try to use the codec the arriving call uses, and, if no match, then use the list. This is not hard to implement and I see only positive effects.
Example:
Current system:
Trunk can accept 4 codecs (G711,729,722,GSM), assume an equal/random distribution of incoming calls. With the current sytem only 1 in 4 calls will be not transcoded - users complain.
Prefer the Codec of the Call:
Most likely 100% of the calls will not be transcoded, or at least 75% (given that there are phones which cannot accept G722). This is a much better result.
 
Unless there is a compelling reason not to (and some people do have valid reasons not to), it is best to use (as first choice) on all devices, and in 3CX, the incoming Codec used most, by your provider.
 
Last edited:
  • Like
Reactions: JohnS_3CX
leejor: yes, this kind of workaround is for sure better then setting the less used codecs.
But then the best way to work around call quality because of transcoding, is to reduce the codecs for the trunk to G711 and nothing else. Then set the PBX preferences to G711 you will have 100% calls not transcoded. Lets the callers transcode, or they hve to hangup. But why then use different codecs anyway?
 
Some users want to make use of HD Codecs for internal calls, if the sets are able to support. Some want to use a low bit-rate Codec over certain (bridge?) trunks because of bandwidth concerns. While "standardizing" on g711 across all devices would seem to be ideal, it doesn't work for everyone.
 
  • Like
Reactions: JohnS_3CX
Status
Not open for further replies.

Forum statistics

Threads
111,923
Messages
589,752
Members
164,796
Latest member
Dame24