sipsorcery icon indicating copy to clipboard operation
sipsorcery copied to clipboard

Not receiving RTP events or reports

Open tjma2001 opened this issue 1 year ago • 1 comments

I am streaming from my server to the browser using webrtc and FFMPEG. I am trying to figure out if I am getting packet loss indicators from the browser and then trigger a keyframe from my encoding function.

Problem is that I am not getting any callbacks triggered on (peerConnection.OnReceiveReport, peerConnection.OnRtpEvent, peerConnection.OnRtpPacketReceived). I even tried the examples and it doesn't seem to get triggered there either.

This was fairly easy to do in rust, with the same frontend codebase, so I am certain there must be something here that I can do as well. Has this functionality been disabled?

image

tjma2001 avatar Sep 11 '23 13:09 tjma2001

The RTCP support in this library is incomplete. SIP doesn't use RTCP much whereas WebRTC goes crazy with it.

The RTCP report types supported are here.

// Only call OnReceiveRTCPPacket for supported RTCPCompoundPacket types
if (buffer[1] == (byte)RTCPReportTypesEnum.SR ||
    buffer[1] == (byte)RTCPReportTypesEnum.RR ||
    buffer[1] == (byte)RTCPReportTypesEnum.SDES ||
    buffer[1] == (byte)RTCPReportTypesEnum.BYE ||
    buffer[1] == (byte)RTCPReportTypesEnum.PSFB ||
    buffer[1] == (byte)RTCPReportTypesEnum.RTPFB)
{
    OnReceiveRTCPPacket(localPort, remoteEndPoint, buffer);
}

If the RTCP control packet you're looking for is not one of those then you should still get a warning log message.

RTP events are typically DTMF tones. They're hardly ever used in WebRTC given data channels are a much better way to transmit any kind fo data.

sipsorcery avatar Jan 17 '24 23:01 sipsorcery