Class DtmfTransformEngine

    • Constructor Detail

      • DtmfTransformEngine

        public DtmfTransformEngine​(AudioMediaStreamImpl stream)
        Creates an engine instance that will be replacing audio packets with DTMF ones upon request.
        Parameters:
        stream - the AudioMediaStream whose RTP packets we are going to be replacing with DTMF.
    • Method Detail

      • 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.
      • 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 DtmfTransformEngine.
      • reverseTransform

        public RawPacket reverseTransform​(RawPacket pkt)
        A stub meant to handle incoming DTMF packets.
        Specified by:
        reverseTransform in class SinglePacketTransformer
        Parameters:
        pkt - an incoming packet that we need to parse and handle in case we determine it to be DTMF.
        Returns:
        the pkt if it is not a DTMF tone and null otherwise since we will be handling the packet ourselves and their's no point in feeding it to the application.
      • transform

        public RawPacket transform​(RawPacket pkt)
        Replaces pkt with a DTMF packet if this engine is in a DTMF transmission mode or returns it unchanged otherwise.
        Specified by:
        transform in class SinglePacketTransformer
        Parameters:
        pkt - the audio packet that we may want to replace with a DTMF one.
        Returns:
        pkt with a DTMF packet if this engine is in a DTMF transmission mode or returns it unchanged otherwise.
      • startSending

        public void startSending​(DTMFRtpTone tone,
                                 int minimalToneDuration,
                                 int maximalToneDuration,
                                 int volume)
        DTMF sending stub: this is where we should set the transformer in the proper state so that it would start replacing packets with dtmf codes.
        Parameters:
        tone - the tone that we'd like to start sending.
        minimalToneDuration - The minimal DTMF tone duration.
        maximalToneDuration - The maximal DTMF tone duration.
        volume - The DTMF tone volume.
      • stop

        public void stop()
        Stops threads that this transform engine is using for even delivery.