CUC (6) CUCM (28) Jabber (6) Python (2) Routing (3) Solarwinds Orion NPM (4) switching (1) Video (6) voice (3)

Sunday, 9 April 2017

Cisco Unified Call Manager audio codec preference lists and some SIP

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 customised codec preference list, preferring G711 over G722

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 

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:

Figure 2, SDP preferring G722

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:

Figure 3,  assigning codec preference between 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:

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 know 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.


No comments:

Post a Comment