Module: kamailio
Branch: master
Commit: 4652a116fb940fbda527e1b04a5a0a32f7b9a3fe
URL:
https://github.com/kamailio/kamailio/commit/4652a116fb940fbda527e1b04a5a0a3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-03-27T09:12:34+01:00
usrloc: print ka roundtrip via rpc dump command
---
Modified: src/modules/usrloc/dlist.c
Modified: src/modules/usrloc/ul_rpc.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4652a116fb940fbda527e1b04a5a0a3…
Patch:
https://github.com/kamailio/kamailio/commit/4652a116fb940fbda527e1b04a5a0a3…
---
diff --git a/src/modules/usrloc/dlist.c b/src/modules/usrloc/dlist.c
index 11366cc0f7..ab88801e9e 100644
--- a/src/modules/usrloc/dlist.c
+++ b/src/modules/usrloc/dlist.c
@@ -524,9 +524,10 @@ int ul_update_keepalive(unsigned int _aorhash, str *_ruid, time_t
tval,
{
/* found */
c->last_keepalive = tval;
- LM_DBG("updated keepalive for [%.*s:%u] to %u\n",
+ c->ka_roundtrip = rtrip;
+ LM_DBG("updated keepalive for [%.*s:%u] to %u (rtrip: %u)\n",
_ruid->len, _ruid->s, _aorhash,
- (unsigned int)c->last_keepalive);
+ (unsigned int)c->last_keepalive, c->ka_roundtrip);
unlock_ulslot(p->d, i);
return 0;
}
diff --git a/src/modules/usrloc/ul_rpc.c b/src/modules/usrloc/ul_rpc.c
index 6c00c87c63..32417d06e5 100644
--- a/src/modules/usrloc/ul_rpc.c
+++ b/src/modules/usrloc/ul_rpc.c
@@ -200,6 +200,11 @@ int rpc_dump_contact(rpc_t* rpc, void* ctx, void *ih, ucontact_t* c)
rpc->fault(ctx, 500, "Internal error adding last_keepalive");
return -1;
}
+ if(rpc->struct_add(vh, "d", "KA-Roundtrip",
(int)c->ka_roundtrip)<0)
+ {
+ rpc->fault(ctx, 500, "Internal error adding keepalive roundtrip");
+ return -1;
+ }
if(rpc->struct_add(vh, "d", "Last-Modified",
(int)c->last_modified)<0)
{
rpc->fault(ctx, 500, "Internal error adding last_modified");