From 59275e302d1ccd6c31114c729e5050bc90730dbe Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Fri, 24 Jul 2026 11:54:01 +0200 Subject: [PATCH] MT#62266 SST: introduce `session_timer_transparent` Gets serialized into the bool on the profile's global level. Isn't leg specific, but global for the whole session. Only used to remove SST related headers and option tags from requests and replies being sent through either `SBCCallLeg::onSendRequest()` or `SBCCallLeg::onSendReply()`. Transparent means - do not touch existing SST headers. SessionTimer implementation factory isn't triggered in this case. Change-Id: Id98a8abc957be11d140eba2394fed7ebe1302ca7 --- apps/sbc/SBCCallLeg.cpp | 36 ++++++++++++++++++++++++++---------- apps/sbc/SBCCallProfile.cpp | 5 +++++ apps/sbc/SBCCallProfile.h | 2 ++ apps/sbc/etc/sbc.conf | 7 +++++++ 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/apps/sbc/SBCCallLeg.cpp b/apps/sbc/SBCCallLeg.cpp index 62009313..6d7c363c 100644 --- a/apps/sbc/SBCCallLeg.cpp +++ b/apps/sbc/SBCCallLeg.cpp @@ -804,11 +804,19 @@ void SBCCallLeg::onSendRequest(AmSipRequest& req, int &flags) { CallLeg::onSendRequest(req, flags); - /* check whether SST related headers must be removed before sending out */ - if (!sessionTimerSupportedByLeg(call_profile, a_leg)) { - ILOG_DLG(L_DBG, "SST isn't supported by '%c' leg, remove according headers and option tags.\n", - a_leg ? 'A' : 'B'); - removeSessionTimerHeaders(req.hdrs); + /* clean SST related headers if not supported by the receiving leg + * but only if the mode isn't transparent */ + if (!call_profile.sst_transparent) { + /* check whether SST related headers must be removed before sending out */ + if (!sessionTimerSupportedByLeg(call_profile, a_leg)) { + ILOG_DLG(L_DBG, "SST isn't supported by '%c' leg, remove according headers and option tags.\n", + a_leg ? 'A' : 'B'); + removeSessionTimerHeaders(req.hdrs); + } + } + else { + ILOG_DLG(L_DBG, "Transparent SST mode enabled globally, ignore SST headers for '%c' leg.\n", + a_leg ? 'A' : 'B'); } } @@ -816,11 +824,19 @@ void SBCCallLeg::onSendReply(const AmSipRequest& req, AmSipReply& reply, int &fl { CallLeg::onSendReply(req, reply, flags); - /* check whether SST related headers must be removed before sending out */ - if (!sessionTimerSupportedByLeg(call_profile, a_leg)) { - ILOG_DLG(L_DBG, "SST isn't supported by '%c' leg, remove according headers and option tags.\n", - a_leg ? 'A' : 'B'); - removeSessionTimerHeaders(reply.hdrs); + /* clean SST related headers if not supported by the receiving leg + * but only if the mode isn't transparent */ + if (!call_profile.sst_transparent) { + /* check whether SST related headers must be removed before sending out */ + if (!sessionTimerSupportedByLeg(call_profile, a_leg)) { + ILOG_DLG(L_DBG, "SST isn't supported by '%c' leg, remove according headers and option tags.\n", + a_leg ? 'A' : 'B'); + removeSessionTimerHeaders(reply.hdrs); + } + } + else { + ILOG_DLG(L_DBG, "Transparent SST mode enabled globally, ignore SST headers for '%c' leg.\n", + a_leg ? 'A' : 'B'); } } diff --git a/apps/sbc/SBCCallProfile.cpp b/apps/sbc/SBCCallProfile.cpp index 58e9638e..0bd99877 100644 --- a/apps/sbc/SBCCallProfile.cpp +++ b/apps/sbc/SBCCallProfile.cpp @@ -204,6 +204,9 @@ bool SBCCallProfile::readFromConfiguration(const string& name, return false; sst_enabled = cfg.getParameter("enable_session_timer"); + + sst_transparent = cfg.getParameter("session_timer_transparent", "no") == "yes"; + if (cfg.hasParameter("enable_aleg_session_timer")) { sst_aleg_enabled = cfg.getParameter("enable_aleg_session_timer"); } else { @@ -544,6 +547,7 @@ bool SBCCallProfile::readFromConfiguration(const string& name, INFO("SBC: SST on A leg enabled: '%s'\n", sst_aleg_enabled.empty() ? "no" : sst_aleg_enabled.c_str()); + INFO("SBC: SST transparent mode: %s\n", sst_transparent ? "yes" : "no"); if (sst_aleg_enabled.size() && sst_aleg_enabled != "no") { INFO("SBC: session_expires=%s\n", sst_a_cfg.getParameter("session_expires").c_str()); @@ -652,6 +656,7 @@ bool SBCCallProfile::operator==(const SBCCallProfile& rhs) const { sdpfilter == rhs.sdpfilter && aleg_sdpfilter == rhs.aleg_sdpfilter && mediafilter == rhs.mediafilter && + sst_transparent == rhs.sst_transparent && sst_enabled == rhs.sst_enabled && sst_aleg_enabled == rhs.sst_aleg_enabled && auth_enabled == rhs.auth_enabled && diff --git a/apps/sbc/SBCCallProfile.h b/apps/sbc/SBCCallProfile.h index 0b656abb..a2dd0051 100644 --- a/apps/sbc/SBCCallProfile.h +++ b/apps/sbc/SBCCallProfile.h @@ -142,6 +142,7 @@ struct SBCCallProfile vector sdpalinesfilter; vector mediafilter; + bool sst_transparent; string sst_enabled; bool sst_enabled_value; string sst_aleg_enabled; @@ -353,6 +354,7 @@ struct SBCCallProfile allow_subless_notify(false), anonymize_sdp(false), have_aleg_sdpfilter(false), + sst_transparent(false), sst_enabled_value(false), auth_aleg_enabled(false), uas_auth_bleg_enabled(false), diff --git a/apps/sbc/etc/sbc.conf b/apps/sbc/etc/sbc.conf index e67ca8f6..e2336d50 100644 --- a/apps/sbc/etc/sbc.conf +++ b/apps/sbc/etc/sbc.conf @@ -69,6 +69,13 @@ active_profile=transparent # #accept_501_reply=no +# session_timer_transparent - do not strip SST headers or timer option +# tags while relaying SIP messages to legs without SST support. +# +# Default: no +# +#session_timer_transparent=no + # sst_strict_mode - disable session timers for a leg if an INVITE/UPDATE # request or a positive response does not declare "Supported: timer". #