From d573fe8a6c5a2ca26d5b7c0bcba8a8cc26d9344d Mon Sep 17 00:00:00 2001 From: Marco Capetta Date: Mon, 2 Sep 2024 17:20:11 +0200 Subject: [PATCH] MT#60830 Adapt ngcp-dlgcnt-check script to use json output The script ngcp-redis-helper has been improved and now it provides an output in json format. Additionally the command to call is not 'dump' bu 'dumps'. Change-Id: Idd296fc13bf918d67983b2676f2c1e6a08291ebf --- scripts/ngcp-dlgcnt-check | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/ngcp-dlgcnt-check b/scripts/ngcp-dlgcnt-check index 3ed6b24..15f7246 100755 --- a/scripts/ngcp-dlgcnt-check +++ b/scripts/ngcp-dlgcnt-check @@ -36,7 +36,7 @@ host="$(ngcp-dlgcnt-clean -C fake 2>/dev/null|| echo localhost)" # redis full list REDIS_CALLIDS=$(mktemp) -ngcp-redis-helper -h "$host" -n "$REDIS_DB" dump | grep -E -v "^$" > "$REDIS_CALLIDS" || true +ngcp-redis-helper -h "$host" -n "$REDIS_DB" dumps | grep -E -v "^$" > "$REDIS_CALLIDS" || true # kamailio full dialogs (no ngcp-kamcmd because in fails in case of large output) KAMAILIO_DIALOGS=$(mktemp) @@ -47,6 +47,9 @@ REDIS_CALLIDS_FILTER=$(mktemp) grep -E -v '^list:' "$REDIS_CALLIDS" > "$REDIS_CALLIDS_FILTER" || true while read -r i ; do + if [[ "$i" == '[' || "$i" == ']' || "$i" == "Database is empty" ]]; then + continue + fi if ! grep -q -- "$i" "$KAMAILIO_DIALOGS" then printf "CallID:[%s] unknown\n" "$i"