Module: kamailio
Branch: master
Commit: 3f38206d88af0fae4c64ee3072eb78ea68f813cb
URL:
https://github.com/kamailio/kamailio/commit/3f38206d88af0fae4c64ee3072eb78e…
Author: Dragos Vingarzan <vingarzan(a)gmail.com>
Committer: Dragos Vingarzan <dragos(a)neatpath.net>
Date: 2024-10-22T16:21:49+02:00
ims_registrar_scscf: fixing em_max_expires
---
Modified: src/modules/ims_registrar_scscf/config.c
Modified: src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c
Modified: src/modules/ims_registrar_scscf/save.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3f38206d88af0fae4c64ee3072eb78e…
Patch:
https://github.com/kamailio/kamailio/commit/3f38206d88af0fae4c64ee3072eb78e…
---
diff --git a/src/modules/ims_registrar_scscf/config.c
b/src/modules/ims_registrar_scscf/config.c
index a01b4185f79..e4a2b5b5a14 100644
--- a/src/modules/ims_registrar_scscf/config.c
+++ b/src/modules/ims_registrar_scscf/config.c
@@ -31,19 +31,19 @@
#include "config.h"
struct cfg_group_registrar default_registrar_cfg = {
- 3600, /* default_expires */
- 0, /* default_expires_range */
- 60, /* min_expires */
- 0, /* max_expires */
- 3600, /* emergency contact default expires */
- 60, /* emergency contact max expires */
- 0, /* emergency contact min expires */
- 0, /* max_contacts */
- 0, /* retry_after */
- 0, /* case_sensitive */
- Q_UNSPECIFIED, /* default_q */
- 1, /* append_branches */
- "" /* realm_pref */
+ .default_expires = 3600, /* default_expires */
+ .default_expires_range = 0, /* default_expires_range */
+ .min_expires = 60, /* min_expires */
+ .max_expires = 600000, /* max_expires */
+ .em_default_expires = 1800, /* emergency contact default expires */
+ .em_max_expires = 3600, /* emergency contact max expires */
+ .em_min_expires = 0, /* emergency contact min expires */
+ .max_contacts = 0, /* max_contacts */
+ .retry_after = 0, /* retry_after */
+ .case_sensitive = 0, /* case_sensitive */
+ .default_q = Q_UNSPECIFIED, /* default_q */
+ .append_branches = 1, /* append_branches */
+ .realm_pref = "" /* realm_pref */
};
void *registrar_cfg = &default_registrar_cfg;
diff --git a/src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c
b/src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c
index 08260dcb0a3..9c0b5c534e3 100644
--- a/src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c
+++ b/src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c
@@ -284,7 +284,7 @@ static param_export_t params[] = {
{"max_expires", INT_PARAM, &default_registrar_cfg.max_expires},
{"em_default_expires", INT_PARAM,
&default_registrar_cfg.em_default_expires},
- {"em_min_expires", INT_PARAM, &default_registrar_cfg.em_max_expires},
+ {"em_max_expires", INT_PARAM, &default_registrar_cfg.em_max_expires},
{"em_min_expires", INT_PARAM, &default_registrar_cfg.em_min_expires},
{"default_q", INT_PARAM, &default_registrar_cfg.default_q},
diff --git a/src/modules/ims_registrar_scscf/save.c
b/src/modules/ims_registrar_scscf/save.c
index cf3bea78277..8c67b62c241 100644
--- a/src/modules/ims_registrar_scscf/save.c
+++ b/src/modules/ims_registrar_scscf/save.c
@@ -125,20 +125,24 @@ static inline int calc_contact_expires(
: default_registrar_cfg.default_expires;
goto end;
}
- if(!sos_reg && r < default_registrar_cfg.min_expires) {
+ if(!sos_reg && r < default_registrar_cfg.min_expires
+ && default_registrar_cfg.min_expires != 0) {
r = default_registrar_cfg.min_expires;
goto end;
}
- if(sos_reg && r < default_registrar_cfg.em_min_expires) {
+ if(sos_reg && r < default_registrar_cfg.em_min_expires
+ && default_registrar_cfg.em_min_expires != 0) {
r = default_registrar_cfg.em_min_expires;
goto end;
}
- if(!sos_reg && r > default_registrar_cfg.max_expires) {
+ if(!sos_reg && r > default_registrar_cfg.max_expires
+ && default_registrar_cfg.max_expires != 0) {
r = default_registrar_cfg.max_expires;
goto end;
}
- if(sos_reg && r > default_registrar_cfg.em_max_expires) {
- r = default_registrar_cfg.em_min_expires;
+ if(sos_reg && r > default_registrar_cfg.em_max_expires
+ && default_registrar_cfg.em_max_expires != 0) {
+ r = default_registrar_cfg.em_max_expires;
goto end;
}
end: