Module: kamailio
Branch: 5.5
Commit: b57ab05589b1982df456b39bf8f26359e73a63cc
URL:
https://github.com/kamailio/kamailio/commit/b57ab05589b1982df456b39bf8f2635…
Author: korayvt <koray.vatansever(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-05-12T16:07:14+02:00
usrloc: unnecessary periodic db queries cancelled
(cherry picked from commit 42bc79b3b617632b6f83e1352b5cb8266706d7c0)
---
Modified: src/modules/usrloc/dlist.c
Modified: src/modules/usrloc/udomain.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b57ab05589b1982df456b39bf8f2635…
Patch:
https://github.com/kamailio/kamailio/commit/b57ab05589b1982df456b39bf8f2635…
---
diff --git a/src/modules/usrloc/dlist.c b/src/modules/usrloc/dlist.c
index 44ce3c6376..252bb8bde0 100644
--- a/src/modules/usrloc/dlist.c
+++ b/src/modules/usrloc/dlist.c
@@ -960,7 +960,9 @@ int synchronize_all_udomains(int istart, int istep)
res |= db_timer_udomain(ptr->d);
}
}
- ul_ka_db_records((unsigned int)istart);
+ if (ul_ka_mode != ULKA_NONE) {
+ ul_ka_db_records((unsigned int)istart);
+ }
} else {
for( ptr=_ksr_ul_root ; ptr ; ptr=ptr->next) {
mem_timer_udomain(ptr->d, istart, istep);
diff --git a/src/modules/usrloc/udomain.c b/src/modules/usrloc/udomain.c
index 9d96b2d7a6..204ddfd29f 100644
--- a/src/modules/usrloc/udomain.c
+++ b/src/modules/usrloc/udomain.c
@@ -1094,8 +1094,10 @@ int db_timer_udomain(udomain_t* _d)
db_val_t vals[3];
int key_num = 2;
- /* call contact expired call back for a domain before deleting database rows */
- udomain_contact_expired_cb(ul_dbh, _d);
+ /* If contact-expired callback exists, run it for a domain before deleting database rows
*/
+ if (exists_ulcb_type(UL_CONTACT_EXPIRE)) {
+ udomain_contact_expired_cb(ul_dbh, _d);
+ }
keys[0] = &ul_expires_col;
ops[0] = "<";