System information

(
(i.srvsent >= 0 and i.srvsent < i.srvrec/10) or
(i.srvrec >= 0 and i.srvrec < i.srvsent/10) or
i.srvlosspercent > 50 or i.clientlosspercent > 50 or i.totallosspercent > 50 or
(i.srvlost > i.srvsent/2)
)
then 'NOVOICE'
when realduration > 5 and realduration < 55 and (i.srvsent > 400 or i.srvrec > 400) and
(
(i.srvsent >= 0 and i.srvsent < i.srvrec/4) or
(i.srvrec >= 0 and i.srvrec < i.srvsent/4) or
i.srvlosspercent > 20 or i.clientlosspercent > 20 or i.totallosspercent > 20 or
(i.srvlost > i.srvsent/4)
)
then 'LOW'
when realduration > 40 and i.srvsent > 2000 and i.srvrec > 2000 and
(
(i.srvsent > i.srvrec/4) and
(i.srvrec > i.srvsent/4) and
i.srvlosspercent < 10 and i.clientlosspercent < 10 and i.totallosspercent < 10 and
(i.srvlost < i.srvsent/6)
)
then 'GOOD'
when realduration > 140 and i.srvlosspercent < 15 and i.clientlosspercent < 15 and i.totallosspercent < 19
then 'GOOD'
else 'UNKNOWN' end as 'QUALITY',
b.marker
FROM tb_cdrs b WITH(NOLOCK)
left join tb_cdrinfo i with(nolock) on (b.id = i.cdrid )
left join tb_users u1 with(nolock) on (b.callerid = u1.id )
left join tb_users u2 with(nolock) on (b.calledid = u2.id )
left join tb_reasoncodes r with(nolock) on (b.discreason = r.code)
WHERE
b.datum >= GETDATE()-1
and b.realduration > 0
ORDER by b.datum desc
5.110. Database file usage
SELECT CAST(DB_NAME(mstr.database_id) AS VARCHAR(24)) AS 'Database',