TT#7190 ngcp-dlgcnt-check

* fix default redis db when no config file
* fix call-id list from kamailio
* refesh Docker due to TT#5032

Change-Id: Ie8847b238e5a24b22baa48fc8c9b41e39397d84e
changes/84/9984/5
Victor Seva 9 years ago
parent ab391d0405
commit d80e64fd29

@ -31,7 +31,7 @@ if ! ngcp-check_active -q ; then
fi
# read kamailio.proxy.dlgcnt.pair_redis_db
REDIS_DB="$(ngcp-dlgcnt-clean -c|| echo 4)"
REDIS_DB="$(ngcp-dlgcnt-clean -c 2>/dev/null|| echo 4)"
# full list
REDIS_CALLIDS=$(mktemp)
@ -42,7 +42,7 @@ egrep -v '^list:' "$REDIS_CALLIDS" > "$REDIS_CALLIDS_FILTER" || true
# list of dialogs known by kamailio
KAM_CALLIDS=$(mktemp)
ngcp-sercmd proxy dlg.list | awk -F: '/call-id:/ { print $2}' > "$KAM_CALLIDS"
ngcp-sercmd proxy dlg.list | awk -F' ' '/call-id:/ { print $2}' > "$KAM_CALLIDS"
while read -r i ; do
if ! grep -q "$i" "$KAM_CALLIDS" ; then

@ -13,7 +13,7 @@ local function get_config()
local ok,e = pcall(dofile,config)
if not ok then
io.stderr:write(e..'\n')
print("using defaults\n")
io.stderr:write("using defaults\n")
end
end

@ -13,7 +13,7 @@ local function get_config()
local ok,e = pcall(dofile,config)
if not ok then
io.stderr:write(e..'\n')
print("using defaults\n")
io.stderr:write("using defaults\n")
end
end

@ -5,7 +5,7 @@ FROM docker.mgm.sipwise.com/sipwise-jessie:latest
# is updated with the current date. It will force refresh of all
# of the base images and things like `apt-get update` won't be using
# old cached versions when the Dockerfile is built.
ENV REFRESHED_AT 2016-12-1
ENV REFRESHED_AT 2016-12-2
# TODO - the release-trunk-jessie is too dynamic yet, though required for lua-unit backport
RUN echo "deb https://deb.sipwise.com/autobuild/ release-trunk-jessie main" >>/etc/apt/sources.list

@ -1,3 +1,3 @@
ngcp-dlgcnt-clean f81f8a33-2dbd-1235-018c-0090fb484030-pbx_1
ngcp-dlgcnt-clean f81f8a33-2dbd-1235-018c-0090fb484030
ngcp-dlglist-clean f81f8a33-2dbd-1235-018c-0090fb484030
ngcp-dlgcnt-clean f81f8a33-2dbd-1235-018c-0090fb484030:5060-pbx_1
ngcp-dlgcnt-clean f81f8a33-2dbd-1235-018c-0090fb484030:5060
ngcp-dlglist-clean f81f8a33-2dbd-1235-018c-0090fb484030:5060

@ -1,7 +1,7 @@
{
h_entry: 51
h_id: 3315
call-id: WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107
call-id: WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107:5080
from_uri: sip:390649904073@voxbone.com
to_uri: sip:390240708163@46.29.177.34
state: 4
@ -45,7 +45,7 @@
recent_calls_key: 38de282f-5c5c-4d71-8a0d-b300a68d86ec
}
{
lua_dlg_callid: WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107
lua_dlg_callid: WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107:5080
}
}
}

@ -1,4 +1,4 @@
WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107
f81f8a33-2dbd-1235-018c-0090fb484030-pbx_1
f81f8a33-2dbd-1235-018c-0090fb484030
list:f81f8a33-2dbd-1235-018c-0090fb484030
WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107:5080
f81f8a33-2dbd-1235-018c-0090fb484030:5060-pbx_1
f81f8a33-2dbd-1235-018c-0090fb484030:5060
list:f81f8a33-2dbd-1235-018c-0090fb484030:5060

@ -1,7 +1,7 @@
{
h_entry: 51
h_id: 3315
call-id: WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107
call-id: WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107:5060
from_uri: sip:390649904073@voxbone.com
to_uri: sip:390240708163@46.29.177.34
state: 4
@ -45,14 +45,14 @@
recent_calls_key: 38de282f-5c5c-4d71-8a0d-b300a68d86ec
}
{
lua_dlg_callid: WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107
lua_dlg_callid: WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107:5060
}
}
}
{
h_entry: 52
h_id: 3316
call-id: WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107-pbx_1
call-id: WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107:5060-pbx_1
from_uri: sip:390649904073@voxbone.com
to_uri: sip:390240708163@46.29.177.34
state: 4
@ -96,7 +96,7 @@
recent_calls_key: 38de282f-5c5c-4d71-8a0d-b300a68d86ec
}
{
lua_dlg_callid: WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107-pbx_1
lua_dlg_callid: WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107:5060-pbx_1
}
}
}

@ -1,3 +1,3 @@
WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107-pbx_1
WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107
list:WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107
WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107:5060-pbx_1
WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107:5060
list:WSGH2SB52VHYLPX4VQQ6N4B2ZM@81.201.82.107:5060

@ -108,6 +108,17 @@ class TestDlgCnt(unittest.TestCase):
self.assertEqual(res[0], 3, res[1])
self.checkNotCmd()
def test_noredisconf(self):
create_prog(os.path.join(FAKE_BIN, 'ngcp-dlgcnt-clean'),
'echo "error" >&2; false')
create_prog(os.path.join(FAKE_BIN, 'ngcp-sercmd'),
"true")
create_prog(os.path.join(FAKE_BIN, 'ngcp-redis-helper'),
"%s; true" % FAKE_REDIS_HELPER)
res = executeAndReturnOutput(self.command)
self.assertEqual(res[0], 0, res[1])
self.checkNotCmd()
def test_redisconf(self):
create_prog(os.path.join(FAKE_BIN, 'ngcp-sercmd'),
"true")

Loading…
Cancel
Save