Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.transform.dtmf
Class DtmfRawPacket

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.RawPacket
      extended by net.java.sip.communicator.impl.neomedia.transform.dtmf.DtmfRawPacket

public class DtmfRawPacket
extends RawPacket

DtmfRawPacket represent an RTP Packet. You create your DtmfRawPacket by calling the constructor. You specify the DTMF attributes : code=9, end=false, marker=true ... Then you fill the packet using init( ... dtmf attributes ... );

Author:
Romain Philibert, Emil Ivov, Damian Minkov

Field Summary
static int DTMF_PACKET_SIZE
          The fixed size of a DTMF packet.
 
Fields inherited from class net.java.sip.communicator.impl.neomedia.RawPacket
EXT_HEADER_SIZE, FIXED_HEADER_SIZE
 
Constructor Summary
DtmfRawPacket(byte[] buffer, int offset, byte payload)
          Creates a DtmfRawPacket using the specified buffer.
DtmfRawPacket(RawPacket pkt)
          Used for incoming DTMF packets, creating DtmfRawPacket from RTP one.
 
Method Summary
 int getCode()
          The event code of the current packet.
 int getDuration()
          The duration of the current event.
 void init(int code, boolean end, boolean marker, int duration, long timestamp)
          Initializes DTMF specific values in this packet.
 boolean isEnd()
          Is this an end packet.
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.RawPacket
addExtension, append, extractCsrcLevels, extractCsrcList, getBuffer, getCsrcCount, getExtensionBit, getExtensionLength, getHeaderExtensionType, getHeaderLength, getLength, getOffset, getPaddingSize, getPayload, getPayloadLength, getPayloadType, GetRTCPSSRC, getSequenceNumber, getSRTCPIndex, getSSRC, getTimestamp, grow, isPacketMarked, readByte, readInt, readRegion, readRegionToBuff, readShort, readTimeStampIntoByteArray, readUnsignedIntAsLong, readUnsignedShortAsInt, removeExtension, setBuffer, setCsrcList, setLength, setMarker, setOffset, setPayload, setTimestamp, shrink, writeByte, writeInt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DTMF_PACKET_SIZE

public static final int DTMF_PACKET_SIZE
The fixed size of a DTMF packet.

See Also:
Constant Field Values
Constructor Detail

DtmfRawPacket

public DtmfRawPacket(byte[] buffer,
                     int offset,
                     byte payload)
Creates a DtmfRawPacket using the specified buffer.

Parameters:
buffer - the byte array that we should use to store packet content
offset - the index where we should start using the buffer.
payload - the payload that has been negotiated for telephone events by our signaling modules.

DtmfRawPacket

public DtmfRawPacket(RawPacket pkt)
Used for incoming DTMF packets, creating DtmfRawPacket from RTP one.

Parameters:
pkt - the RTP packet.
Method Detail

init

public void init(int code,
                 boolean end,
                 boolean marker,
                 int duration,
                 long timestamp)
Initializes DTMF specific values in this packet.

Parameters:
code - the DTMF code representing the digit.
end - the DTMF End flag
marker - the RTP Marker flag
duration - the DTMF duration
timestamp - the RTP timestamp

getCode

public int getCode()
The event code of the current packet.

Returns:
the code

isEnd

public boolean isEnd()
Is this an end packet.

Returns:
the end

getDuration

public int getDuration()
The duration of the current event.

Returns:
the duration

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.