rtp: skip RTP streams when parsing RTCP packets. #325

This commit is contained in:
Kaian 2020-09-17 10:29:16 +02:00
parent 8e88df6e13
commit 5d2e28f9ac
2 changed files with 5 additions and 3 deletions

View File

@ -249,7 +249,7 @@ rtp_check_packet(packet_t *packet)
stream_add_packet(stream, packet); stream_add_packet(stream, packet);
} else if (data_is_rtcp(payload, size) == 0) { } else if (data_is_rtcp(payload, size) == 0) {
// Find the matching stream // Find the matching stream
if ((stream = rtp_find_stream(src, dst))) { if ((stream = rtp_find_rtcp_stream(src, dst))) {
// Parse all packet payload headers // Parse all packet payload headers
while ((int32_t) size > 0) { while ((int32_t) size > 0) {
@ -379,7 +379,7 @@ rtp_find_stream_format(address_t src, address_t dst, uint32_t format)
} }
rtp_stream_t * rtp_stream_t *
rtp_find_stream(address_t src, address_t dst) rtp_find_rtcp_stream(address_t src, address_t dst)
{ {
// Structure for RTP packet streams // Structure for RTP packet streams
rtp_stream_t *stream; rtp_stream_t *stream;
@ -395,6 +395,8 @@ rtp_find_stream(address_t src, address_t dst)
while ((call = vector_iterator_prev(&calls))) { while ((call = vector_iterator_prev(&calls))) {
// Check if this call has an RTP stream for current packet data // Check if this call has an RTP stream for current packet data
if ((stream = rtp_find_call_stream(call, src, dst))) { if ((stream = rtp_find_call_stream(call, src, dst))) {
if (stream->type != PACKET_RTCP)
continue;
return stream; return stream;
} }
} }

View File

@ -304,7 +304,7 @@ rtp_stream_t *
rtp_find_stream_format(address_t src, address_t dst, uint32_t format); rtp_find_stream_format(address_t src, address_t dst, uint32_t format);
rtp_stream_t * rtp_stream_t *
rtp_find_stream(address_t src, address_t dst); rtp_find_rtcp_stream(address_t src, address_t dst);
rtp_stream_t * rtp_stream_t *
rtp_find_call_stream(struct sip_call *call, address_t src, address_t dst); rtp_find_call_stream(struct sip_call *call, address_t src, address_t dst);