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". #