Codec order for incoming calls

Hello,

I had to configure the codec order of my Freepbx version 15.0.23. So I went to Settings> Asterisk SIP Settings> Codecs and there I change the order and selected the rights codec to match the codec and order of my SIP provider.
The codec of my SIP provider is G711A, G729, GSM,G721,G711U.
When I make a call to the outside, my Freepbx use this order, but when someone from the outside call, my Freepbx propose this codec order: G711U, G711A, GSM, G721, G729 and then it use G711U.

I read a lot of forum and tried a lot of things to change this order, which is not the order I configured in Asterisk SIP Settings.

Here is my trunk config for Outgoing calls:
type=peer
trustrpid=no
sendrpid=yes
qualify=yes
insecure=port,invite
host=MY_SIP_PROVIDER_IP
dtmfmode=rfc2833
disallow=all
allow=alaw&g729&gsm&g726&ulaw
context=from-trunk
canreinvite=no

And my trunk config of incoming calls:
type=friend
insecure=port,invite
disallow=all
allow=alaw&g729&gsm&g726&ulaw
context=from-trunk

The codec priority on the phones is the same as what you see above.
There is no register string as there is no username/password, it is based on IP address.

Thanks for your help

It is unlikely that your trunk config of incoming calls is actually being used, as providers are likely to set the From user to the caller ID, not the sip.conf section name, and you haven’t specified a host. Even if you did specify a host, it would need to be different from that for outgoing calls, for there to be any certainty that the outgoing section wouldn’t be used. Generally most “outgoing” options should be repeated in the “incoming” section, if you need one at all.

The preferred order for codecs in a response is the order that was received, so what order is in the offer from the provider? These are only SHOULD rules in the RFC, so can be ignored.

In any case, you should be, urgently, planning to move to chan_pjsip.

Which country are you in? If you are in the Americas, or Japan, I would expect the provider to offer G.722 µ-Law as the first, and possibly only, choice.

Why are you offering the provider so many choices?

Hi David55,
Thank you for answering.

The offre from the provider is G711A, G729, GSM, G721 and G711U.

My trunk is working in chan_sip and my phones in chan_pjsip. Is my trunk going to work in chan_pjsip?
I’m in Belgium.

I’m offering the same choices as the provider, don’t really know if so many choices are necessary.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.