Module: kamailio
Branch: master
Commit: 30eda8a8f244e3e6eba66b50fa355b11735d8f7d
URL:
https://github.com/kamailio/kamailio/commit/30eda8a8f244e3e6eba66b50fa355b1…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-03-27T18:16:28+01:00
usrloc: keepalive server id filtering also for in-memory contacts
---
Modified: src/modules/usrloc/dlist.c
Modified: src/modules/usrloc/ul_keepalive.c
---
Diff:
https://github.com/kamailio/kamailio/commit/30eda8a8f244e3e6eba66b50fa355b1…
Patch:
https://github.com/kamailio/kamailio/commit/30eda8a8f244e3e6eba66b50fa355b1…
---
diff --git a/src/modules/usrloc/dlist.c b/src/modules/usrloc/dlist.c
index 14eb75b1d4..a811df5326 100644
--- a/src/modules/usrloc/dlist.c
+++ b/src/modules/usrloc/dlist.c
@@ -222,6 +222,9 @@ int ul_ka_db_records(int partidx)
/* flags */
uc.cflags = VAL_BITMAP(ROW_VALUES(row) + 3);
+ /* server id */
+ uc.server_id = server_id;
+
/* aor from username and domain */
ur.aor.s = aorbuf;
ur.domain = &dom->name;
diff --git a/src/modules/usrloc/ul_keepalive.c b/src/modules/usrloc/ul_keepalive.c
index 3557848e34..7955efa14b 100644
--- a/src/modules/usrloc/ul_keepalive.c
+++ b/src/modules/usrloc/ul_keepalive.c
@@ -31,6 +31,7 @@
#include "../../core/ut.h"
#include "../../core/resolve.h"
#include "../../core/forward.h"
+#include "../../core/globals.h"
#include "../../core/parser/parse_uri.h"
#include "../../core/parser/parse_from.h"
#include "../../core/parser/parse_to.h"
@@ -69,6 +70,7 @@ extern str ul_ka_from;
extern str ul_ka_domain;
extern str ul_ka_method;
extern int ul_ka_mode;
+extern int ul_ka_filter;
extern unsigned int nat_bflag;
static unsigned int _ul_ka_counter = 0;
@@ -113,6 +115,9 @@ int ul_ka_urecord(urecord_t *ur)
if (uc->c.len <= 0) {
continue;
}
+ if((ul_ka_filter&GAU_OPT_SERVER_ID) && (uc->server_id != server_id)) {
+ continue;
+ }
if(ul_ka_mode & ULKA_NAT) {
/* keepalive for natted contacts only */
if (nat_bflag == 0) {