Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

How do codec preference classes really work?

I've done a lot of testing lately regarding codec preferences, and even though I've figured out my own logic... I'm still a bit confused. I wasn't able to locate any reference document on the subject so maybe that's why I'm not certain that the way I see it working is the right way.

Let me give you an example:

Router1

voice class codec 1

codec preference 1 g723r53

codec preference 2 ilbc

codec preference 3 g729br8

Router 2

voice class codec 1

codec preference 1 ilbc

codec preference 2 g723r53

codec preference 3 g729br8

The routers are connected over an IP connection. The correct dialpeers are also configured, all works fine. But, to me it's a bit still not certain on how the codec preferences work.

So, if I establish a call from Router1 to Router 2, the ILBC condec is selected.

If I establish a call from Router2 to Router1, the G.723 codec is selected.

I've plaied aroud with differend codec classes, codecs and preferences... lots of voice debugs. So the "logic" I've come up with is:

1. The Voice Gateway that initiates the call sends it's capabilities. It is dependent off course on the voice class codec that is associated with the outbound dial-peer.

2. The Voice Gateway that receives the call determines which codec will be used and the codec which is selected for the voice payload.

3. The "logic" is simple, the terminating Voice Gateway takes the codec with the highest preference locally configured, and starts matching it with the offer received by the originating Gateway. Once a match is found, the matching codec is selected for the call. If not, the second highest preference codec is again matched against all codecs that are offered, until a match is found, and so on.

So, am I getting this correct, or I'm completely wrong?

Again, if you have any reference documents, I would be grateful if you share them. I was not able to find any, but maybe I've searched with wrong key words...

Everyone's tags (4)
3 REPLIES
Hall of Fame Super Silver

How do codec preference classes really work?

When call is being established in the setup message the codecs are sent and need to be negotiated between both routers, the way it works for you is expected as router 2 responds to router 1 with what they want to use based on offered allowed list of codecs, this would be controlled by the ingress voip dial-peer on router 2. Since ilbc is listed first on router 2 and it is allowed on router 1, router 2 responds to router 1 with it.  You can see this taking place in the SIP messages if using SIP or h245 if using H323.

HTH,

Chris

How do codec preference classes really work?

+5 to Chris.

Just to say the same thing, but in a different way:  The offer from Router 1 is a "wish list" but ultimately, it's up to Router 2 as to which codec gets chosen.  And Router 2 has ilbc at the top of its list, so that's what it goes with.

As far as documents go, I think it would depend on your signalling protocol.  For example, if you read about SIP, you will read that there is an Offer (SDP) and and Answer (SDP).  In Early Offer, the SIP UA Client is giving up the power to choose (provided there's more than one codec to even choose from) to the SIP UA Server.  In Delay Offer, the SIP UA Client is reserving the right to be the final say in which codec is selected.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
New Member

How do codec preference classes really work?

That's really interesting. I must find time to test this out. I didn't know about this behaviour in SIP Early Offer and Delay Offer. Very helpful. Thank you both!

223
Views
18
Helpful
3
Replies