Skip to content

Commit

Permalink
registrar: expires_range should not make expires < min_expires
Browse files Browse the repository at this point in the history
(cherry picked from commit c753932)
(cherry picked from commit a6f1176)
  • Loading branch information
khoegh authored and miconda committed Jul 16, 2020
1 parent 4c67a6e commit 24e041c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/modules/registrar/sip_msg.c
Expand Up @@ -277,14 +277,17 @@ void calc_contact_expires(struct sip_msg* _m, param_t* _ep, int* _e, int novaria

if ( *_e != 0 )
{
if (!novariation) {
*_e = randomize_expires( *_e, range );
}

if (*_e < cfg_get(registrar, registrar_cfg, min_expires)) {
*_e = cfg_get(registrar, registrar_cfg, min_expires);
}

if (!novariation) {
*_e = randomize_expires( *_e, range );
if (*_e < cfg_get(registrar, registrar_cfg, min_expires)) {
*_e = cfg_get(registrar, registrar_cfg, min_expires);
}
}

if (cfg_get(registrar, registrar_cfg, max_expires) && (*_e > cfg_get(registrar, registrar_cfg, max_expires))) {
*_e = cfg_get(registrar, registrar_cfg, max_expires);
}
Expand Down

0 comments on commit 24e041c

Please sign in to comment.