IMG 1010 - SIP Codec Negotiation
Overview
When an inbound SIP call is received, the IMG will negotiate what Codec to use when connecting the call. When negotiating a Codec selection the IMG must first know whether to use the Codec selections of the remote SIP gateway (Selections are in the SIP INVITE message.) or to use the Codec selections from the local IMG. Below is a screen capture of the SIP Profile Object Pane in ClientView. Note that either Local or Remote can be selected from a drop down menu in the Codec Priority Field.
The default Codec Priority is "Local". To change this you must create a new SIP profile. Once the new profile is created then the drop down menu will be accessible. Once the SIP Profile ID is updated to something other than 0 (Default) you will be able to edit the fields in this Pane.
Â
Codec Priority:
Local: (Default) If Local is selected then the IMG will look at its Codec Priority List created under the IP Bearer Profile Object Pane and select from that list the highest priority Codec which matches a Codec from the list of Codecs in the SDP Offer message from the remote Gateway. (Overlap Condition) This will be the Codec used. This ensures the IMG or local end decides which codec to use.
Remote: If Remote is selected then the IMG will look at the incoming Codec Selections from the remote gateway and match the highest priority Codec from that list with one of the selections from the IP Bearer Profile object pane in ClientView. This will ensure the remote end is deciding which Codec to use.
Example 1:
Consider the following media list offering from the remote Gateway. Highest priority is #1
G.711 ulaw
G.711 alaw
iLBC
Â
m=audio 5108 RTP/AVP 0 8 97
Â
If the SIP Profile Object Pane has Local as its Codec Priority and the following Codecs below are configured under the IP Bearer Profiles Pane in ClientView. (1 is highest priority) The negotiated Codec would be iLBC. G.711 alaw is the highest priority vocoder offered from the remote gateway, but the highest priority vocoder in the IMG list is iLBC. The IMG will give preference to its ordered list of vocoders and will respond offering only iLBC.
G.729
G.723
iLBC
G.711 alaw
Â
Note: The overlap of vocoders includes G.711 alaw and iLBC. Â
It is important to note the IMG gives priority to the list of codecs defined in the IP Bearer Profile object and does not respond with all vocoders in the overlap group when the Codec Priority is Local.
Example 2:
Consider the following media list offering from the remote Gateway. Highest priority is #1
G.711 ulaw
G.711 alaw
iLBC
m=audio 5108 RTP/AVP 0 8 97
Â
If the SIP Profile Object Pane has Remote as its Codec Priority and the following Codecs below are configured under the IP Bearer Profiles Pane in ClientView. (1 is highest priority) The negotiated Codec would be G.711 alaw. G.711 alaw is the highest priority vocoder offered from the remote gateway that overlaps with the Codec Priority List from the IMG. The IMG will give preference to the remote Gateways ordered list of vocoders and will respond offering only G.711 alaw.
G.729
G.723
iLBC
G.711 alaw
Â
Note: The overlap of vocoders includes G.711 alaw and iLBC. Â
It is important to note the IMG gives priority to the list of codecs defined in the remote Gateways Codec Priority List which is sent in the INVITE message.
Payload Size Priority:
Preferred Payload Size, Maximum Payload Size, Minimum Payload Size
The Payload Size can be negotiated with the remote gateway but does not negotiate using an ordered list. Below explains how the Payload size is negotiated.
If the remote gateway sends a preferred payload in the incoming SDP (ptime) and the payload size is valid and within the IMG's preferred payload Min/Max settings in the Supported Vocoders Object pane for the codec selected/negotiated, then the IMG will transmit that payload size in its RTP stream. See screen capture below of the SIP Profile Object Pane.
If the remote gateway does not send a preferred payload size or the payload size sent is not valid or not within our Min/Max range, the IMG will use its own preferred payload size for the transmitted RTP stream.
The IMG will include ptime for SDP Answers and for SDP Offers that include a single codec. When the IMG includes ptime in its SDP:
For SDP Offers, it will be based on the Preferred Payload Size.
For SDP Answers, it will depend on the setting for Ptime Source for SDP Answer. Refer to the SIP Signaling Gateway Profile (SGP) in the SIP Profile (see IMG 1010 - SIP Profile - 10.5.3) .