Conditional Codec Operators

Three logical operators are available to construct conditional lists

the OR operator (|)

ORACLE(codec-policy)# add-codecs-on-egress AMR::ONE:(AMR::*|PCMU)

which can be interpreted as — add AMR::ONE if any AMR:: codec is in the SDP offer after ingress codec policy processing, or if PCMU is in the SDP offer after ingress codec policy processing.

the AND operator (&)

ORACLE(codec-policy)# add-codecs-on-egress AMR::ONE:(AMR::*&PCMU)

which can be interpreted as — add AMR::ONE if any AMR:: codec is in the SDP offer after ingress codec policy processing, and if PCMU is in the SDP offer after ingress codec policy processing.

the NOT operator (!)

ORACLE(codec-policy)# add-codecs-on-egress AMR::ONE:(!AMR::*)

which can be interpreted as — “add AMR::ONE if no AMR:: codec is in the SDP offer after ingress codec policy processing.

Each operator applies only to the codec immediately following it. Operators are processed left to right until all conditions have been tested. The condition result is accumulated as each of the conditions is processed. For example:

ORACLE(codec-policy)#add-codecs-on-egress AMR::ONE:
(!AMR::TEST1&AMR::TEST0|AMR::TEST2)
  • Test SDP offer for AMR::TEST1 (a NOT operation).

    If AMR:TEST1 is NOT present, set accumulated result to TRUE.

    If AMR:TEST1 is present, set accumulated result to FALSE.

  • Test SDP offer for AMR::TEST0 (an AND operation).

    If AMR is present, no change to accumulated result.

    If AMR is not present, set accumulated result to FALSE.

  • Test SDP offer for AMR::TEST2 (an OR operation).

    If AMR is present, set accumulated result to TRUE.

    If AMR is not present, no change to accumulated result.

Multiple conditions can be concatenated; in this case, individual conditions are separated by SPACE characters and the ACLI command argument is bracketed with double quotation marks ...). For example:

ORACLE(codec-policy)#add-codecs-on-egress (PCMU G729:(G726) G723:(PCMA))
  • PCMU is unconditionally added to the egress codec list.
  • Process the first condition — G729:(G726)

    If G726 is present, the result is TRUE; add G729 to the egress codec list.

    If G726 is not present, the result is FALSE; do not add G729 to the egress codec list.

  • Process the second condition — G723:(PCMA)

    If PCMA is present, the result is TRUE; add G723 to the egress codec list.

    If PCMA is not present, the result is FALSE; do not add G723 to the egress codec list.