MT#62266 SessionTimer: StrictMode, add a fallback with `Require: timer`

For the case when the remote side doesn't explicitly state
it supports the `timer` SIP extension with `Supported: timer`,
try to fallback to `Require: timer` which is a guarantee for the case
with the UAC responsible for the SST timers.

Also add this fallback for the case with requests, e.g. when
UPDATE comes from the remote side to SEMS, and doesn't explicitly
declare the timers support with `Supported: timer` but still adds
the `Require: timer` one (most probably with UAS as a refresher).

Change-Id: Ic2ea79352535413568e4e3e9481cff1a29e43d7a
mr26.2
Donat Zenichev 3 weeks ago
parent 5e412586e5
commit 1fdee1a61f

@ -305,6 +305,13 @@ bool SessionTimer::updateTimer(AmSession* s, const AmSipRequest& req)
remote_timer_aware = key_in_list(getHeader(req.hdrs, SIP_HDR_SUPPORTED, SIP_HDR_SUPPORTED_COMPACT),
TIMER_OPTION_TAG);
/* give a second chance with Require header instead.
* for the requests, this fallback is still questionable because
* RFC 4028 says that the UAC supporting session timers must also include `Supported: timer`
* in requests, even if the `Require: timer` is also present. */
if (!remote_timer_aware)
/* but do not override to false, in case Supported already declared `timer` */
remote_timer_aware = key_in_list(getHeader(req.hdrs, SIP_HDR_REQUIRE), TIMER_OPTION_TAG);
/* disable timers for this leg if not declare explicitly */
if (session_timer_conf.getStrictMode() && !remote_timer_aware) {
@ -409,6 +416,10 @@ bool SessionTimer::updateTimer(AmSession* s, const AmSipReply& reply)
/* verify if B leg supports Session Timers */
remote_timer_aware = key_in_list(getHeader(reply.hdrs, SIP_HDR_SUPPORTED, SIP_HDR_SUPPORTED_COMPACT),
TIMER_OPTION_TAG);
/* give a second chance with Require header instead */
if (!remote_timer_aware)
/* but do not override to false, in case Supported already declared `timer` */
remote_timer_aware = key_in_list(getHeader(reply.hdrs, SIP_HDR_REQUIRE), TIMER_OPTION_TAG);
if (session_timer_conf.getStrictMode() && !remote_timer_aware) {
/* timer is not supported by responder's leg */
@ -573,7 +584,7 @@ int AmSessionTimerConfig::readFromConfig(AmConfigReader& cfg)
/* SST strict mode allows to re-init timers during the session,
* whenever remote side with INVITE/UPDATE method doesn't
* declare `Supported: timer` explicitly. By default always: no.
* declare `Supported: timer` or `Require: timer` explicitly. By default always: no.
*/
if(cfg.hasParameter("sst_strict_mode")){
if (cfg.getParameter("sst_strict_mode", "no") == "yes") {

Loading…
Cancel
Save