Ver Fonte

usrloc: print ka roundtrip via rpc dump command

Daniel-Constantin Mierla há 5 anos atrás
pai
commit
4652a116fb
2 ficheiros alterados com 8 adições e 2 exclusões
  1. 3 2
      src/modules/usrloc/dlist.c
  2. 5 0
      src/modules/usrloc/ul_rpc.c

+ 3 - 2
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;
 					}

+ 5 - 0
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");