-
public class DTMFManagerDTMFManager 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 voidsendDtmf(char dtmfCh)Sets the DTMF tone to be sent DatagramPacketcreateDTMFPacket(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 booleanhasPendingDTMF()Checks if there is a DTMF tone pending to be sent voidclearDTMF()Clears the current DTMF tone intgetCurrentDTMF()Gets the current DTMF tone value -
-
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 packettimeStamp- The RTP timestampdtmfPayloadType- 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 sequenceseqNo- The RTP sequence numberrtpEvent- 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
-
-
-
-