Skip to content
Snippets Groups Projects
Commit b910673e authored by Vincent Lucas's avatar Vincent Lucas
Browse files

Corrects writing DTMF payload (RFC4733) for RTP packets, when the RTP packet...

Corrects writing DTMF payload (RFC4733) for RTP packets, when the RTP packet length is greater then the fixed header (i.e. with CSRC identifiers).
parent 31c1460e
No related branches found
No related tags found
No related merge requests found
...@@ -28,11 +28,6 @@ public class DtmfRawPacket ...@@ -28,11 +28,6 @@ public class DtmfRawPacket
private static final Logger logger private static final Logger logger
= Logger.getLogger(DtmfRawPacket.class); = Logger.getLogger(DtmfRawPacket.class);
/**
* The fixed size of a DTMF packet.
*/
public static final int DTMF_PACKET_SIZE = 16;
/** /**
* The event code to send. * The event code to send.
*/ */
...@@ -54,12 +49,13 @@ public class DtmfRawPacket ...@@ -54,12 +49,13 @@ public class DtmfRawPacket
* @param buffer the <tt>byte</tt> array that we should use to store packet * @param buffer the <tt>byte</tt> array that we should use to store packet
* content * content
* @param offset the index where we should start using the <tt>buffer</tt>. * @param offset the index where we should start using the <tt>buffer</tt>.
* @param length Length of the packet's data.
* @param payload the payload that has been negotiated for telephone events * @param payload the payload that has been negotiated for telephone events
* by our signaling modules. * by our signaling modules.
*/ */
public DtmfRawPacket(byte[] buffer, int offset, byte payload) public DtmfRawPacket(byte[] buffer, int offset, int length, byte payload)
{ {
super (buffer, offset, DTMF_PACKET_SIZE); super (buffer, offset, length);
setPayload(payload); setPayload(payload);
} }
......
...@@ -236,8 +236,11 @@ public RawPacket transform(RawPacket pkt) ...@@ -236,8 +236,11 @@ public RawPacket transform(RawPacket pkt)
throw new IllegalStateException("Can't send DTMF when no payload " throw new IllegalStateException("Can't send DTMF when no payload "
+"type has been negotiated for DTMF events."); +"type has been negotiated for DTMF events.");
DtmfRawPacket dtmfPkt = new DtmfRawPacket(pkt.getBuffer(), DtmfRawPacket dtmfPkt = new DtmfRawPacket(
pkt.getOffset(), currentDtmfPayload); pkt.getBuffer(),
pkt.getOffset(),
pkt.getLength(),
currentDtmfPayload);
long audioPacketTimestamp = dtmfPkt.getTimestamp(); long audioPacketTimestamp = dtmfPkt.getTimestamp();
boolean pktEnd = false; boolean pktEnd = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment