Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jeannotlanglois
Copy link
Contributor

@jeannotlanglois jeannotlanglois commented Jul 13, 2025

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.

@jeannotlanglois jeannotlanglois force-pushed the fix_rtpcheck_regressions branch from 1eecfcd to a1442ac Compare July 14, 2025 01:18
@jeannotlanglois jeannotlanglois force-pushed the fix_rtpcheck_regressions branch 3 times, most recently from f94202a to ed402ed Compare July 14, 2025 01:44
@jeannotlanglois
Copy link
Contributor Author

jeannotlanglois commented Jul 14, 2025

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!

@orgads orgads requested a review from Copilot July 14, 2025 05:29

This comment was marked as outdated.

@orgads
Copy link
Contributor

orgads commented Jul 20, 2025

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

@jeannotlanglois
Copy link
Contributor Author

jeannotlanglois commented Jul 20, 2025 via email

@jeannotlanglois
Copy link
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
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 :)

Copy link
Contributor

@orgads orgads left a comment

Choose a reason for hiding this comment

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

Thank you!

@orgads orgads force-pushed the fix_rtpcheck_regressions branch 2 times, most recently from 012eaea to 4c5ed40 Compare August 1, 2025 11:12
@orgads
Copy link
Contributor

orgads commented Aug 1, 2025

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
@orgads orgads requested a review from Copilot August 1, 2025 11:32
Copy link

Copilot AI left a comment

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

@orgads orgads force-pushed the fix_rtpcheck_regressions branch from 55b4bee to c4b6967 Compare August 1, 2025 12:14
Copy link
Contributor Author

@jeannotlanglois jeannotlanglois left a comment

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!

if (debugrefileaudio == nullptr)
{
debugrefileaudio = fopen("debugrefileaudio", "w");
debugrefileaudio = fopen(build_rtpecho_filename("audio").c_str(), "w");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please keep the "debugrefileaudio". This is named on purpose since it is meant to contain only stuff related to debugging rtpecho of RTP audio.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean you don't want timestamp in the file name? This is your own change, I only reverted it to keep using fopen.

@jeannotlanglois
Copy link
Contributor Author

jeannotlanglois commented Aug 2, 2025 via email

@orgads
Copy link
Contributor

orgads commented Aug 3, 2025

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
Copy link
Contributor Author

jeannotlanglois commented Aug 3, 2025 via email

@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.

2 participants