diff --git a/scripts/ngcp-dlgcnt-check b/scripts/ngcp-dlgcnt-check index 59de6bb..89f5f64 100755 --- a/scripts/ngcp-dlgcnt-check +++ b/scripts/ngcp-dlgcnt-check @@ -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 diff --git a/scripts/ngcp-dlgcnt-clean b/scripts/ngcp-dlgcnt-clean index 4eae3fd..8ae53fd 100755 --- a/scripts/ngcp-dlgcnt-clean +++ b/scripts/ngcp-dlgcnt-clean @@ -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 diff --git a/tests/test_dlgcnt.py b/tests/test_dlgcnt.py index 5c42680..9cbf3ab 100755 --- a/tests/test_dlgcnt.py +++ b/tests/test_dlgcnt.py @@ -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"""