TT#16507 ngcp-dlgcnt-check: add missing host parameter

* on [CARRIER] ngcp-redis-helper default db is the central node

Change-Id: Ice8ab43a3a006798372a19ebf3dddbf313398374
changes/23/13323/3
Victor Seva 8 years ago
parent c2d4a2eaeb
commit 751c1e7ef9

@ -32,10 +32,11 @@ fi
# read kamailio.proxy.dlgcnt.pair_redis_db
REDIS_DB="$(ngcp-dlgcnt-clean -c 2>/dev/null|| echo 4)"
host="$(ngcp-dlgcnt-clean -C 2>/dev/null|| echo localhost)"
# full list
REDIS_CALLIDS=$(mktemp)
ngcp-redis-helper -n "$REDIS_DB" dump | egrep -v "^$" > "$REDIS_CALLIDS" || true
ngcp-redis-helper -h "$host" -n "$REDIS_DB" dump | egrep -v "^$" > "$REDIS_CALLIDS" || true
# 'lists:' belongs to dlglist
REDIS_CALLIDS_FILTER=$(mktemp)
egrep -v '^list:' "$REDIS_CALLIDS" > "$REDIS_CALLIDS_FILTER" || true

@ -40,6 +40,9 @@ local dlg = NGCPDlg:new()
if arg[1] == '-c' then
print(tostring(dlg.config.pair.db))
os.exit(0)
elseif arg[1] == '-C' then
print(tostring(dlg_config.pair.host))
os.exit(0)
end
if dlg_config then

@ -53,10 +53,18 @@ if [ $1 = -c ] ; then
echo 4
exit 0
fi
if [ $1 = -C ] ; then
echo localhost
exit 0
fi
echo "ngcp-dlgcnt-clean $*">> %s""" % FAKE_CMD_LIST
FAKE_REDIS_HELPER = """
if [ $1 != -n ] && [ $2 != 4 ] ; then
if [ $1 != -h ] && [ $2 != localhost ] ; then
echo $0 $* >&2
exit 1
fi
if [ $3 != -n ] && [ $4 != 4 ] ; then
echo $0 $* >&2
exit 1
fi"""

Loading…
Cancel
Save