Skip to content

Fix RTPCHECK functionality regressions - #798

Merged
orgads merged 3 commits into
SIPp:masterfrom
jeannotlanglois:fix_rtpcheck_regressions
Aug 3, 2025
Merged

Fix RTPCHECK functionality regressions#798
orgads merged 3 commits into
SIPp:masterfrom
jeannotlanglois:fix_rtpcheck_regressions

Conversation

@jeannotlanglois

@jeannotlanglois jeannotlanglois commented Jul 13, 2025

Copy link
Copy Markdown
Contributor

This PR resolves regressions in the RTPCHECK functionality which were introduced right when it was merged in SIPp-3.7.0~rc1 back in 2023.

  • Fixed crash occurring on RE-INVITEs when processing SRTP crypto parameters (was caused by incorrect substitution of strncat() instead of memset()+strncpy() when RTPCHECK functionality was first introduced in 3.7.0~rc1).
  • Restored code to use timestamps in RTP echo action log file names in rtpstream_rtpecho_startaudio() -- this had been mistakenly taken out when RTPCHECK functionality was first instroduced in 3.7.0~rc1.
  • Restored code to use timestamps in RTP echo action log file names in rtpstream_rtpecho_startvideo() -- this had been mistakenly taken out when RTPCHECK functionality was first instroduced in 3.7.0~rc1.
  • Modified rtpstream_rtpecho_startaudio() to perform use safe open()/fdopen() APIs to restrict access to RTP echo action log file.
  • Modified rtpstream_rtpecho_startvideo() to perform use safe open()/fdopen() APIs to restrict access to RTP echo action log file.
  • Added dummy custom JLSRTP class constructor to allow providing (SSRC, IP, port) at construction time when using non-SSL builds (so that encapsulation can be maintained without the need for externs).
  • Modified call class to use custom JLSRTP class constructor (to maintain encapsulation without the need for externs).
  • Modified rtpstream code to use custom JLSRTP constructor (to maintain encapsulation without the need for externs).
  • Parameterized global_ssrc_id to allow either maintaining legacy SIPP behavior (default constant SSRC required by RTPCHECK functionality) or randomly generating them (varying SSRC).
  • Modified main sipp code to properly apply parameterized global_ssrc_id parameter.

Comment thread src/rtpstream.cpp Fixed
Comment thread src/rtpstream.cpp Fixed
@jeannotlanglois
jeannotlanglois force-pushed the fix_rtpcheck_regressions branch from 1eecfcd to a1442ac Compare July 14, 2025 01:18
Comment thread src/rtpstream.cpp Fixed
@jeannotlanglois
jeannotlanglois force-pushed the fix_rtpcheck_regressions branch 3 times, most recently from f94202a to ed402ed Compare July 14, 2025 01:44
@jeannotlanglois

jeannotlanglois commented Jul 14, 2025

Copy link
Copy Markdown
Contributor Author

Hello @wdoekes :

I'm finally back working full time in the IP telephony domain - which means that I'm back using/testing/improving SIPP :).

As I've had time to finally look, use and test the RTPCHECK functionality which was merged in SIPp-3.7.0 in 2023, I've noticed that several regressions were introduced right when my code was initially imported in SIPp-3.7.0~rc1 -- so the RTPCHECK functionality code that got included starting with SIPP-3.7.0 never quite fully functioned properly.

This PR resolves ALL these known issues.

I would like to suggest that the current PR's fix is used for a new SIPp-3.7.4 bugfix version.

I'm running out of time today but within the next day or two I expect to write more details at the top of this PR to explain every item addressed.

It's good to be back in IP telephony :)

Cheers!

Comment thread include/jlsrtp.hpp Outdated
Comment thread src/call.cpp Outdated
Comment thread src/jlsrtp.cpp
Comment thread src/rtpstream.cpp Outdated
Comment thread src/call.cpp Outdated
Comment thread src/rtpstream.cpp Outdated
Comment thread src/rtpstream.cpp Outdated
Comment thread src/rtpstream.cpp Outdated
@orgads
orgads requested a review from Copilot July 14, 2025 05:29

This comment was marked as outdated.

@orgads

orgads commented Jul 20, 2025

Copy link
Copy Markdown
Contributor

@jeannotlanglois Thanks a lot for your contribution! Can you please address the comments so we can push this forward?

@jeannotlanglois

jeannotlanglois commented Jul 20, 2025 via email

Copy link
Copy Markdown
Contributor Author

@jeannotlanglois

Copy link
Copy Markdown
Contributor Author

Commit containing changes applied during round #1 pending...

@jeannotlanglois
jeannotlanglois force-pushed the fix_rtpcheck_regressions branch from 6b7563c to a55ce5b Compare July 20, 2025 17:47
@jeannotlanglois

Copy link
Copy Markdown
Contributor Author

@orgads :

Hello -- I've responded to all questions and addressed most ( if not all ) concerns -- let me know what you think about what remains. Within the next week I plan to help finalize this if anything else needs addressing.

Cheers :)

@orgads orgads left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment thread src/call.cpp Outdated
Comment thread src/rtpstream.cpp Outdated
Comment thread src/rtpstream.cpp Outdated
Comment thread src/rtpstream.cpp Outdated
@orgads
orgads force-pushed the fix_rtpcheck_regressions branch 2 times, most recently from 012eaea to 4c5ed40 Compare August 1, 2025 11:12
@orgads

orgads commented Aug 1, 2025

Copy link
Copy Markdown
Contributor

Ok, instead of continuing this ping-pong, I just pushed my proposal. If you approve, I'll go ahead and merge it.

@orgads
orgads force-pushed the fix_rtpcheck_regressions branch from 4c5ed40 to 55b4bee Compare August 1, 2025 11:22
Comment thread src/rtpstream.cpp Dismissed
Comment thread src/rtpstream.cpp Dismissed
@orgads
orgads requested a review from Copilot August 1, 2025 11:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes critical regressions in the RTPCHECK functionality that were introduced in SIPp-3.7.0~rc1. The key changes include fixing a crash caused by incorrect string handling, restoring timestamp functionality in log filenames, implementing safer file operations, and improving encapsulation through a new SrtpChannel class.

Key changes:

  • Fixed SRTP crypto parameter processing crash by correcting string operations from unsafe strncat() to safe strcpy()
  • Restored timestamp-based naming for RTP echo log files that was accidentally removed
  • Added new SrtpChannel wrapper class to improve encapsulation and eliminate extern dependencies

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/sipp.cpp Added random_base_ssrc parameter and proper global_ssrc_id initialization
src/rtpstream.cpp Fixed log filename timestamps, corrected mutex unlock, and updated SRTP type usage
src/jlsrtp.cpp Fixed constructor parameter type and added dummy constructor for non-SSL builds
src/call.cpp Replaced unsafe strncat() with strcpy() throughout SRTP parameter handling
sipp_scenarios/pfca_uas_both_crypto_simple.xml Reorganized RTP echo actions within send element
include/srtp_channel.hpp New header defining SrtpChannel wrapper class
include/rtpstream.hpp Updated to use forward declaration instead of direct include
include/jlsrtp.hpp Updated constructor signature and version number
include/call.hpp Updated to use SrtpChannel instead of JLSRTP directly

Comment thread src/rtpstream.cpp
Comment thread src/rtpstream.cpp Outdated
Comment thread include/jlsrtp.hpp Outdated
@orgads
orgads force-pushed the fix_rtpcheck_regressions branch from 55b4bee to c4b6967 Compare August 1, 2025 12:14

@jeannotlanglois jeannotlanglois left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good - I only spotted two small items regarding RTP echo audio/video filenames which I'd like to be kept as-is.
Once these two are fixed the rest can be approved+merged.

I will be away on a short one-week vacation but can check for any updates by Sunday afternoon once I regain access to a computer.

Thanks!

Comment thread src/rtpstream.cpp
Comment thread src/rtpstream.cpp
@jeannotlanglois

jeannotlanglois commented Aug 2, 2025 via email

Copy link
Copy Markdown
Contributor Author

@orgads

orgads commented Aug 3, 2025

Copy link
Copy Markdown
Contributor

No these changes are fine ans timestamps are needed, rather see the file names that were changed around the murex scope change cide areas. Tget should be "debugrefileaudio" and "debugrefilevideo".

But this is already done here, by passing audio/video to build_rtpecho_filename. What do you find missing?

@jeannotlanglois

jeannotlanglois commented Aug 3, 2025 via email

Copy link
Copy Markdown
Contributor Author

@orgads
orgads merged commit 6db4598 into SIPp:master Aug 3, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants