MT#58314 Use gw flags as id

When invoking lcr.get_statistics and lcr.stats from kamcmd,
print gateway "flags" field as "gw_id" instead of gw_id because "flags" reflects
what it is reported in webui.

Change-Id: I880d251657c3b0cb87327cb55ed4ce5e28ce027b
(cherry picked from commit 5fdb68a82d)
mr11.5
Alessio Garzi 2 years ago
parent 7594b3c95f
commit 6626ae9978

@ -69,3 +69,4 @@ sipwise/pua_dialoginfo-fix-dlg_var-store-and-retrieval.patch
## git checkout -- debian/
### git commit + git-review as usual
###
sipwise/lcr_stats_flags_as_id

@ -0,0 +1,21 @@
--- a/src/modules/lcr/lcr_rpc.c
+++ b/src/modules/lcr/lcr_rpc.c
@@ -109,7 +109,8 @@ static void print_gw_stat(rpc_t *rpc, vo
{
str gw_name;
- rpc->struct_add(st, "d", "gw_id", gw->gw_id);
+ rpc->struct_add(st, "d", "gw_id", gw->flags);
+ rpc->struct_add(st, "d", "lcr_gw_id", gw->gw_id);
gw_name.s = gw->gw_name;
gw_name.len = gw->gw_name_len;
rpc->struct_add(st, "S", "gw_name", &gw_name);
@@ -558,7 +559,7 @@ static void lcr_print_stats(rpc_t *rpc,
}
#define CREATE_RPC_ENTRY(var1, var2) \
- snprintf(param, sizeof(param), "%s%u:%s = %lu", "gw", gw->gw_id, var1, \
+ snprintf(param, sizeof(param), "%s%u:%s = %lu", "gw", gw->flags, var1, \
var2); \
paramstr.s = param; \
paramstr.len = strlen(param); \
Loading…
Cancel
Save