Cisco Unified Border Element (SP Edition) Configuration Guide: Unified Model
Restricting Codecs

Table Of Contents

Codec Handling

Contents

Prerequisites for Codec Handling

Restrictions for Codecs

Configuring Codec Restriction and Packetization Time

Packetization Time

Codec Restriction

Configuring Codecs

Configuring a CAC Policy to Use a Codec List

Examples of Configuring Codec Restriction

Example of Configuring Codecs

Example of Configuring a CAC Policy to Use a Codec List


Codec Handling


A compressor-decompressor (codec) is a device or program that performs a transformation on a data stream or signal. Cisco Unified Border Element (SP Edition) is hard-coded with a set of recognized codecs (see Table 18-1 to Table 18-5), including all commonly used voice and video codecs. The default behavior is to allow all recognized codecs on all calls. Any other codec present in call signaling is removed by Cisco Unified Border Element (SP Edition).

This enhancement allows you to restrict which codec(s) a particular call can use and to configure a minimum permissible packetization period for each permitted codec.

Cisco Unified Border Element (SP Edition) supports passthrough codecs that are passed through the SBC without transcoding. See Table 18-4 for a list of passthrough codecs by type.

H.323 only supports PCMA, PCMU, G.722, G.723, G.728, G.729, GSM, telephone-event, H.261, H.263, H.264, and T.38 codecs. Therefore in a SIP to H.323 call, if SIP codecs are sent to H.323 that H.323 cannot support, then these codecs are not passed through and the call may fail accordingly.

Cisco Unified Border Element (SP Edition) supports codec transcoding for SIP to SIP calls only. Transcoding is the process of translating a media stream encoded using one codec into a media stream encoded using another codec, for example, translating a media stream encoded as PCMU into one encoded as G.726-32. For more information on transcoding, see the Implementing SBC Transcoding chapter.


Note For Cisco IOS XE Release 2.4 and later, this feature is supported in the unified model.


For a complete description of commands used in this chapter, refer to the Cisco Unified Border Element (SP Edition) Command Reference: Unified Model at http://www.cisco.com/en/US/docs/ios/sbc/command/reference/sbcu_book.html.

For information about all Cisco IOS commands, use the Command Lookup Tool at http://tools.cisco.com/Support/CLILookup or a Cisco IOS master commands list.

Feature History for Codec Handling

Release
Modification

Cisco IOS XE Release 2.4

This feature was introduced on the Cisco ASR 1000 Series Aggregation Services Routers along with support for the unified model.

Cisco IOS XE Release 2.4.2

The SBC uses the packetization time, p-time, attribute in the SDP offer or answer configured in a codec list.

Cisco IOS XE Release 2.5

Support for H.323 calls, and H.323 video codecs H.261, H.263, and H.264 were added. Support for passthrough codecs without transcoding was added.


Contents

This module contains the following sections:

Prerequisites for Codec Handling

Restrictions for Codecs

Configuring Codec Restriction and Packetization Time

Examples of Configuring Codec Restriction

Prerequisites for Codec Handling

The following prerequisites are required before you can restrict codecs:

Before implementing Codec Handling, Cisco Unified Border Element (SP Edition) must already be configured. See the procedures described in Chapter 2, "Configuring Cisco Unified Border Element (SP Edition)."

All signaling border element (SBE) and data border element (DBE) configurations required to make simple calls must already be configured.

Restrictions for Codecs

Review the following restrictions for codecs:

For H.323 calls, SIP to H.323 and H.323 to SIP calls, both the callee and caller must use the same codec because any calls requiring transcoding will fail the call setup.

The media packet forwarder on the DBE polices the bandwidth consumed by each media stream, but it cannot police the type of codecs or the packetization periods.

Unrecognized codecs cannot be configured as members of the codec whitelist.

Active calls are not released if there is a change in the codec whitelist during the call.

If a codec whitelist is configured, Cisco Unified Border Element (SP Edition) removes any unlisted codecs from the call setup flow and media gate allocation.

Multiple codec whitelists can be configured on a Call Admission Control (CAC) policy basis. For example, the list of codecs allowed for calls from SipAdj1 can be different than the list of codecs allowed for calls from SipAdj2.

If a codec whitelist has not been configured, all recognized codecs (see Table 18-1 to Table 18-5) are allowed for all calls.

You must use the textual value of the codec description that appears on the Session Description Protocol (SDP) to configure the codec whitelist, for example "PCMU" or "telephone-event".

Disallowing all codecs is not supported. However, you could set a bandwidth limit of 0 to achieve the same result.

Codec lists are not applied to media-bypass calls (those in which Cisco Unified Border Element (SP Edition) does not reserve media resources).

The format of the codec name is the same as the string used to represent it in SDP, for example PCMU or VDVI. All recognized codec names are listed in Table 18-1 - Table 18-5.

A single codec can only be added to each list once, with a single packetization period.

For each codec on a list, CAC restricts the signaled packetization period for any stream using that codec to be greater than or equal to the packetization period configured along with the codec in the list. If a stream uses more than one codec in the list, then the greater of all the packetization periods configured for each codec in the list is applied to the stream.


Note The bandwidths listed in the tables below are the bandwidths without the transport layer overheads. Therefore, the actual bandwidths reserved by Cisco Unified Border Element (SP Edition) are higher than the listed values.


Table 18-1 Sample-Based Audio Codecs with Packetization Time 10 ms 

Payload Type
Codec Name
Clock Rate (Hz)
Sample Size (bits)
Channels

0

PCMU (also known as G.711)

8000

8

1

5

DVI4

8000

4

1

6

DVI4

16000

4

1

8

PCMA

8000

8

1

10

L16

44100

16

2

11

L16

44100

16

1

15

G728

8000

2

1

16

DVI4

11025

4

1

17

DVI4

22050

4

1

G726-40

8000

5

1

2

G726-32

8000

4

1

G726-24

8000

3

1

G726-16

8000

2

1

L8

8000

8

1

DAT12

8000

12

2

L20

44100

10

2

L24

44100

24

2


Table 18-2 Non-Sample-Based Audio Codecs 

Payload Type
Codec Name
Packetization Time (ms)
Allocated Bandwidth (bps)

3

GSM

10

13200

7

LPC

10

5600

9

G722

10

64000

13

CN

10

400

18

G729

10

8000

18

G.729A

10

8000

18

G729A

10

8000

4

G723

30

6400

12

QCELP

13300

14

MPA

N/A

131072

G729D

10

6400

G729E

10

11800

GSM-EFR

10

12400

VDVI

10

25000

AMR

10

12500

AMR-WB

10

24420

dsr-es201108

10

4800

EVRC

10

8550

EVRC0

10

8550

mpa-robust

10

327680

G7221

10

32000

MP4A-LATM

10

131072

SMV

10

8550

SMV0

10

8550

G729AB

10

8000


Table 18-3 Video Codecs 

Payload Type
Codec Name
Packetization Time (ms)
Allocated Bandwidth (bps)

25

CelB

524228

26

JPEG

524228

28

nv

524228

31

H261

524228

32

MPV

524228

33

MP2T

524228

34

H263

524228

NA

H264

 

21000000

BMPEG

524228

BT656

170000000

DV

1500000000

H263-1998

524228

H263-2000

524228

MP1S

1600000

MP2P

524228

MP4V-ES

524228

raw

N/A

1500000000

SMPTE292M

N/A

1500000000


The following table lists the supported passthrough codecs without transcoding.

Table 18-4 Passthrough Codecs without Transcoding 

Codec Name
Codec Type
Packetization Time (ms)
Allocated Bandwidth (bps)

PCMA (also known as G.711)

sample-based audio

10

64000

PCMU (also known as G.711)

sample-based audio

10

64000

G726-16

audio

10

NA

G726-24

audio

10

NA

G726-32

audio

10

NA

G728

audio

10

NA

G729 A

non-sample-based audio

10

8000

G729 B

non-sample-based audio

10

8000

G723-53

non-sample-based audio

30

6400

G723-63

non-sample-based audio

30

6400

GSM/GSM-FR

non-sample-based audio

10

13200

GSM-EFR

non-sample-based audio

20

12400

GSM-HR

non-sample-based audio

20

5600

AMR

non-sample-based audio

10

12500

EVRC

non-sample-based audio

10

8550

G722

non-sample-based audio

10

64000

iLBC

non-sample-based audio

20

15200

H.261

video

NA

524228

H.263

video

NA

524228


Table 18-5 Other Codecs 

Codec Name
Packetization Time (ms)
Allocated Bandwidth (bps)

telephone-event

20

1600

tone

20

1600

RED

20

1

parityfec

20

1

T140

100

80

pointer

20

1600

H224

20

6560

T38

N/A

15500

X-NSE

20

1600


Configuring Codec Restriction and Packetization Time

Packetization Time

The packetization time (p-time) is the time period a codec is applied to a media stream to build a single digital packet. When a call travels between two end points, both the codec and the p-time for that codec is negotiated. The SBC acts on the p-time attribute in the SDP based on the configuration in the codec list.

SBC adds the ptime attribute to an SDP offer or answer, when one is configured explicitly in a codec whitelist. The exception is if a minimum packetization time is configured as part of SBC policy. This configuration causes SBC to insert a=ptime lines into forwarded offers or answers.

SBC ensures that media clipping does not occur as a result of overestimating the ptime (and hence underestimating the bandwidth requirement).

If ptime is signaled explicitly on the offer and answer, it uses the lower of the two values to calculate the bandwidth allowance for both directions of media.

Codec Restriction

You first configure the codecs and then apply them as explained in the following sections:

Configuring Codecs

Configuring a CAC Policy to Use a Codec List

Configuring Codecs

To restrict which codec(s) a particular call can use and to configure a minimum permissible packetization period for each permitted codec, you must configure CAC with a list of codecs, provide a description for the list, and then add any codec(s) to the list.

SUMMARY STEPS

1. configure terminal

2. sbc service-name

3. sbe

4. codec list name

5. description text

6. codec codec-name [packetization-period packetization-period]

7. end

8. show sbc service-name sbe codec-list list-name

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

configure terminal

Example:

Router# configure terminal

Enables global configuration mode.

Step 2 

sbc service-name

Example:

Router(config)# sbc mysbc

Enters the submode of an SBC service.

Step 3 

sbe

Example:

Router(config-sbc)# sbe

Configures the submode of the SBE entity within a SBC service.

Step 4 

codec list name

Example:

Router(config-sbc-sbe)#sbc mysbc sbe codec list my_codecs

Creates a codec list.

Step 5 

description text



Example:

Router(config-sbc-sbe-codec-list)# description Legitimate codes

Adds a description for the specified codec list using a readable text string format.

The no form of this command removes the description.

This description is displayed when the show command is used for this codec list. It is also included for each codec list when a summary of all codec lists is displayed.

Step 6 

codec codec-name [packetization-period packetization-period]



Example:

Router(config-sbc-sbe-codec-list)# codec PCMU packetization-period 20

Adds a codec to a codec list, and sets a minimum packetization period (optional) for the codec.

The no form of this command (without the packetization period) removes the named codec from the codec list.

Note If the no form of this command includes the packetization period, only the packetization period for the codec is removed.

Step 7 

end

Example:

Router(config-sbc-sbe-codec-list)# end

Exits codec-list mode and enters Privileged EXEC mode.

Step 8 

show sbc service-name sbe codec-list list-name

Example:

Router# show sbc mysbc sbe codec-list my_codecs

Displays detailed information about the codec lists configured on the SBE.

If the list name is omitted, for example, my_codecs, then details are displayed for all codec lists on the SBE.

Configuring a CAC Policy to Use a Codec List

SUMMARY STEPS

1. configure terminal

2. sbc service-name

3. sbe

4. cac-policy-set policy-set-id

5. first-cac-scope scope-name

6. first-cac-table table-name

7. cac-table table-name

8. table-type {policy-set | limit {list of limit tables}}

9. entry entry-id

10. cac-scope {list of scope options}

11. action [next-table goto-table-name | cac-complete]

12. codec-restrict-to-list list-name

13. complete

14. end

15. show sbc service-name sbe cac-policy-set id table name entry entry

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

configure terminal

Example:

Router# configure terminal

Enables global configuration mode.

Step 2 

sbc service-name

Example:

Router(config)# sbc mysbc

Enters the submode of an SBC service.

Step 3 

sbe

Example:

Router(config-sbc)# sbe

Configures the submode of the SBE entity within a SBC service.

Step 4 

cac-policy-set policy-set-id

Example:

Router(config-sbc-sbe)# cac-policy-set 1

Enters the submode of CAC policy.

Step 5 

first-cac-scope scope-name

Example:

Router(config-sbc-sbe-cacpolicy)# first-cac-scope global

Configures the scope at which to begin defining limits when performing the admission control stage of policy.

Note The first-cac-scope definition is only relevant if the table type configured by the first-cac-table command is a Limit table. In that case, the scope of the first-cac-table is determined by first-cac-scope. If the first-cac-table is a Policy Set table, the first-cac-scope is ignored and defaults to global.

The scope-name argument configures the scope at which limits should be initially defined. Possible values are:

adj-group

call

category

dst-account

dst-adj-group

dst-adjacency

dst-number

global

src-account

src-adj-group

src-adjacency

src-number

Features can be enabled or disabled per adjacency group through CAC configuration the same way this is done per individual adjacencies.

Step 6 

first-cac-table table-name

Example:

Router(config-sbc-sbe-cacpolicy)# first-cac-table first_policy_table

Configures the name of the first policy table to process when performing the admission control stage of policy.

Step 7 

cac-table table-name

Example:

Router(config-sbc-sbe-cacpolicy)# cac-table first_policy_table

Enters the mode for configuration of an admission control table (creating one if necessary) within the context of an SBE policy set.

Step 8 

table-type {policy-set | limit {list of limit tables}}

Example:

Router(config-sbc-sbe-cacpolicy-cactable)# table-type policy-set

Configures the table type of a CAC table within the context of an SBE policy set.

The list of limit tables argument controls the syntax of the match-value fields of the entries in the table. Possible available Limit tables are:

account—Compare the name of the account.

adj-group—Compare the name of the adjacency group.

adjacency—Compare the name of the adjacency.

all—No comparison type. All events match this type.

call-priority—Compare with call priority.

category—Compare the number analysis assigned category.

dst-account—Compare the name of the destination account.

dst-adj-group—Compare the name of the destination adjacency group.

dst-adjacency—Compare the name of the destination adjacency.

dst-prefix—Compare the beginning of the dialed digit string.

event-type—Compare with CAC policy event types.

src-account—Compare the name of the source account.

src-adj-group—Compare the name of the source adjacency group.

src-adjacency—Compare the name of the source adjacency.

src-prefix—Compare the beginning of the calling number string.

Note For Limit tables, the event or message or call matches only a single entry.

Features can be enabled or disabled per adjacency group through CAC configuration the same way this is done per individual adjacencies. The adj-group table type matches on either source or destination adjacency group.

When the policy-set keyword is specified, use the cac-scope command to configure the scope within each entry at which limits are applied in a CAC Policy Set table.

Note For Policy Set tables, the event or call or message is applied to all entries in this table.

Step 9 

entry entry-id

Example:

Router(config-sbc-sbe-cacpolicy-cactable)# entry 1

Enters the mode to create or modify an entry in an admission control table..

Step 10 

cac-scope {list of scope options}

Example:

Router(config-sbc-sbe-cacpolicy-cactable-entry) # cac-scope call

Configures the scope within each entry at which limits are applied in a Policy Set table.

Only per call scope can be configured when using the codec-restrict-to-list command.

list of scope options specifies one of the following strings used to match events:

adj-group—Events that are from members of the same adjacency group.

call—Scope limits are per single call.

category—Events that have same category.

dst-account—Events that are sent to the same account.

dst-adj-group—Events that are sent to the same adjacency group.

dst-adjacency—Events that are sent to the same adjacency.

dst-number—Events that have same destination.

global—Scope limits are global

src-account—Events that are from the same account.

src-adj-group—Events that are from the same adjacency group.

src-adjacency—Events that are from the same adjacency.

src-number—Events that have the same source number.

sub-category—The limits specified at this scope apply to all events sent to or received from members of the same subscriber category.

sub-category-pfx—The limits specified at this scope apply to all events sent to or received from members of the same subscriber category prefix.

subscriber—The limits specified at this scope apply to all events sent to or received from individual subscribers (a device that is registered with a Registrar server).

Step 11 

action [next-table goto-table-name | cac-complete]

Example:

Router(config-sbc-sbe-cacpolicy-cactable-entry) # action cac-complete

Configures the action to perform after this entry in an admission control table. Possible actions are:

Identify the next CAC table to process using the next-table keyword and the goto-table-name argument.

Stop processing for this scope using the cac-complete keyword.

Step 12 

codec-restrict-to-list list-name

Example:

Router(config-sbc-sbe-cacpolicy-cactable-entry) # codec-restrict-to-list my_codecs

Configures CAC to restrict the codecs used in signaling a call to the set of codecs provided in the named list.

If a codec list is empty, all codecs recognized by the SBE are allowed.

The no form of this command, or not setting this command, allows any recognized codecs to be used without restrictions.

Note This command replaces any codec list that was set up by an earlier CAC entry. To clear all restrictions from an earlier CAC entry, you must configure a codec-restrict-to-list list-name, where list-name is the name of a list containing no codecs.

Step 13 

complete

Example:

Router(config-sbc-sbe-cacpolicy)# complete

Completes the cac-policy.

Step 14 

end

Example:

Router(config-sbc-sbe-cacpolicy)# end

Exits the cac-policy-set configuration mode and enters Privileged EXEC mode.

Step 15 

show sbc service-name sbe cac-policy-set id table name entry entry

Example:

Router# show sbc mysbc sbe cac-policy-set 1 table standard_policy_list entry 1

Displays detailed information for a specific entry in a CAC policy table, including any restricted codecs.

Examples of Configuring Codec Restriction

This section provides a sample configuration and output for configuring restrictions on codecs and configuring a CAC policy to use a codec list.

Example of Configuring Codecs

The following example shows the commands required to configure codec restriction.

Figure 18-1 contains three adjacencies (A, B, and C). Any calls involving A need to be configured to use only the G729 and PCMU (G.711) codecs with a minimal preferred packetization period of 10 milliseconds. However, calls between B and C can use any available codecs.

To create a codec list containing the specified codecs configured with a minimal preferred packetization period, use the following commands:

Router# configure terminal
Router(config)# sbc mysbc
Router(config-sbc)# sbe
Router(config-sbc-sbe)# codec list allowable_codecs
Router(config-sbc-sbe-codec-list)# description The set of codecs allowed on adjacency AdjA
Router(config-sbc-sbe-codec-list)# codec g729 packetization-period 20
Router(config-sbc-sbe-codec-list)# codec pcmu packetization-period 10
Router(config-sbc-sbe-codec-list)# exit

After configuring codec restriction, you must configure a CAC policy to use the codec list. See "Example of Configuring a CAC Policy to Use a Codec List" section.

Figure 18-1 Example Scenario for Configuring Codec Restriction

Example of Configuring a CAC Policy to Use a Codec List

The following example shows the commands required to configure a CAC policy to use a codec list. To configure a codec list, see "Example of Configuring Codecs" section.

Router# configure terminal
Router(config)# sbc mysbc
Router(config-sbc)# sbe
Router(config-sbc-sbe)# cac-policy-set 1
Router(config-sbc-sbe-cacpolicy)# first-cac-table table1
Router(config-sbc-sbe-cacpolicy)# first-cac-scope call
Router(config-sbc-sbe-cacpolicy)# cac-table table1
Router(config-sbc-sbe-cacpolicy-cactable)# match-type adjacency
Router(config-sbc-sbe-cacpolicy-cactable)# entry 1
Router(config-sbc-sbe-cacpolicy-cactable)# match AdjA
Router(config-sbc-sbe-cacpolicy-cactable)# codec-restrict-to-list allowable_codecs
Router(config-sbc-sbe-cacpolicy-cactable-entry)# action cac-complete
Router(config-sbc-sbe-cacpolicy-cactable-entry)# exit
Router(config-sbc-sbe-cacpolicy)# complete


Note The codec list command line interface (CLI) commands can only be entered at the per-call level in the CAC policy tables. If you configure a codec list at any other level the CAC policy set will not activate. However, a log is displayed after you complete the configuration and the policy set is marked as "complete".