6.3 Cisco Unified Communications Manager Codec Configuration

This topic describes how to configure Cisco Unified Communications Manager to limit the codec that is used for a call.

  • Use high-bandwidth codecs in LAN environments.
  • Use low-bandwidth codecs for IP WAN.
  • Low-bandwidth audio codecs are designed for human speech:
    1. Do not work well for other audio streams, such as music.
    2. Use alternative methods for MOH:
      • Disable MOH for remote sites.
      • Use multicast MOH from branch router flash.

To conserve IP WAN bandwidth, you should use low-bandwidth audio and video codecs in the IP WAN or allow only audio calls across the network. For calls within a LAN environment, you should use high-bandwidth codecs for optimal audio and video quality. When you are deciding where to use which type of codec, it is important to consider that low-bandwidth audio codecs, such as G.729, are designed for human speech. They do not work well for other audio streams, such as music. Therefore, you should use alternative methods for MOH, including multicast MOH and multicast MOH from branch router flash. If you cannot use an alternative option, but MOH streams are not desired on the IP WAN, you can disable MOH for remote site phones.

Cisco Unified Communications Manager Codec Selection

This section reviews how to control the codec that is used for a call in Cisco Unified Communications Manager.

  • Each region can be configured with the following settings:
    1. Maximum audio bit rate and audio codec preference list
    2. Maximum session bit rate for video calls
    3. Maximum session bit rate for immersive video calls
  • Settings are configured independently:
    1. For calls within the configured region
    2. For calls toward specific other regions (manually added)
    3. For calls toward all other regions (that have not been manually added)
  • Region is assigned to a device pool.
  • Device pool is assigned to a device.
  • Codec selection depends on the following:
    1. Region configuration
    2. Codecs that are supported by both endpoints
    3. If devices cannot agree on a codec, a transcoding device is invoked.

The codec that will be used for a call depends on the Cisco Unified Communications Manager region configuration. A region is assigned to each device via the device pool configuration.

You can configure four settings at the region configuration page:

  • Maximum audio bit rate: This setting specifies the maximum permitted audio bit rate of the audio codec. For example, if you set the maximum audio bit rate to 64 kbps, then G.722, G.711, and all codecs that have a lower audio bit rate than 64 kbps are permitted.
  • Audio codec preference list: This setting refers to a configurable audio codec preference list in which you can list the audio codecs in preferred order. Default audio codec preference lists exist for lossy network links and for network links with low losses.
  • Maximum session bit rate for video calls: This setting specifies the maximum permitted bit rate of a video call. The bit rate includes the audio and the video channel. The maximum audio bit rate that is used by the audio codec in the audio channel is determined by the maximum audio bit rate setting. The remaining bandwidth is used by the video channel.
  • Maximum session bit rate for immersive video calls: This setting has the same function as the maximum session bit rate for video calls, but it applies to calls between immersive video endpoints.

The listed settings can be configured within a region, to other specifically listed regions, and to all other (not listed) regions.

Note

The configuration between two regions applies to both directions. If you change the settings toward region B at the configuration page of region A, then the configuration of region B toward region A is automatically updated.

When a call is placed between two devices, the codec is determined based on the regions of the two devices and on the capabilities of the devices. The devices will use the most preferred codec that is supported by both devices and that does not exceed the configured bit rate for the region or regions that are involved in the call. If the two devices cannot agree on a codec, a transcoder is invoked, if available. Two devices may not agree on a codec if, for instance, the region configuration allows only 8 kbps as the maximum audio bit rate but one device supports only the G.711 audio codec.

Example: Codec Configuration

The figure shows a sample scenario for codec configuration in Cisco Unified Communications Manager.

In the figure, phones that are located in the headquarters are configured with region HQ_phones. An intercluster trunk that connects to another Cisco Unified Communications Manager cluster and a SIP trunk connecting to anITSP are in region HQ_trunks. The PSTN gateway that is located in the headquarters is configured with region HQ_gw. At the remote site, phones are in region BR_phones and the PSTN gateway is in region BR_gw.

Cisco Unified Communications Manager regions are configured in the following way:

  • Within HQ_phones: G.711
  • Within HQ_gw: G.711
  • HQ_phones to HQ_gw: G.711
  • Within BR_phones: G.711
  • Within BR_gw: G.711
  • BR_phones to BR_gw: G.711
  • All others: G.729

As a result, of this configuration, all calls that use the IP WAN between the remote site and the headquarters use G.729. Calls that are sent through the intercluster or SIP trunk also use G.729. These calls use G.711 calls between phones within the headquarters, calls between phones within the remote site, calls from headquarters phones to the headquarters PSTN gateway, and calls from remote site phones to the remote site PSTN gateway.

Allow Codec Selection Based on Codec Preference Received from SIP Devices

This section describes how audio codec preferences received by SIP devices can be considered for the audio codec selection.

  • Clusterwide Cisco CallManager service parameter exists:
    1. Accept Audio Codec Preference in Received Offer
    2. Can be enabled or disabled (default is disabled)
    3. Applies to SIP lines and trunk devices
  • Per-device configuration is possible via SIP profile configuration.
  • If enabled, received codec preference is considered.
  • Codec that is actually used depends on region configuration, device configuration, and protocols that are used by the two devices.

In addition to customized audio codec preference lists, the codec preference of received SIP offers can be honored when selecting the codec to be used for a call.

The administrator can configure Cisco Unified Communications Manager to accept the audio codec preference that is received in a SIP offer from a SIP line-side device or from a SIP device that is reached via a trunk. To do so, the Accept Audio Codec Preferences in Received Offer parameter must be changed from its default value of Disable to Enable. You can set the parameter as a clusterwide Cisco CallManager service parameter or individually per SIP profile. The parameter applies to SIP line and trunk devices.

The codec that is actually used still depends on the audio bit rate that is permitted by the region configuration. If certain codecs are not permitted by local region configuration, these codecs are filtered from the received list. The codec selection also depends on the configuration of the two devices (whether the received audio codec preference is accepted at the calling device, the called device, or on both devices) and on the protocols that are used by the two devices.

Codec Selection When Using Accept Audio Codec Preferences in Received Offer

This section describes which codec will be selected. Selection depends on the protocol that is used by the calling and the called devices, and the configuration of the Accept Audio Codec Preference in Received Offer parameter.

Accept Audio Codec Preferences in Received Offer enabled at calling device? Accept Audio Codec Preferences in Received Offer enabled at called device? Method of Codec Selection
Enabled Enabled If preferred codec of both devices is the same, use the preferred codec. Otherwise, use codec preference from the region or regions.
Disabled, non-SIP device, or not applicable Disabled, non-SIP device, or not applicable Use codec preference from the region or regions.
H.323 ICT Enabled Use codec preference from the region or regions.
Disabled, other non-SIP device, or not applicable Enabled Use codec preference of the called device.
Enabled H.323 ICT Use codec preference from the region or regions.
Enabled Disabled, other non-SIP device, or not applicable Use codec preference of the calling device.

Parameter Enabled on Both Devices

Consider a situation where both the calling and the called device have the Accept Audio Codec Preferences in Received Offer parameter enabled. This situation is only applicable to SIP devices. In this case, the most preferred codec of both devices is used, if that codec is the same on both devices. Otherwise, the audio codec preference list that is configured for the applicable region or regions is used to choose the codec.

Note

Depending on the device configuration, one region (intraregion call) or two regions (interregion call) may be applicable to the call and to the codec selection process.

Parameter Disabled or Not Applicable on Both Devices

If the Accept Audio Codec Preferences in Received Offer parameter is either not applicable (in the case of a non-SIP device) or disabled (in the case of a SIP device) on both devices that are involved in the call, then the audio codec preference list of the applicable region or regions is used.

Calls Between H.323 ICT and SIP Device with Enabled Parameter

If one of the two devices is an H.323 ICT and the other device is a SIP device with the Accept Audio Codec Preferences in Received Offer parameter enabled, then the audio codec preference list of the applicable region or regions is used.

Calls Between SIP Device with Enabled Parameter and Other Nonenabled Device

If one device is a SIP device with the Accept Audio Codec Preferences in Received Offer parameter enabled and the other device is either a SIP device with the parameter disabled or any non-SIP, non-H.323 ICT device, then the received audio codec preference of the SIP device that has the parameter enabled is used.

Additional Considerations

The Accept Audio Codec Preferences in Received Offer parameter never applies to non-SIP devices.

If applied to a SIP device, the parameter is not applicable when the SIP device does not provide a codec list; that is, no SDP has been received from the device. As an example, this situation exists when an INVITE (with delayed offer, and consequently without SDP) is received on a trunk. Even if the Accept Audio Codec Preferences in Received Offer parameter is enabled at the receiving trunk, it is treated as if it is disabled because the parameter is not applicable when the device does not provide a codec list.

On calls that go out of a cluster, the called and calling devices in the table refer to the devices of the cluster and not to the two endpoints of the call. The calling devices are the devices from which Cisco Unified Communications Manager received the inbound INVITE. The called devices are the devices to which Cisco Unified Communications Manager sends the outbound INVITE. On an intercluster call, at the originating cluster the calling device is the locally configured phone and the called device is the SIP trunk that refers to the terminating cluster. At the terminating cluster, the calling device is the SIP trunk that refers to the originating cluster and the called device is the phone that is registered at the terminating cluster.

The table does not apply when the called device is a SIP trunk using early offer. The behavior on outbound SIP trunks using early offer is different and depends on the configuration of the SIP trunk.

Note that on SIP trunks using delayed offer, the direction of the call setup (INVITE) is the opposite of the initial SDP offer (OK). The calling and called devices in the table refer to the direction of the call, not to the direction of the initial SDP offer.

Whenever a cluster sends out a codec list (SDP), the cluster uses the logic that is shown in the table to check whether the previously received codec list should be modified and if so, how it should be modified. Codecs that do not comply with the configured maximum audio bit rate of the applicable region or regions are always removed from the codec list before the list is sent out.

Each cluster performs this check on its own and independent of other clusters that are involved in the end-to-end call.

If one of the two devices uses SIP, then the audio codec preference of the received SDP offer can be used instead of the audio codec preference list that is configured at the regions.

By default, the audio codec preference of the received SDP offer is not considered for the codec selection. You can enable the Accept Audio Codec Preference in Received Offer parameter on a per-device basis by configuring a SIP profile.

Considerations: When Using Early Offer over Outbound SIP Trunks

This section describes how audio codec selection works on outbound SIP trunks using early offer.

  • When Media Termination Point Required is enabled on an outbound SIP trunk, the codec that is selected by the SIP trunk MTP Preferred Originating Codec parameter is advertised in the outgoing SIP INVITE SDP.
  • When Early Offer Support for Voice and Video Calls (Insert MTP If Needed) is enabled in the SIP profile that is applied to an outbound SIP trunk, there are two options:
    1. If Accept Audio Codec Preferences in Received Offer is enabled on the calling device, the codec preference of the received SIP INVITE SDP is retained in the outgoing SIP INVITE SDP that is sent over the SIP trunk.
    2. Otherwise, the audio codec list in the outgoing invite SDP is based on the codec preference of the applicable region(s):
      • If both devices are in the same region, the audio codec preference list configured for calls within the region is used.
      • If both devices are in different regions, the audio codec preference list configured for calls between the two regions is used.

When an outbound SIP trunk is configured with the option Media Termination Point Required, then the codec that is selected by the SIP trunk MTP Preferred Originating Codec parameter is advertised in the outgoing SIP INVITE SDP.

When a SIP profile that has the Early Offer Support for Voice and Video Calls (Insert MTP If Needed) parameter that is enabled is applied to the outbound SIP trunk, then there are two options:

  • If Accept Audio Codec Preference in Received Offer is enabled on the calling device, then the codec preference of the received SIP INVITE SDP is retained in the outgoing SIP INVITE SDP that is sent over the SIP trunk.
  • If Accept Audio Codec Preference in Received Offer is disabled on the calling device, then the audio codec list in the outgoing SIP INVITE SDP is based on the audio codec preference list that is configured at the applicable region or regions.
Advertisements