Package 

Class DTMFManager


  • 
    public class DTMFManager
    
                        

    DTMFManager handles DTMF packet creation and management. This class encapsulates all DTMF-related functionality including packet building and sequence management for RFC 2833 DTMF events.

    • Method Summary

      Modifier and Type Method Description
      void sendDtmf(char dtmfCh) Sets the DTMF tone to be sent
      DatagramPacket createDTMFPacket(InetSocketAddress mediaAddress, long timeStamp, int dtmfPayloadType) Creates a DTMF packet with proper RTP header and payload
      Array<int> prepareNextDTMF(int dtmf, int count, int seqNo, Array<byte> rtpEvent) Builds the next DTMF packet in the sequence
      boolean hasPendingDTMF() Checks if there is a DTMF tone pending to be sent
      void clearDTMF() Clears the current DTMF tone
      int getCurrentDTMF() Gets the current DTMF tone value
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • sendDtmf

         void sendDtmf(char dtmfCh)

        Sets the DTMF tone to be sent

        Parameters:
        dtmfCh - The DTMF character ('0'-'9', '*', '#')
      • createDTMFPacket

         DatagramPacket createDTMFPacket(InetSocketAddress mediaAddress, long timeStamp, int dtmfPayloadType)

        Creates a DTMF packet with proper RTP header and payload

        Parameters:
        mediaAddress - The destination address for the packet
        timeStamp - The RTP timestamp
        dtmfPayloadType - The payload type for DTMF (96 or 101)
      • prepareNextDTMF

         Array<int> prepareNextDTMF(int dtmf, int count, int seqNo, Array<byte> rtpEvent)

        Builds the next DTMF packet in the sequence

        Parameters:
        count - The packet count in the DTMF sequence
        seqNo - The RTP sequence number
        rtpEvent - The buffer to write the DTMF event data
      • hasPendingDTMF

         boolean hasPendingDTMF()

        Checks if there is a DTMF tone pending to be sent

      • clearDTMF

         void clearDTMF()

        Clears the current DTMF tone

      • getCurrentDTMF

         int getCurrentDTMF()

        Gets the current DTMF tone value