sipwise / rtpengine

The Sipwise media proxy for Kamailio
GNU General Public License v3.0
763 stars 360 forks source link

RTCP packets failing to be processed properly after starting a recording on a call. #1803

Open joeygo opened 4 months ago

joeygo commented 4 months ago

rtpengine version the issue has been seen with

11.5.2.0+0~mr11.5.2.0 git-mr11.5-55ff3bdb, mr11.4.1.3, 12.1.1.7

Used distribution and its version

Debian 12

Linux kernel version used

6.1.0-18-cloud-amd64

CPU architecture issue was seen on (see uname -m)

None

Expected behaviour you didn't see

RTCP packets should continue to be processed properly even after the recording is initiated

Unexpected behaviour you saw

After starting or stoping the recording, RTCP packets fail to be processed, and the following error messages are logged on the PJSIP client: 20:43:22.092 srtp0x143815c00 !Failed to unprotect SRTCP, pkt size=94, err=replay check failed (bad index) 20:43:22.876 srtp0x143815c00 Failed to unprotect SRTCP, pkt size=94, err=replay check failed (bad index) 20:43:23.655 srtp0x143815c00 Failed to unprotect SRTCP, pkt size=94, err=replay check failed (bad index)

Steps to reproduce the problem

I'm using two PJSIP clients (client-A and client-B) with TLS and SRTP, Kamailio, rtpengine and rtpengine-recording. When client-A calls client-B, I'm passing RTPEngine the DTMF-log-dest flag and I have a logic on kamailio that I start and stop recording based on DTMF events I receive. Before the recording is active, I can see RTCP messages flows correctly. When I start the recording the RTCP messages are not received anymore in the clients and I see the following error messages are logged on the PJSIP client: 20:43:22.092 srtp0x143815c00 !Failed to unprotect SRTCP, pkt size=94, err=replay check failed (bad index) 20:43:22.876 srtp0x143815c00 Failed to unprotect SRTCP, pkt size=94, err=replay check failed (bad index) 20:43:23.655 srtp0x143815c00 Failed to unprotect SRTCP, pkt size=94, err=replay check failed (bad index)

I tested this behavior on 3 different versions of RTPEngine: mr11.4.1.3, 11.5.2.0, and 12.1.1.7

Log with Debug level is attached

Additional program output to the terminal or logs illustrating the issue

No response

Anything else?

No response

joeygo commented 4 months ago

syslog.log

rfuchs commented 4 months ago

The log seems to show that SRTCP packets are sent with continuously increasing indexes, which would be correct. You can confirm the indexes with Wireshark. Does PJSIP expect something different?

joeygo commented 4 months ago

Hi @rfuchs, PJSIP works well with SRTCP coming from rtpengine, as I said everything works well until I start the recording in rtpengine. If I repeat the exact same test but without recording all works well. The reported issue happens only after I start the recording during the session. In addition, if I leave the call open, after 30-40 second I see that the rtcp packets are detected well on PJSIP. Is there a flag that I can pass to rtpengine that may help to this scenarios? Or something else I can check?

rfuchs commented 4 months ago

What does Wireshark say the SRTCP indexes are?