cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
9091
Views
5
Helpful
2
Comments
Dennis Mink
VIP Alumni
VIP Alumni

I would like to take the opportunity to give a brief overview on codec preference lists. How to apply them and when you might be using them. 

 

the reason I had to dig into the art of codec preference lists is because I was working on an issue where I wanted to force calls into Webex to establish, using G711ulaw, instead of the G722 it was using.  in order for me to achieve this, I had to add a separate codec preference list in the regions configuration web page in CUCM.

 

What are audio codec preference lists?

Codec preference list are list that define the preferred codecs to be used by a telephony endpoint in descending preference. So the top codec in the preference list is the most preferred codec.

These can be configured, by going to System > Region > Codec Preference list. 

First time you navigate to the codec preference list you will see two default lists already pre-populated:

-Factory default lossy

-Factory default low loss

 Don't worry to much about these existing lists, just copy them and rename them to make your own list. So I created on that forces G711 over G722, by bringing G711 codecs to the top of the list and demoting G722 to the lower parts of the list.

Fig.1 customises codec preference list

Now before I continue, let me explain when these codec preference list kick in.

Audio codec preference lists are only invoked for an inter region call. So when a phone in region A calls a phone in region B, the codec preference list defined in the regions relation ship between these two regions, will be used. So to make this clear when a call is attempted between two phones in the same region, the audio codec preferenc list will NOT be invoked and the codec preference inherent to the phones will be used. For instance two SX20's in the same region will establish a call using the AAC-LD codec.


Typically, endpoints send their codec capabilities inside an SDP in descending order of preference as per RFC5939


https://tools.ietf.org/html/rfc5939 



How to apply preference lists?

 

Back to our example. Before I put in the codec preference list the Early Offer INVITE contained the following codecs:

Fig.2. SDP preferring G.722

Now, i will force the codec list from Figure 1, to be used between region Force_g711 and WA_Perth  , by changing the region relation as follows:

Fig.3 applying the preference list to the regions

By assigning the G711 preferred codec list to be invoked between the two regions as can be seen in Figure 3.


Now, let test a call between the two regions and see what the SIP SDP contains.

The originating Early offer of the calling phone, will still contain an SDP with G.722 as the most preferred codec (as in Figure 2), nothing new so far. The second part of the signalling path; between CUCM and the called phone, uses delayed offer. The called phone responds with an SDP in the 200 OK, containing its codec preference:

Fig.2

Again G.722 on top and then G.711. So far this is all very expected as the phones advertise their own codec preference completely independent of the region relationships they are part of. At this stage CUCM knows the codec preference of both phones and will now make a decision based on its local codec preference list. Because G711 is the preferred codec, CUCM now sends a 200 ACK (remember it is responding to Delayed Offer) to the following phone,  with the following SDP:


And with this this the deal is done, CUCM answers with a single codec: G711. Through its preference list, G711 is higher than G722 and thus signals G711 back to both phones, forcing them to use G711. The 200 ACK that goes back to the calling phone, again, contains only G711 in its SDP.


At this stage all phones are forced to set up an RTP stream using G711.

And they all lived happily ever after

Comments
KY_
Level 4
Level 4

As I udnerstand correctly it chooses always bitrate not codec right ?  that mean ;

If I select the codec g711 and G729  that I have listed on the codec preferrence  list and choose bitrate 50k, it will be priority g729.

One another example if i select again firstly  and G729  variant and g711Ulaw/Alaw using 64K bitrate then it will choose G729.

Dennis Mink
VIP Alumni
VIP Alumni

Kemal,

no, so if you select G711 and second G729 and a bit rate of 50k in your region relationship, it will select G729 Because G711 has a bit rate of 64 as hence cannot be advertise because of the region 50k setting.  If you set region to 64k with G729 on top followed by G711, G729 is the preferred codec and will be attempted to be negotiated first, even though G711 fits withing the BW..   the best way to verify is to look at your SIP SDP;s and see what codec list it contains.

Please rate if useful.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: