Codec Policies for SIP

The Oracle® Enterprise Session Border Controller has the ability to add, strip, and reorder codecs for SIP sessions. This builds on the Oracle® Enterprise Session Border Controller’s pre-existing abilities to route by codec and reorder one codec in an SDP offer by allowing you to configure the order of multiple codecs and to remove specific codecs within the media descriptions in SDP offers.

You can enable the Oracle® Enterprise Session Border Controller to perform these operations on SDP offers by configuring codec policies. Codec policies are sets of rules that specify the manipulations to be performed on SDP offers. They are applied on an ingress and egress basis using the realm and session agent configurations.

Oracle® Enterprise Session Border Controller supports three types of codec policies:

  • Ingress policy—Codec policy that the Oracle® Enterprise Session Border Controller applies to the SDP offer for incoming traffic
  • Egress policy—Codec policy that the Oracle® Enterprise Session Border Controller applies to the SDP offer for traffic leaving the Oracle® Enterprise Session Border Controller
  • Conditional policy—Codec policy that the Oracle® Enterprise Session Border Controller applies to the SDP offer for traffic leaving the Oracle® Enterprise Session Border Controller. A conditional policy differs from an egress policy in providing the capability to perform standard codec manipulations (add and strip) dynamically, based on the codec list and associated parameters contained in the original SDP offer.

The Oracle® Enterprise Session Border Controller applies codec policies during the offer phase of media format negotiation. If codec manipulation is enabled, then the Oracle® Enterprise Session Border Controller performs the modification according to the specific policy and forwards on the traffic.

For example, when the Oracle® Enterprise Session Border Controller receives a SIP INVITE with SDP, it refers to the realm through which the INVITE arrived and performs any manipulations specified by an ingress codec policy that may have been assigned to the ingress realm. With the media description possibly changed according to the ingress codec policy, the Oracle® Enterprise Session Border Controller passes the SDP offer to the outgoing realm so that the an egress codec policy can be applied. Note that the SDP to be evaluated by the egress codec policy may match the original SDP, or it may have been changed during transit through the ingress realm. After applying the egress coded policy, the Oracle® Enterprise Session Border Controller forwards the INVITE.

This image displays the OCSBC managing codec advertisement via configured codec policy.

Since the offer-answer exchange can occur at different stages of SIP messaging, the assigned ingress and egress roles follow the media direction rather than the signaling direction. It might be, for example, that the offer is in an OK that the Oracle® Enterprise Session Border Controller modifies.

You can apply codec policies to realms and to session agents; codec policies configured in session agents take precedence over those applied to realms. However, it is not required that there be both an ingress and an egress policy either for realms or for session agents. If either one is unspecified, then no modifications take place on that side. If neither ingress nor egress policies specified, SDP offers are forwarded as received.

Relationship to Media Profiles

For each codec that you specify in a codec policy, there must be a corresponding media profile configuration on the Oracle® Enterprise Session Border Controller. You configure media profiles in the ACLI via the session-router path. In them, you can specify codec type, transport protocol, required bandwidth, and a number of constraints.

Manipulation Modes

You can configure a codec policy to perform several different kinds of manipulations:

  • Allow—List of codecs that are allowed for a certain codec policy; if a codec does not appear on this list, then the Oracle® Enterprise Session Border Controller removes it. You can wildcard this list with an asterisk (*) so that all codecs are allowed. Further, you can create exceptions to a wildcarded allow list.
    • You make an exception to the wildcarded list of codecs by entering the codec(s) that are not allowed with a no attribute. This tells the Oracle® Enterprise Session Border Controller to allow all codecs except the one(s) you specify.
      ACMEPACKET(codec-policy)# allow-codecs (* PCMA:no)
    • You can also create exceptions to allow lists such that audio or video codecs are removed. However, when the allow list specifies the removal of all audio codecs and an INVITE arrives at the Oracle® Enterprise Session Border Controller with only audio codecs, the Oracle® Enterprise Session Border Controller behaves in accordance with RFC 3264. This means that the resulting SDP will contain one attribute line, with the media port for the media line set to 0. The terminating side will need to supply new SDP in its reply because the result of the manipulation is the same as an INVITE with no body.
      ACMEPACKET(codec-policy)# allow-codecs (* audio:no)
  • Order—List of the codecs where you specify their preferred order in the outgoing media offer. The Oracle® Enterprise Session Border Controller arranges matching codecs according to the rule you set, and any remaining ones are added to the list in the same relative order they took in the incoming media offer. If your list specifies a codec that is not present, then the ordering proceeds as specified but skips the missing codec.

    You can use an asterisk (*) as a wildcard in this list, too. The placement of the asterisk is key, as you can see in the following examples:

    • For an order rule set this way
      ACMEPACKET(codec-policy)# order (A B C *)

      codecs A, B, and C will be placed at the front of the codec list in the order specified; all other codecs in the offer will follow A, B, and C in the same relative order they had in the original SDP offer.

    • For an order rule set this way:
      ACMEPACKET(codec-policy)# order (* A B C)

      codecs A, B, and C will be placed at the end of the codec list in the order specified; all other codecs in the offer will come before A, B, and C in the same relative order they had in the original SDP offer.

    • For an order rule set this way
      ACMEPACKET(codec-policy)# order (A * B C)

      codec A will be placed at the beginning of the codec list, to be followed by all other codecs in the offer in the same relative order they had in the original SDP offer, and then B and C will end the list.

  • Force—An attribute you can use in the allow list with one codec to specify that all other codecs should be stripped from the outgoing offer. You can specify multiple forced codecs in your rules.
    • If you set multiple codecs in the allow list and one of them is forced, then the outgoing offer will contain the forced codec.
    • If you set multiple codecs in the allow list and the one that is forced is not present in the offer, then the Oracle® Enterprise Session Border Controller will select a non-forced codec for the outgoing offer.
      ACMEPACKET(codec-policy)# allow (PCMU G729:force)

    You cannot use the force attribute with a wildcarded allow list.

  • No—An attribute that allows you to strip specified codecs or codec types from a wildcarded allow list.
    ACMEPACKET(codec-policy)# allow (* PCMA:no)

In-Realm Codec Manipulation

In addition to being able to apply codec policies in realms, the realm configuration supports a setting for determining whether codec manipulation should be applied to sessions between endpoints in the same realm.

In-realm codec manipulation can be used for simple call flows that traverse two realms. If the originating and terminating realms are the same, the Oracle® Enterprise Session Border Controller checks to see if you have enabled this capability. If you have enabled it, then the Oracle® Enterprise Session Border Controller performs the specified manipulations. If this capability is not enabled, or if the realm’s media management in realm (mm-in-realm) setting is disabled, then the Oracle® Enterprise Session Border Controller does not perform codec manipulations.

For more complex calls scenarios that involve call agent or reinitiation of a call back to the same realm, the Oracle® Enterprise Session Border Controller does not perform in-realm codec manipulation.

Codec Policy Configuration

This section gives instructions and examples for how to configure codec policies and then apply them to realms and session agents. It also shows you how to configure settings for in-realm codec manipulation.

Creating a Codec Policy

To create a codec policy:

  1. In Superuser mode, type configure terminal and press Enter.
    ACMEPACKET# configure terminal
  2. Type media-manager and press Enter to access the signaling-related configurations.
    ACMEPACKET(configure)# media-manager
    ACMEPACKET(media-manager)#
  3. Type codec-policy and then press Enter.
    ACMEPACKET(media-manager)# codec-policy
    ACMEPACKET(codec-policy)#
  4. name—Enter the unique name for the codec policy. This is the value you will use to refer to this codec policy when you apply it to realms or session agents. This parameter is required and is empty by default.
  5. allow-codecs—Enter the list of media format types (codecs) to allow for this codec policy. In your entries, you can use the asterisk (*) as a wildcard, the force attribute, or the no attribute so that the allow list you enter directly reflects your configuration needs. Enclose entries of multiple values in parentheses ( ( ) ).

    The codecs that you enter here must have corresponding media profile configurations.

  6. add-codecs-on-egress—Enter the codecs that the Oracle® Enterprise Session Border Controller adds to an egress SDP offer if that codec is not already there. This parameter applies only to egress offers.

    The codecs that you enter here must have corresponding media profile configurations.

    add-codecs-on-egress can be used to construct ingress, egress, or conditional codec policies.

  7. order-codecs—Enter the order in which you want codecs to appear in the outgoing SDP offer. Remember that you can use the asterisk (*) as a wildcard in different positions of the order to directly reflect your configuration needs. Enclose entries of multiple values in parentheses ( ( ) ).

    The codecs that you enter here must have corresponding media profile configurations.

  8. Save and activate your configuration.

    Your codec policy configuration will resemble the following example:

    codec-policy
            name            private
            allow-codecs    g723:no pcmu video:no
            order-codecs    pcmu

Applying a Codec Policy to a Realm

Note that codec policies defined for session agents always take precedence over those defined for realms.

To apply a codec policy to a realm:

  1. In Superuser mode, type configure terminal and press Enter.
    ORACLE# configure terminal
  2. Type media-manager and press Enter.
    ORACLE(configure)# media-manager
  3. Type realm-config and press Enter.
    ORACLE(media-manager)# realm-config

    If you are adding support for this feature to a pre-existing realm, then you must select (using the ACLI select command) the realm that you want to edit.

  4. codec-policy—Enter the name of the codec policy that you want to apply to this realm. By default, this parameter is empty.
  5. Save and activate your configuration.

Applying a Codec Policy to a Session Agent

Note that codec policies that are defined for session agents always take precedence over those that are defined for realms.

To apply a codec policy to a realm:

  1. In Superuser mode, type configure terminal and press Enter.
    ORACLE# configure terminal
  2. Type session-router and press Enter.
    ORACLE(configure)# session-router
  3. Type session-agent and press Enter.
    ORACLE(session-router)# session-agent

    If you are adding support for this feature to a pre-existing session agent, then you must select (using the ACLI select command) the realm that you want to edit.

  4. codec-policy—Enter the name of the codec policy that you want to apply to this realm. By default, this parameter is empty.
  5. Save and activate your configuration.

In-Realm Codec Manipulations

To enable in-realm codec manipulations:

  1. In Superuser mode, type configure terminal and press Enter.
    ORACLE# configure terminal
  2. Type media-manager and press Enter.
    ORACLE(configure)# media-manager
  3. Type realm-config and press Enter.
    ORACLE(media-manager)# realm-config

    If you are adding support for this feature to a pre-existing realm, then you must select (using the ACLI select command) the realm that you want to edit.

  4. codec-manip-in-realm—Enter the name of the codec policy that you want to apply to this realm. The default value is disabled. The valid values are:
    • enabled | disabled

  5. Save and activate your configuration.