Module: kamailio
Branch: 5.3
Commit: a6f117620f97fd8dd22e160938d6d322cce955bd
URL:
https://github.com/kamailio/kamailio/commit/a6f117620f97fd8dd22e160938d6d32…
Author: Kristian F. Høgh <kfh(a)uni-tel.dk>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-06-19T15:16:24+02:00
registrar: expires_range should not make expires < min_expires
(cherry picked from commit c753932ebfa055d923c92b916937eec99cd14d23)
---
Modified: src/modules/registrar/sip_msg.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a6f117620f97fd8dd22e160938d6d32…
Patch:
https://github.com/kamailio/kamailio/commit/a6f117620f97fd8dd22e160938d6d32…
---
diff --git a/src/modules/registrar/sip_msg.c b/src/modules/registrar/sip_msg.c
index 62bc0d9a86..8af14b23ab 100644
--- a/src/modules/registrar/sip_msg.c
+++ b/src/modules/registrar/sip_msg.c
@@ -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);
}