Module: kamailio
Branch: master
Commit: 95992d29c4ab2b8863f1301f0259f295468c5301
URL:
https://github.com/kamailio/kamailio/commit/95992d29c4ab2b8863f1301f0259f29…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: GitHub <noreply(a)github.com>
Date: 2020-06-19T13:12:32+02:00
Merge pull request #2365 from khoegh/423-expires-range
registrar: expires_range should not make expires < min_expires
---
Modified: src/modules/registrar/sip_msg.c
---
Diff:
https://github.com/kamailio/kamailio/commit/95992d29c4ab2b8863f1301f0259f29…
Patch:
https://github.com/kamailio/kamailio/commit/95992d29c4ab2b8863f1301f0259f29…
---
diff --git a/src/modules/registrar/sip_msg.c b/src/modules/registrar/sip_msg.c
index d2dfba0aee..802435865f 100644
--- a/src/modules/registrar/sip_msg.c
+++ b/src/modules/registrar/sip_msg.c
@@ -277,10 +277,6 @@ 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)) {
if(reg_min_expires_mode) {
rerrno = R_LOW_EXP;
@@ -290,6 +286,13 @@ void calc_contact_expires(struct sip_msg* _m, param_t* _ep, int* _e,
int novaria
}
}
+ 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);
}