Class PayloadTypeTransformEngine

  • All Implemented Interfaces:
    PacketTransformer, TransformEngine

    public class PayloadTypeTransformEngine
    extends SinglePacketTransformerAdapter
    implements TransformEngine
    We use this engine to change payload types of outgoing RTP packets if needed. This is necessary so that we can support the RFC3264 case where the answerer has the right to declare what payload type mappings it wants to receive even if they are different from those in the offer. RFC3264 claims this is for support of legacy protocols such as H.323 but we've been bumping with a number of cases where multi-component pure SIP systems also need to behave this way.
    Author:
    Damian Minkov
    • Constructor Detail

      • PayloadTypeTransformEngine

        public PayloadTypeTransformEngine()
    • Method Detail

      • transform

        public RawPacket transform​(RawPacket pkt)
        Checks if there are any override mappings, if no setting just pass through the packet. If the RawPacket payload has entry in mappings to override, we override packet payload type.
        Overrides:
        transform in class SinglePacketTransformerAdapter
        Parameters:
        pkt - the RTP RawPacket that we check for need to change payload type.
        Returns:
        the updated RawPacket instance containing the changed payload type.
      • getRTPTransformer

        public PacketTransformer getRTPTransformer()
        Returns a reference to this class since it is performing RTP transformations in here.
        Specified by:
        getRTPTransformer in interface TransformEngine
        Returns:
        a reference to this instance of the PayloadTypeTransformEngine.
      • getRTCPTransformer

        public PacketTransformer getRTCPTransformer()
        Always returns null since this engine does not require any RTCP transformations.
        Specified by:
        getRTCPTransformer in interface TransformEngine
        Returns:
        null since this engine does not require any RTCP transformations.
      • addPTMappingOverride

        public void addPTMappingOverride​(byte originalPt,
                                         byte overridePt)
        Adds an additional RTP payload type mapping used to override the payload type of outgoing RTP packets. If an override for originalPT, was already being overridden, this call is simply going to update the override to the new one.

        This method creates a copy of the local overriding map so that mapping overrides could be set during a call (e.g. after a SIP re-INVITE) in a thread-safe way without using synchronization.

        Parameters:
        originalPt - the payload type that we are overriding
        overridePt - the payload type that we are overriding it with