# Codec Priority Order

**URL:** <https://community.asterisk.org/t/codec-priority-order/94271>\
**Category:** Asterisk SIP\
**Created:** [October 4, 2022, 1:01pm UTC](https://community.asterisk.org/t/codec-priority-order/94271 "2022-10-04T13:01:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![st6](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@st6](https://community.asterisk.org/u/st6)\
**Post date:** [October 4, 2022, 1:01pm UTC](https://community.asterisk.org/t/codec-priority-order/94271/1 "2022-10-04T13:01:17Z")

</div>

Hello Guys,

Can I force asterisk to follow which codec priority order it should offer to my carrier ? I have in my pjsip.conf:

disallow = all  
allow = alaw,g729,ulaw

then when I make a call I have this order in my invite:

![image](https://global.discourse-cdn.com/asterisk/original/2X/3/37282978113a8d966ffcea788e7148c0b7d43b08.png)

I would like to have in my SDP the same order as I configured in pjsip.conf.

My asterisk version is: 18.14.0

Thank you in advanced.

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [October 4, 2022, 1:39pm UTC](https://community.asterisk.org/t/codec-priority-order/94271/2 "2022-10-04T13:39:38Z")

</div>

> <https://github.com/asterisk/asterisk/blob/master/configs/samples/pjsip.conf.sample#L832>

As it says, the default is to use the A side order, to minimise the need for Asterisk to transcode.

If you are in an A-law country, you should make sure all your local devices prefer A-law, otherwise you will end up with a, very slightly lossy, unnecessary transcode.

---

<div class="post-metadata">

**Author:** ![st6](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@st6](https://community.asterisk.org/u/st6)\
**Post date:** [October 4, 2022, 2:12pm UTC](https://community.asterisk.org/t/codec-priority-order/94271/3 "2022-10-04T14:12:12Z")

</div>

Worked very well ! Thanks !

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [November 3, 2022, 2:13pm UTC](https://community.asterisk.org/t/codec-priority-order/94271/4 "2022-11-03T14:13:07Z")

</div>

Closed on November 3, 2022, 2:13pm UTC

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