From 5fdb68a82d912af3f7cdbe49f9f64d098283776c Mon Sep 17 00:00:00 2001 From: Alessio Garzi Date: Wed, 20 Sep 2023 10:07:37 +0200 Subject: [PATCH] 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 --- debian/patches/series | 1 + debian/patches/sipwise/lcr_stats_flags_as_id | 21 ++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 debian/patches/sipwise/lcr_stats_flags_as_id diff --git a/debian/patches/series b/debian/patches/series index b11cbae91..78dd98bb2 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -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 diff --git a/debian/patches/sipwise/lcr_stats_flags_as_id b/debian/patches/sipwise/lcr_stats_flags_as_id new file mode 100644 index 000000000..df7d78cbb --- /dev/null +++ b/debian/patches/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); \