G729 Codec Help

Status
Not open for further replies.

ChrisLab

Member
Aug 9, 2023
32
2
8
38
Hi All,

I can't get G729 codec to work.
It seems like my G729 entry in "global_codec_prefs" and "outbound_codec_prefs" are being ignored.

fs_cli -x "show codecs" b | grep g729 gives
codec,G.729,mod_bcg729.

When I make a call I get:

2024-01-23 10:28:09.354570 97.90% [DEBUG] switch_core_media.c:5526 Audio Codec Compare [G729:18:8000:20:8000:1]/[G722:9:8000:20:64000:1]
2024-01-23 10:28:09.354570 97.90% [DEBUG] switch_core_media.c:5526 Audio Codec Compare [G729:18:8000:20:8000:1]/[PCMU:0:8000:20:64000:1]
2024-01-23 10:28:09.354570 97.90% [DEBUG] switch_core_media.c:5526 Audio Codec Compare [G729:18:8000:20:8000:1]/[PCMA:8:8000:20:64000:1]
When I do sofia status profile internal, I get:
CODECS IN G7221@32000h,G7221@16000h,G722,PCMU,PCMA
CODECS OUT G7221@32000h,G7221@16000h,G722,PCMU,PCMA
Under switch varibles i've got:
global_codec_prefsG729,G7221@32000h,G7221@16000h,G722,PCMU,PCMATrue
outbound_codec_prefsG729,PCMU,PCMATrue

Anybody have an idea whats happening here?
Thanks!
 
Last edited:

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,505
420
83
Hi,
Have a look at "inbound-codec-negotiation" in your SIP Profiles. I think that by default it is set to "generous" which means FreeSWITCH will try to accommodate the coded priorities requested by the endpoint. I always set it to "greedy", that way it is more likely that the negotiation will result in the codec(s) that I want to see being used.

A couple of other points:
1. If you use UDP, then keep the number of codecs you offer to a minimum, otherwise the extra data in the SDP body can cause the packet to exceed your MTU.
2. Try to organise your codecs so you avoid transcoding. Transcoding can put a heavy load on your CPU.

You may find the FreeSWITCH documentation on codec negotiation helpful:
https://developer.signalwire.com/fr...d/Codecs-and-Media/Codec-Negotiation_2883752/
 
  • Like
Reactions: falk

ChrisLab

Member
Aug 9, 2023
32
2
8
38
I ended up redoing the work of getting mod_bcg729 loaded etc..

I think my main problem wat that
status profile internal, didn't show G729 anywhere, but it showed under variables page that it was added.
CODECS IN G7221@32000h,G7221@16000h,G722,PCMU,PCMA
CODECS OUT G7221@32000h,G7221@16000h,G722,PCMU,PCMA

The above now shows G729 included, and the default mod_g729 is disabled/and not running.
I also set the inbound-codec-negotiation to greedy on both profiles.

Thank you for the information provided above!!
I'll look into points 1 & 2.


Thank you!!
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,505
420
83
If the codecs listed in 'sofia status profile internal' don't match what you have in variables, check that your profile settings are using
$${outbound_codec_prefs} and $${global_codec_prefs}
If they are try reloading the SIP profiles.

You may need to restart freeswitch if the $${} variables are not getting pre-processed.

I have always set my codecs in each SIP profile rather than using the $${} variables.
 
Status
Not open for further replies.