MT#60830 ngcp-dlgcnt-clean fix parsing on json input text

Remove from the existing string any comma or quote that
could come from a json formatting.

Change-Id: I1b22b5ce9cc2c17643558be60cea7bd785fbcf0a
mr13.1
Marco Capetta 1 year ago
parent 7ca0637e61
commit 2a55b4b0b8

@ -50,13 +50,15 @@ while read -r i ; do
if [[ "$i" == '[' || "$i" == ']' || "$i" == "Database is empty" ]]; then
continue
fi
if ! grep -q -- "$i" "$KAMAILIO_DIALOGS"
# remove from the existing string any comma or quote that could come from a json formatting
id=$(echo "$i" | tr -d ',\"')
if ! grep -q -- "$id" "$KAMAILIO_DIALOGS"
then
printf "CallID:[%s] unknown\n" "$i"
printf "CallID:[%s] unknown\n" "$id"
if $REMOVE ; then
ngcp-dlgcnt-clean "--" "$i" || true
if grep -q "list:$i" "$REDIS_CALLIDS" ; then
ngcp-dlglist-clean "--" "$i" || true
ngcp-dlgcnt-clean "--" "$id" || true
if grep -q "list:$id" "$REDIS_CALLIDS" ; then
ngcp-dlglist-clean "--" "$id" || true
fi
fi
fi

Loading…
Cancel
Save