meetecho / janus-gateway

Janus WebRTC Server
https://janus.conf.meetecho.com
GNU General Public License v3.0
8.25k stars 2.48k forks source link

[0.x] Parse media SSRC in RTCP reports when remote SSRCs are unknown #3137

Closed atoppi closed 1 year ago

atoppi commented 1 year ago

While making some tests between pion and Janus we found out that in some circumstances Janus could ignore incoming RTCP due to unrecognized SSRCs.

That happens when Janus receives RTCP Receiver Reports in connections where sources have unknown remote SSRCs (e.g. recvonly connections). Pion picks a random SSRC as sender SSRC and puts the remote media SSRC in the media header of the packet.

When Janus receives a RTCP packets from sources with unknown remote SSRCs, it parses the SSRC through janus_rtcp_get_sender_ssrc, that basically reads the sender SSRC (in this case a random one, hence dropping the packet).

In this PR we try to add a fallback mechanism to read also from media SSRC through janus_rtcp_get_receiver_ssrc in case the SSRC read from janus_rtcp_get_sender_ssrc is not recognized.

lminiero commented 1 year ago

Merging :+1: