Вы находитесь на странице: 1из 114

--------------------------------------------------------------------------------

--
-- Script to create the CallAnalysis procedure
-- Date: 01. Februar 2013
-- Last change by: A.Hellenbart (tuning callEndTimeStamp in RAT case)
--------------------------------------------------------------------------------
--
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sqCallAnal
ysis]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[sqCall
Analysis]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sqCallAnal
ysisCode]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[sq
CallAnalysisCode]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sqDataCall
Analysis]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[sq
DataCallAnalysis]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sqDataCall
AnalysisCode]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo]
.[sqDataCallAnalysisCode]
GO
--------------------------------------------------------------------------------
--
--------------------------------------------------------------------------------
--
CREATE PROCEDURE sqCallAnalysis
@mode int,
@sessionId bigint = 0
AS
BEGIN
--@mode = 0 all sessions
--@mode = 1 all sessions in Sessionlist
--@mode = 2 only @session
--declare @mode integer
--declare @sessionID bigint
-- set @mode = 0
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CA_Session
s]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[CA_Sessions]
CREATE TABLE [dbo].[CA_Sessions] (
[SessionId] [bigint] NOT NULL ,
[sessionType] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[startTime] [datetime] NULL ,
[duration] [int] NULL ,
[info] [varchar] (50) COLLATE Latin1_General_CI_AS NULL
) ON [MainGroup]
CREATE INDEX [IX_CA_Sessions_1] ON [dbo].[CA_Sessions]([SessionId]) ON [MainGrou
p]
INSERT INTO CA_Sessions
select s.SessionId, s.SessionType, s.StartTime, s.Duration, s.Info
FROM sessions s, CallSession c
where s.sessionType = 'CALL' and
c.SessionId = s.SessionId and
c.MediaClient = 'Phone' and
((@mode = 0) or
(@mode = 1 and s.sessionID in (select l.sessionID from sessionlist l)) or
(@mode = 2 and s.sessionID = @sessionID))
if (Select Count(SessionId) from CA_Sessions) = 0
begin
drop table CA_Sessions
Return
end
--------------------------------------------------------------------------------
------------------------
-- calculate Call Charakteristics
-- [technology] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
-- [band] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
-- [Roaming] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
-- [NetIds] [int] NULL ,
--------------------------------------------------------------------------------
------------------------
DECLARE @time as datetime
DECLARE @debug integer
DECLARE @code as varchar(255)
Select @debug = 0 -- set to one for debug reasons only
if @debug=1
BEGIN
Select @time = GetDate()
PRINT 'Script started - ' + CONVERT(varchar,@time,114)
END
select
s.sessionID,
max(c.callDir) as callDirection,
case when max(substring(n.technology,1,4)) = min(substring(n.technology,
1,4))
then max(substring(n.technology,1,4))
else min(substring(n.technology,1,4))+'/'+ max(substring(n.technolo
gy,1,4)) end as Technology,
case when max(substring(n.technology,1,4)) = min(substring(n.technology,
1,4))
then case when max(n.technology) = min(n.technology)
then max(n.technology)
else 'Dualband' end
else 'RAT-Change' end as Band,
case when (max(n.Operator) = min(n.HomeOperator))
then 'No'
else 'Yes' end as Roaming,
count(*) as NetIds
into #CallCharacteristics
from
CallAnalysis a,
CallSession c,
CA_Sessions s,
NetworkIDRelation r,
NetworkInfo n
where
a.sessionID = c.sessionID and
c.sessionID = s.sessionID and
n.networkID = r.networkID and
r.sessionID = s.sessionID and
s.SessionType = 'CALL'
group by
s.sessionID
order by
s.sessionID asc
Update CallAnalysis
set
CallAnalysis.Technology = c.Technology,
Band = c.Band,
Roaming = c.Roaming,
NetIds = c.NetIDs,
CallDir = CallDirection
from
#CallCharacteristics c
where
CallAnalysis.sessionID = c.sessionID
drop table #CallCharacteristics
if @debug=1
BEGIN
PRINT 'Characteristics duration calculation finished. Duration: ' + CONVERT(v
archar,DateDiff(s,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- calculate the start time, end time and duraton for each session
-- [callDuration] [int] NULL ,
-- [callStart] [datetime] NULL,
-- [callEnd] [datetime] NULL,
--------------------------------------------------------------------------------
------------------------
UPDATE callAnalysis
set callStartTimeStamp = Markers.msgTime,
startTechnology = substring(NetworkInfo.Technology,1,4)
from Markers, callAnalysis , CA_Sessions, networkInfo
where CA_Sessions.SessionId = Markers.sessionId AND
markers.sessionId = callAnalysis.sessionId AND
networkInfo.networkID = markers.networkID and
(Markers.info = 'A' OR (CallStatus = 'Failed' and Markers.info = 'B')) a
nd
(Markers.MarkerText = 'Dial' OR
Markers.MarkerText = 'Incoming Call')
UPDATE callAnalysis
set connAckTimeStamp = Markers.msgTime,
startTechnology = substring(NetworkInfo.Technology,1,4)
from Markers, callAnalysis , CA_Sessions, networkInfo
where CA_Sessions.SessionId = Markers.sessionId AND
markers.sessionId = callAnalysis.sessionId AND
networkInfo.networkID = markers.networkID and
Markers.MarkerText = 'Connected' and Markers.Info = 'A'
select markers.sessionID,
min (Markers.msgTime) as DisconTime
into #DisconnectTime
from Markers, callAnalysis, CA_Sessions
where CA_Sessions.SessionId = markers.SessionId AND
markers.sessionId = callAnalysis.sessionId AND
Markers.Info = 'A' AND
((Markers.MarkerText = 'CallTerminated') or
(Markers.MarkerText = 'Disconnect') or
(Markers.MarkerText = 'Break') or
(Markers.MarkerText = 'ConnectFailed'))
group by
Markers.sessionID
UPDATE callAnalysis
set callEndTimeStamp = Markers.msgTime
from Markers, callAnalysis, CA_Sessions
where CA_Sessions.SessionId = markers.SessionId AND
markers.sessionId = callAnalysis.sessionId AND
Markers.info = 'A' and
((Markers.MarkerText = 'CallTerminated') or
(Markers.MarkerText = 'Break'))
UPDATE callAnalysis
set callDisconnectTimeStamp = DisconTime
from #DisconnectTime
where #DisconnectTime.sessionID = callAnalysis.sessionID
--- Determining end of Dropped and Failed calls in GSM
select MsgGSMLayer1.sessionID,
max (MsgGSMLayer1.msgTime) as EndTime
into #DisconnTimeGSM
from MsgGSMLayer1, callAnalysis, CA_Sessions
where CA_Sessions.SessionId = MsgGSMLayer1.SessionId AND
MsgGSMLayer1.sessionId = callAnalysis.sessionId AND
MsgGSMLayer1.FormatID = 'DEDICATED' and
MsgGSMLayer1.msgTime <= callDisconnectTimeStamp and
callAnalysis.CallStatus in ('Dropped','Failed')
group by
MsgGSMLayer1.sessionID
--- Determining end of Dropped and Failed calls in UMTS
select WCDMARRCState.sessionID,
max (WCDMARRCState.msgTime) as EndTime
into #DisconnTimeUMTS
from WCDMARRCState, callAnalysis, CA_Sessions
where CA_Sessions.SessionId = WCDMARRCState.SessionId AND
WCDMARRCState.sessionId = callAnalysis.sessionId AND
WCDMARRCState.RRCState = 0 and
WCDMARRCState.msgTime <= callDisconnectTimeStamp and
callAnalysis.CallStatus in ('Dropped','Failed')
group by
WCDMARRCState.sessionID
--- Setting call end of failed calls per default as 5 sec after Dial
UPDATE callAnalysis
set callDisconnectTimeStamp = case when callAnalysis.CallDir = 'B->A' then d
ateadd(s,15,Markers.msgTime) else dateadd(s,5,Markers.msgTime)end
from Markers, callAnalysis , CA_Sessions
where CA_Sessions.SessionId = Markers.sessionId AND
markers.sessionId = callAnalysis.sessionId AND
callAnalysis.CallStatus = 'Failed' and
Markers.MarkerText = 'Dial'
--- Updating call end time
UPDATE callAnalysis
set callDisconnectTimeStamp = EndTime
from #DisconnTimeUMTS
where #DisconnTimeUMTS.sessionID = callAnalysis.sessionID
UPDATE callAnalysis
set callDisconnectTimeStamp = EndTime
from #DisconnTimeGSM
where #DisconnTimeGSM.sessionID = callAnalysis.sessionID
UPDATE callAnalysis
set callDisconnectTimeStamp = case when u.EndTime < g.EndTime then u.EndTime
else g.EndTime end
from #DisconnTimeUMTS u,#DisconnTimeGSM g
where u.sessionID = callAnalysis.sessionID and
g.sessionID = u.sessionID
Update callAnalysis
Set callduration = DateDiff(ms,callStartTimeStamp,CallEndTimeStamp)
from CA_Sessions
where CA_Sessions.sessionId = callAnalysis.sessionId
-- if CallTerminated occurs after session end
Update callAnalysis
Set callduration = Duration, -- DateDiff(ms,startTime,callStartTimeStamp)
callEndTimeStamp = DateAdd(ms,Duration,startTime)
from CA_Sessions
where CA_Sessions.sessionId = callAnalysis.sessionId and
callAnalysis.CallDuration is NULL
Update callAnalysis
Set callDisconnectTimeStamp = callEndTimeStamp
from CA_Sessions
where CA_Sessions.sessionId = callAnalysis.sessionId and
callAnalysis.callDisconnectTimeStamp is NULL
drop table #DisconnectTime,#DisconnTimeGSM,#DisconnTimeUMTS
if @debug=1
BEGIN
PRINT 'Start,end, duration calculation finished. Duration: ' + CONVERT(varcha
r,DateDiff(s,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- check for Layer 3 Messages
-- [Layer3Messages] [int] NULL
--------------------------------------------------------------------------------
------------------------
Update CallAnalysis
set Layer3Messages = 1
where
Technology in ('CDMA','IS13','UMTS','GSM','AMPS','SMR','AMPS/IS13') and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
Update CallAnalysis
set Layer3Messages = 1
from
MsgGSMReport d,
CA_Sessions c
where
CallAnalysis.sessionID = d.sessionID and
startTechnology like 'GS%' and
c.sessionID = d.sessionID
Update CallAnalysis
set Layer3Messages = 1
from
WCDMARRCMessages d,
CA_Sessions c
where
CallAnalysis.sessionID = d.sessionID and
--startTechnology like 'UMTS%' and -- Qualcomm phones are sometimes G
SM errorneously
c.sessionID = d.sessionID
Update CallAnalysis
set Layer3Messages = 1
from
MsgCDMALayer3 d,
CA_Sessions c
where
CallAnalysis.sessionID = d.sessionID and
Technology in ('CDMA','AMPS/CDMA') and
c.sessionID = d.sessionID
UPDATE callAnalysis
SET Layer3Messages = 0
where Layer3Messages IS NULL and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
if @debug=1
BEGIN
PRINT 'Layer 3 check finished. Duration: ' + CONVERT(varchar,DateDiff(s,@time
,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- calculate the signaling channel assignment time, end time and duraton for eac
h session setup
-- [SgnChnReq] [datetime] NULL ,
-- [SgnChnAss] [datetime] NULL ,
-- [alertTimeStamp] [datetime] NULL ,
-- [connAckTimeStamp] [datetime] NULL ,
-- [callSetupEndTimeStamp] [datetime] NULL
--------------------------------------------------------------------------------
------------------------
DECLARE @t as datetime
select
k.sessionID,
max(k.KPIID)as KPIID,
sum(case when k.KPIStatus = 'Successful' then 1 else 0 end) as Status,
max(callstatus)as callStatus,
min(k.StartTime) as Starttime,
min(k.EndTime) as EndTime,
max(k.EndTime) as MaxEndTime,
dateDiff(ms,min(k.EndTime),max(k.EndTime))as Duration
into #SetupTimes
from
vResultsKPI k,
callAnalysis a,
CA_Sessions c
where
c.sessionID = a.sessionID and
a.sessionID = k.sessionID and
(KPIID = 15700 or KPIID = 16000)
group by
k.sessionID,
k.KPIID
order by
k.sessionID
Update callAnalysis
set
SgnChnReq = startTime,
SgnChnAss = endTime,
StartTechnology = case when KPIID = 15700
then 'GSM'
else 'UMTS' end
from
#SetupTimes s
where
callAnalysis.sessionID = s.sessionID

Update callAnalysis
Set StartTechnology = Technology
where Technology in ('CDMA','IS13','AMPS','SWR') and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
Update callAnalysis
Set StartTechnology = substring(n.technology,1,4) --'AMPS'
from
callanalysis a,
networkinfo n,
markers m,
CA_Sessions c
where
c.sessionID = m.sessionID and
c.sessionID = a.sessionID and
a.Technology = 'AMPS/IS13' and
m.networkID = n.networkID and
m.MarkerText = 'Dial'
Update callAnalysis
Set StartTechnology = substring(n.technology,1,4) --'AMPS'
from
callanalysis a,
networkinfo n,
markers m,
CA_Sessions c
where
c.sessionID = m.sessionID and
c.sessionID = a.sessionID and
a.Technology = 'AMPS/CDMA' and
m.networkID = n.networkID and
m.MarkerText = 'Dial'
--'AMPS/IS13','AMPS/CDMA')

drop table #SetupTimes
-- this time indicates the end of the call setup phase
-- it is equal to CONNACK in successful case, otherwise it is the
-- time of the call termination
UPDATE callAnalysis
Set callSetupEndTimeStamp = case
when ConnAckTimeStamp IS NULL then callDisconnectTimeStamp
else ConnAckTimeStamp end
from CA_Sessions
where CA_Sessions.sessionId = callAnalysis.SessionId
if @debug=1
BEGIN
PRINT 'Setup calculation finished. Duration: ' + CONVERT(varchar,DateDiff(s,@
time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- Counts the number of samples for each direction
-- [NumUlSamples] [int] NULL,
-- [NumDlSamples] [int] NULL,
--------------------------------------------------------------------------------
------------------------
select t.sessionId, t.direction, count(t.sampleId) as sampleCount
into #tmp3
from TestInfo t,CA_Sessions
where CA_Sessions.sessionId = t.SessionId
group by t.SessionId, t.direction
Update callAnalysis
SET NumUlSamples = #tmp3.sampleCount
from callAnalysis, #tmp3
where #tmp3.sessionId = callAnalysis.sessionId AND
direction = 'A->B' AND
callAnalysis.SessionId = #tmp3.SessionId
Update callAnalysis
SET NumDlSamples = #tmp3.sampleCount
from callAnalysis, #tmp3
where #tmp3.sessionId = callAnalysis.sessionId AND
direction = 'B->A' AND
callAnalysis.SessionId = #tmp3.SessionId
drop table #tmp3
UPDATE callAnalysis
SET numDLSamples = 0
from CA_Sessions
where numDLSamples is NULL AND
callAnalysis.SessionId = CA_Sessions.sessionId
UPDATE callAnalysis
SET numULSamples = 0
from CA_Sessions
where numULSamples is NULL AND
callAnalysis.SessionId = CA_Sessions.sessionId
if @debug=1
BEGIN
PRINT 'NumOfSamples calculation finished. Duration: ' + CONVERT(varchar,DateD
iff(s,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- DISCONNECT Direction
-- If it is a DL Disconnect normally the network release the call
-- [disconDirection] [varchar] (100) COLLATE Latin1_General_CI_AS NULL,
-- [disconClass] [varchar] (100) COLLATE Latin1_General_CI_AS NULL,
-- [disconCause] [varchar] (100) COLLATE Latin1_General_CI_AS NULL,
-- [disconLocation] [varchar] (100) COLLATE Latin1_General_CI_AS NULL,
--------------------------------------------------------------------------------
------------------------
Update callAnalysis
Set disconDirection = SUBSTRING(d.message, 1, 1),
disconClass = ( Select g.class
from GSML3Causes g
where g.CauseValue=(dbo.HexToInt(SUBSTRING(d.message,1
2,2)) & 0x7F)),
disconCause = ( Select g.cause
from GSML3Causes g
where g.CauseValue=(dbo.HexToInt(SUBSTRING(d.message,1
2,2)) & 0x7F)),
disconLocation = (Select g.Location
from GSML3Locations g
where g.LocValue=(dbo.HexToInt(SUBSTRING(d.message,10,
2)) & 0x0F))
from callAnalysis c, msgGsmData d, CA_Sessions
where CA_Sessions.SessionId = c.SessionId AND
c.SessionId = d.sessionId AND
d.parseCode = '626' AND -- GSM L3
SUBSTRING(d.message, 5, 1) = '3' AND -- CC
dbo.GetL3MsgType(d.message) = '25' -- msgType = '25' (Disconnect)
if @debug=1
BEGIN
PRINT 'Discon Cause calculation finished. Duration: ' + CONVERT(varchar,DateD
iff(s,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- determines the technology at the end of the call
-- [EndTechnology][varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
--------------------------------------------------------------------------------
------------------------
Update callAnalysis
Set EndTechnology = Technology
where Technology in ('CDMA','IS13','UMTS','GSM','AMPS','SMR') and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
Update callAnalysis
Set EndTechnology = substring(n.Technology,1,4) --'CDMA'
from NetworkInfo n,
callAnalysis a,
markers m,
CA_Sessions c
where
c.sessionID = m.sessionID and
c.sessionID = a.sessionID and
a.Technology = 'AMPS/CDMA' and
m.networkID = n.networkID and
((m.MarkerText = 'CallTerminated') or
(m.MarkerText = 'Disconnect')or (m.MarkerText = 'Break'))
Update callAnalysis
Set EndTechnology = substring(n.Technology,1,4) --'IS13'
from NetworkInfo n,
callAnalysis a,
markers m,
CA_Sessions c
where
c.sessionID = m.sessionID and
c.sessionID = a.sessionID and
a.Technology = 'AMPS/IS13' and
m.networkID = n.networkID and
((m.MarkerText = 'CallTerminated') or
(m.MarkerText = 'Disconnect')or (m.MarkerText = 'Break'))
select
g.sessionID,
n.technology as EndTechnology,
min(g.msgTime) as metTime
into #endtech1
from
NetworkInfo n,
Markers g,
CA_Sessions c,callanalysis
where c.sessionID = callanalysis.sessionID and
c.sessionID = g.sessionID and
g.networkID = n.networkID and
callAnalysis.Technology not in ('CDMA','IS13','UMTS','GSM','AMPS','SMR')
and
((g.MarkerText = 'CallTerminated') or
(g.MarkerText = 'Disconnect')or (g.MarkerText = 'Break'))
group by
g.sessionID,
n.technology
order by
g.sessionID
select
a.sessionID,
case when (max(g.msgTime) > max(w.msgTime)) and (min(g.FormatID) = 'DEDI
CATED') and (max(g.msgTime) <= max(a.callDisconnectTimeStamp))
then max(g.msgTime)
else max(w.msgTime) end as MsgTime,
min(g.FormatID) as FormatID,
case when (max(g.msgTime) > max(w.msgTime)) and (min(g.FormatID) = 'DEDI
CATED') and (max(g.msgTime) <= max(a.callDisconnectTimeStamp))
then 'GSM'
else 'UMTS' end as EndTechnology
into #EndTechnology
from
CA_Sessions c
JOIN CallAnalysis a ON a.SessionId = c.SessionId
JOIN WCDMARRCState w ON w.SessionId = a.SessionId
LEFT JOIN MsgGSMLayer1 g ON g.sessionID = w.sessionID
where
w.RRCState = 1 and
a.callstatus = 'Dropped' and
a.band like 'RAT%' --and
--EndTechnology is NULL
group by
a.sessionID
Update callAnalysis
Set EndTechnology = #EndTech1.EndTechnology
from #EndTech1
where callAnalysis.sessionID = #EndTech1.sessionID
Update callAnalysis
Set EndTechnology = #EndTechnology.EndTechnology
from #EndTechnology
where callAnalysis.sessionID = #EndTechnology.sessionID
drop table #EndTechnology
drop table #EndTech1
if @debug=1
BEGIN
PRINT 'End technology calculation finished. Duration: ' + CONVERT(varchar,Dat
eDiff(s,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- counts call clearing messages
-- [numDisconnect] [int] NULL ,
-- [numRelease] [int] NULL ,
-- [numRelCmpl] [int] NULL ,
-- [numChnRel] [int] NULL ,
-- [numRRCConnRel] [int] NULL ,
--------------------------------------------------------------------------------
------------------------
select
e.sessionID,
sum(case when (d.Msg = 'Disconnect') then 1 else 0 end) As Disconnect,
sum(case when (d.Msg = 'Release') then 1 else 0 end) As Release,
sum(case when (d.Msg = 'Release Complete') then 1 else 0 end) As RelCmpl
into #callClearingGen
from vmsgGSML3Data d,callAnalysis e,CA_Sessions
where CA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.callStatus in ('Dropped','Failed')
group by
e.sessionID
select
e.sessionID,
sum(case when (d.Msg = 'Channel Release') and (d.msgTime <= callDisconne
ctTimeStamp) then 1 else 0 end) As ChnRel
into #callClearingGSM
from vmsgGSML3Data d,callAnalysis e,CA_Sessions
where CA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.EndTechnology = 'GSM' and
e.callStatus in ('Dropped','Failed')
group by
e.sessionID
select
e.sessionID,
sum(case when (d.MsgType = 'RRCConnectionRelease') and (d.msgTime <= cal
lDisconnectTimeStamp) then 1 else 0 end) As RRCConnRel,
max(case when (d.MsgType = 'RRCConnectionRelease') and (d.msgTime <= cal
lDisconnectTimeStamp) then d.MsgTime else NULL end) As RRCConnRelTime
into #callClearingUMTS
from WCDMARRCMessages d,callAnalysis e,CA_Sessions
where CA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.EndTechnology = 'UMTS' and
e.callStatus in ('Dropped','Failed')
group by e.sessionID
order by e.sessionID
select
e.sessionID,
sum(case when (d.MsgType = 'Mobile Station Release Order') and (d.msgTim
e < callDisconnectTimeStamp) then 1 else 0 end) As MobileRelease,
sum(case when (d.MsgType = 'Base Station Release Order') and (d.msgTime
< callDisconnectTimeStamp) then 1 else 0 end) As BTSRelease
into #callClearingCDMA
from vCDMALayer3 d,callAnalysis e,CA_Sessions
where CA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.EndTechnology = 'CDMA' and
e.callStatus in ('Dropped','Failed')
group by e.sessionID
order by e.sessionID
Update CallAnalysis
set numDisconnect = Disconnect,
numRelease = Release,
numRelCmpl = RelCmpl
from #callClearingGen
where #callClearingGen.sessionID = CallAnalysis.sessionID
Update CallAnalysis
set numChnRel = ChnRel
from #callClearingGSM
where #callClearingGSM.sessionID = CallAnalysis.sessionID
Update CallAnalysis
set numRRCConnRel = RRCConnRel
from #callClearingUMTS
where #callClearingUMTS.sessionID = CallAnalysis.sessionID
Update CallAnalysis
set numCDMAReleaseOrder = BTSRelease
from #callClearingCDMA
where #callClearingCDMA.sessionID = CallAnalysis.sessionID
Update CallAnalysis Set numCDMAReleaseOrder = 0 where numCDMAReleaseOrder IS NU
LL
drop table #callClearingCDMA
drop table #callClearingUMTS
drop table #callClearingGSM
drop table #callClearingGen
if @debug=1
BEGIN
PRINT 'Call clearing count finished. Duration: ' + CONVERT(varchar,DateDiff(s
,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- Channel Release Direction and description
-- [releaseDirection] [varchar] (100) COLLATE Latin1_General_CI_AS NULL,
-- [releaseCause] [varchar] (100) COLLATE Latin1_General_CI_AS NULL,
--------------------------------------------------------------------------------
------------------------
Update CallAnalysis
set ReleaseCause = ''
from CallAnalysis
where numChnRel <> 0 or numRRCConnRel <> 0
select
c.sessionID,
SUBSTRING(d.message, 1, 1) as releaseDirection,
case SUBSTRING(d.message,8,2)
when '00' then 'Normal event'
when '01' then 'Abnormal release, unspecified'
when '02' then 'Abnormal release, channel unacceptable'
when '03' then 'Abnormal release, timer expired'
when '04' then 'Abnormal release, no activity on the radio path'
when '05' then 'Preemptive release'
when '06' then 'UTRAN configuration unknown'
when '08' then 'Handover impossible, timing advance out of range'
when '09' then 'Channel mode unacceptable'
when '0A' then 'Frequency not implemented'
when '0C' then 'Lower layer failure'
when '41' then 'Call already cleared'
when '5F' then 'Semantically incorrect message'
when '60' then 'Invalid mandatory information'
when '61' then 'Message type non-existent or not implemented'
when '62' then 'Message type not compatible with protocol state'
when '64' then 'Conditional IE error'
when '65' then 'No cell allocation available'
when '6F' then 'Protocol error unspecified'
else 'Normal event'
end as RelCause
into #relcause
from callAnalysis c, msgGsmData d, CA_Sessions
where CA_Sessions.SessionId = c.SessionId AND
c.callStatus in ('Dropped','Failed') AND
c.SessionId = d.sessionId AND
numChnRel <> 0 and
d.parseCode = '626' AND -- GSM L3
SUBSTRING(d.message, 5, 1) = '6' AND -- RR
dbo.GetL3MsgType(d.message) = '0D' -- msgType = '0D' (Release)
Update CallAnalysis
set ReleaseCause = RelCause
from #relcause
where #relcause.sessionID = CallAnalysis.sessionID
drop table #relcause
if @debug=1
BEGIN
PRINT 'Channel Release Cause. Duration: ' + CONVERT(varchar,DateDiff(s,@time,
GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- calculates the avg values for different Quality relevant values at the end of
a call
--
-- [avgRxQual] [real] NULL ,
-- [avgRxLev] [real] NULL ,
-- [avgTA] [real] NULL ,
-- [avgMsTxPwr] [real] NULL ,
-- [avgBCCHRxLev] [real] NULL ,
-- [numOfRadioValues] [int] NULL,
-- [LastRadioTimeStamp] [datetime] NULL,
-- [avgTotEcIo] [real] NULL ,
-- [avgUETxPwr] [real] NULL ,
-- [avgUERxPwr] [real] NULL ,
-- [numOfWCDMARadioValues] [int] NULL ,
-- [LastWCDMARadioTimeStamp] [datetime] NULL ,
-- [avgCDMAFER] [real] NULL ,
-- [avgCDMATotEcIo] [real] NULL ,
-- [avgCDMATxPwr] [real] NULL ,
-- [avgCDMAAGC] [real] NULL ,
-- [numOfCDMARadioValues] [int] NULL ,
-- [LastCDMARadioTimeStamp] [datetime] NULL ,
-- [avgTDMABER] [real] NULL ,
-- [avgTDMARxLev] [real] NULL ,
-- [avgTDMATxLev] [real] NULL ,
-- [avgTDMATA] [real] NULL ,
-- [numOfTDMARadioValues] [int] NULL ,
-- [LastTDMARadioTimeStamp] [datetime] NULL ,

--------------------------------------------------------------------------------
------------------------
SELECT
g.MsgId,
g.MsgTime,
g.SessionID
into #tempgsm
FROM
msgGSMLayer1 g ,
CA_Sessions,
CallAnalysis a
WHERE
g.sessionId = CA_Sessions.SessionId
and a.sessionID = g.sessionID
AND a.callDisconnectTimeStamp > g.msgTime
and dateadd(s,-20,a.callDisconnectTimeStamp) < g.msgTime
ORDER BY
msgId DESC
SELECT
a.sessionID,
max(msgGSMLayer1.msgTime) AS LastTimeStamp,
count(msgGSMLayer1.msgId) AS numOfValues,
avg(convert(real,RxQualSub)) AS AvgRxQual,
avg(convert(real,RxLevSub)) AS AvgRxLev,
avg(convert(real,TA)) AS AvgTA,
avg(convert(real,TxPwr)) AS AvgMsTxPwr,
avg(convert(real,BCCH_RxLev)) AS AvgBCCHRxLev
INTO #Tmp20
FROM msgGSMLayer1,
callanalysis a,
CA_Sessions
WHERE
CA_Sessions.SessionId = msgGsmLayer1.SessionId AND
a.sessionID = msgGSMLayer1.sessionID AND
a.EndTechnology like 'GSM%' AND
a.CallStatus in ('Dropped','Failed') AND
--DateDiff(s,msgGSMLayer1.msgTime,a.callDisconnectTimeStamp) < 8 and
--DateDiff(s,msgGSMLayer1.msgTime,a.callDisconnectTimeStamp) > 0
msgGSMLayer1.msgId IN ( SELECT TOP 8 msgId
FROM #tempgsm g
WHERE g.sessionId = a.Se
ssionId)
/* (SELECT TOP 8 msgId
FROM msgGSMLayer1 g
WHERE g.sessionId = CA_Sessions.SessionId AND
-- ??AND RxQualSub IS NOT NULL
--formatID = 'DEDICATED'
a.callDisconnectTimeStamp > g.msgTime
ORDER BY msgId DESC)
*/
GROUP BY a.sessionID
ORDER BY a.sessionID
UPDATE callAnalysis
SET
LastRadioTimeStamp = #Tmp20.LastTimeStamp,
numOfRadioValues = #Tmp20.numOfValues,
AvgRxQual = #Tmp20.AvgRxQual,
AvgRxLev = #Tmp20.AvgRxLev,
AvgTA = #Tmp20.AvgTA,
AvgMsTxPwr = #Tmp20.AvgMsTxPwr,
AvgBCCHRxLev = #Tmp20.AvgBCCHRxLev
FROM callAnalysis, #tmp20
WHERE --@sessionId = callAnalysis.sessionId AND
callAnalysis.sessionId = #tmp20.sessionId
---- WCDMA AGC
SELECT
g.MsgId,
g.MsgTime,
g.SessionID
into #tempagc
FROM
WCDMAAGC g ,
CA_Sessions,
CallAnalysis a
WHERE
g.sessionId = CA_Sessions.SessionId
and a.sessionID = g.sessionID
AND a.callDisconnectTimeStamp > g.msgTime
and dateadd(s,-20,a.callDisconnectTimeStamp) < g.msgTime
ORDER BY
msgId DESC
SELECT
a.sessionID,
max(WCDMAAGC.msgTime) AS LastTimeStamp,
count(WCDMAAGC.msgId) AS numOfValues,
avg(convert(real,TxPwr)) AS avgUETxPwr,
avg(convert(real,RxPwr)) AS avgUERxPwr
INTO #Tmp21
FROM WCDMAAGC,
callanalysis a,
CA_Sessions
WHERE CA_Sessions.SessionId = WCDMAAGC.SessionId AND
a.sessionID = WCDMAAGC.sessionID AND
a.EndTechnology = 'UMTS' AND
a.CallStatus in ('Dropped','Failed') AND
--DateDiff(s,WCDMAAGC.msgTime,a.callDisconnectTimeStamp) < 5 and #tempa
gc
--DateDiff(s,WCDMAAGC.msgTime,a.callDisconnectTimeStamp) > 0
WCDMAAGC.msgId IN ( SELECT TOP 8 msgId
FROM #tempagc g
WHERE g.sessionId = a.SessionId)
/* (SELECT TOP 8 msgId
FROM WCDMAAGC g
WHERE g.sessionId = CA_Sessions.SessionId AND
-- ??AND RxQualSub IS NOT NULL
a.callDisconnectTimeStamp > g.msgTime
ORDER BY msgId DESC)
*/
GROUP BY a.sessionID
ORDER BY a.sessionID
--------
SELECT
g.MsgId,
g.MsgTime,
g.SessionID
into #tempbler
FROM
WCDMABLER g ,
CA_Sessions,
CallAnalysis a
WHERE
g.sessionId = CA_Sessions.SessionId
and a.sessionID = g.sessionID
AND a.callDisconnectTimeStamp > g.msgTime
and dateadd(s,-20,a.callDisconnectTimeStamp) < g.msgTime
ORDER BY
msgId DESC
SELECT
a.sessionID,
avg(CASE WHEN (crcRec) > 0 then (convert(real,CRCError)/convert(real,CRC
Rec))ELSE 0 END)*100 AS AvgBLER
INTO #Tmp22
FROM WCDMABLER,
callanalysis a,
CA_Sessions
WHERE CA_Sessions.SessionId = WCDMABLER.SessionId AND
a.sessionID = WCDMABLER.sessionID AND
a.EndTechnology = 'UMTS' AND
a.CallStatus in ('Dropped','Failed') AND
--DateDiff(s,WCDMABLER.msgTime,a.callDisconnectTimeStamp) < 5 and
--DateDiff(s,WCDMABLER.msgTime,a.callDisconnectTimeStamp) > 0
WCDMABLER.msgId IN( SELECT TOP 4 msgId
FROM #tempbler g
WHERE g.sessionId = a.SessionI
d)
GROUP BY a.sessionID
ORDER BY a.sessionID
---------
SELECT
g.MsgId,
g.MsgTime,
g.SessionID
into #tempecio
FROM
WCDMAActiveSet g ,
CA_Sessions,
CallAnalysis a
WHERE
g.sessionId = CA_Sessions.SessionId
and a.sessionID = g.sessionID
AND a.callDisconnectTimeStamp > g.msgTime
and dateadd(s,-20,a.callDisconnectTimeStamp) < g.msgTime
ORDER BY
msgId DESC
SELECT
a.sessionID,
avg(AggrEcIo) AS AvgTotEcIo,
max(a.callDisconnectTimeStamp) as callDisconnectTimeStamp
INTO #Tmp23
FROM WCDMAActiveSet,
callanalysis a,
CA_Sessions
WHERE CA_Sessions.SessionId = WCDMAActiveSet.SessionId AND
a.sessionID = WCDMAActiveSet.sessionID AND
a.EndTechnology = 'UMTS' AND
a.CallStatus in ('Dropped','Failed') AND
-- DateDiff(s,WCDMAActiveSet.msgTime,a.callDisconnectTimeStamp) < 3 and
-- DateDiff(s,WCDMAActiveSet.msgTime,a.callDisconnectTimeStamp) > 0
WCDMAActiveSet.msgId IN (SELECT TOP 8 msgId
FROM #tempecio g
WHERE g.sessionId = a.SessionId)
--ORDER BY msgId DE
SC
GROUP BY a.sessionID
ORDER BY a.sessionID
UPDATE callAnalysis
SET
LastWCDMARadioTimeStamp = #Tmp21.LastTimeStamp,
numOfWCDMARadioValues = #Tmp21.numOfValues,
AvgUETxPwr = #Tmp21.AvgUETxPwr,
AvgUERxPwr = #Tmp21.AvgUERxPwr
FROM callAnalysis, #tmp21
WHERE --@sessionId = callAnalysis.sessionId AND
callAnalysis.sessionId = #tmp21.sessionId
UPDATE callAnalysis
SET AvgBLER = #Tmp22.AvgBLER
FROM callAnalysis, #tmp22
WHERE --@sessionId = callAnalysis.sessionId AND
callAnalysis.sessionId = #tmp22.sessionId
UPDATE callAnalysis
SET AvgTotEcIo = #Tmp23.AvgTotEcIo
FROM callAnalysis, #tmp23
WHERE --@sessionId = callAnalysis.sessionId AND
callAnalysis.sessionId = #tmp23.sessionId
SELECT
g.MsgId,
g.MsgTime,
g.SessionID
into #temptotecio
FROM
CDMAFingerInfo g ,
CA_Sessions,
CallAnalysis a
WHERE
g.sessionId = CA_Sessions.SessionId
and a.sessionID = g.sessionID
AND a.callDisconnectTimeStamp > g.msgTime
and dateadd(s,-20,a.callDisconnectTimeStamp) < g.msgTime
ORDER BY
msgId DESC
SELECT
a.sessionID,
max(CDMAFingerInfo.msgTime) AS LastTimeStamp,
count(CDMAFingerInfo.msgId) AS numOfValues,
avg(TotalEcIo) AS CDMATotEcIo,
avg(RxAGC) AS CDMARxAGC,
avg(TxAGC) AS CDMATxPwr
INTO #Tmp24
FROM
callanalysis a,
CDMAFingerInfo,
CA_Sessions
WHERE
CA_Sessions.SessionId = CDMAFingerInfo.SessionId AND
a.sessionID = CDMAFingerInfo.sessionID AND
a.Technology = 'CDMA' AND
a.CallStatus in ('Dropped','Failed') AND
CDMAFingerInfo.msgId IN (SELECT TOP 8 msgId
FROM #temptotecio g
WHERE g.sessionId = a.SessionId)
/* (SELECT TOP 8 msgId
FROM CDMAFingerInfo g
WHERE g.sessionId = CA_Sessions.SessionId
ORDER BY msgId DESC)
*/
GROUP BY a.sessionID
ORDER BY a.sessionID
SELECT
e.sessionID,
avg( case when (b.tffch-a.tffch) <> 0.0
then (cast((b.bffch - a.bffch)AS float)/cast((b.tffch-a.tffch) A
S float))*100
else NULL end) AS CDMAFER
INTO #Tmp25
FROM
callanalysis e,
CDMAFER a,
CDMAFER b,
CA_Sessions
WHERE
CA_Sessions.SessionId = e.SessionId AND
e.sessionID = b.sessionID AND
e.sessionID = a.sessionID AND
e.Technology = 'CDMA' AND
e.CallStatus in ('Dropped','Failed') AND
b.msgID = a.msgID + 1 AND
DateDiff(s,b.msgTime,e.callDisconnectTimeStamp) < 10 AND
DateDiff(s,b.msgTime,e.callDisconnectTimeStamp) > 0
GROUP BY e.sessionID
ORDER BY e.sessionID
UPDATE callAnalysis
SET
LastCDMARadioTimeStamp = #Tmp24.LastTimeStamp,
numOfCDMARadioValues = #Tmp24.numOfValues,
AvgCDMATotEcIo = #Tmp24.CDMATotEcIo,
AvgCDMATxPwr = #Tmp24.CDMATxPwr,
AvgCDMAAGC = #Tmp24.CDMARxAGC
FROM callAnalysis, #tmp24
WHERE
callAnalysis.sessionId = #tmp24.sessionId
UPDATE callAnalysis
SET
AvgCDMAFER = #Tmp25.CDMAFER
FROM callAnalysis, #tmp25
WHERE
callAnalysis.sessionId = #tmp25.sessionId
SELECT
a.sessionID,
max(msgIS136Report.msgTime) AS LastTDMATimeStamp,
count(msgIS136Report.msgId) AS numOfTDMAValues,
avg(convert(real,BER)) AS TDMABER,
avg(convert(real,RxLev)) AS TDMARxLev,
avg(convert(real,TA)) AS TDMATA,
avg(convert(real,TxPwr)) AS TDMATxPwr
INTO #Tmp26
FROM msgIS136Report,
callanalysis a,
CA_Sessions
WHERE CA_Sessions.SessionId = msgIS136Report.SessionId AND
a.sessionID = msgIS136Report.sessionID AND
a.EndTechnology like 'IS13%' AND
a.CallStatus in ('Dropped','Failed') AND
msgIS136Report.msgId IN (SELECT TOP 8 msgId
FROM msgIS136Report g
WHERE g.sessionId = CA_Sessions.SessionId AND
stateType = 'dedicated'
ORDER BY msgId DESC)
GROUP BY a.sessionID
UPDATE callAnalysis
SET
NumOfTDMARadioValues = #tmp26.numOfTDMAValues,
LastTDMARadioTimeStamp = #tmp26.LastTDMATimeStamp,
AvgTDMABER = #Tmp26.TDMABER,
AvgTDMARxLev = #Tmp26.TDMARxLev,
AvgTDMATxLev = #Tmp26.TDMATxPwr,
AvgTDMATA = #Tmp26.TDMATA
FROM callAnalysis, #tmp26
WHERE
callAnalysis.sessionId = #tmp26.sessionId
drop table #Tmp20
drop table #Tmp21
drop table #Tmp22
drop table #Tmp23
drop table #Tmp24
drop table #Tmp25
drop table #Tmp26
drop table #tempgsm
drop table #tempecio
drop table #tempbler
drop table #tempagc
drop table #temptotecio
if @debug=1
BEGIN
PRINT 'Call Quality at end finished. Duration: ' + CONVERT(varchar,DateDiff(s
,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- detects No Service or Scanning
-- [NoService] [int] NULL ,
--------------------------------------------------------------------------------
------------------------
select
t.sessionID,
sum(case when t.info like '%SCANNING' then 1 else 0 end) as initialize,
sum(case when t.info like '%NO_SERVICE' then 1 else 0 end) as no_service
,
max(case when t.info like '%SCANNING' then t.msgTime else NULL end) as S
canTime
into #NoService
from
MsgLogTrace t,
callanalysis a,
CA_Sessions c
where
c.sessionID = a.sessionID and
a.callstatus in ('Dropped','Failed') and
a.sessionId = t.sessionID
group by
t.sessionID
Update CallAnalysis
set NoService = no_service,
Initializing = initialize
from #NoService
where callAnalysis.sessionID = #NoService.sessionID
drop table #NoService
if @debug=1
BEGIN
PRINT 'No Service detection. Duration: ' + CONVERT(varchar,DateDiff(s,@time,G
etDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- detects dropped because of RLC counter expired
-- [RLCexp] [int] NULL ,
--------------------------------------------------------------------------------
------------------------
select
g.MsgID,
g.sessionID
into #RLCounter
from
MsgGSMData g,
callanalysis a,
CA_Sessions c
where
a.callstatus in ('Dropped','Failed') and
--a.EndTechnology = 'GSM' and
a.sessionId = g.sessionID and
g.parseCode = '624' and
substring(g.message,3,2) = '01' and
c.sessionID = a.sessionID
select
g.msgID,
g.sessionID
into #RLCExpired
from
MsgGSMData g,
#RLCounter r
where
(substring(g.message,3,2) > '10' or
substring(g.message,3,2) = '00')and
g.parseCode = '624' and
g.msgID = (select min(m.msgID)
from MsgGSMData m
where m.sessionID = r.sessionID and
m.parseCode = '624' and
r.msgID< m.msgID)
Update CallAnalysis
set RLCexp = 1
from #RLCExpired
where callAnalysis.sessionID = #RLCExpired.sessionID
drop table #RLCounter
drop table #RLCExpired
if @debug=1
BEGIN
PRINT 'RLC Counter calculation. Duration: ' + CONVERT(varchar,DateDiff(s,@tim
e,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- detects the last Handover/assignment message
-- [LastHoTimeStamp] [datetime] NULL,
-- [LastHoType] [varchar] (100) COLLATE Latin1_General_CI_AS NULL,
-- [LastHoCause] [varchar] (100) COLLATE Latin1_General_CI_AS NULL,
--------------------------------------------------------------------------------
------------------------
select a.sessionID,
max(msgId) as maxmsg
into #lastHOMessage
from MsgGsmData d,
callanalysis a,
CA_Sessions s
where dbo.GetL3MsgType(message) in ('2E','2F','2B','28','2C','29','63') -- 2
C=HOCMPL, 28=HOFail, 2F=AssFail, 29=AssCmpl, 63=2G->3G
AND a.sessionId = s.sessionID
AND d.sessionId = a.sessionId AND
SUBSTRING(message, 5, 1) = '6' AND -- RR
parseCode = '626' and
a.callstatus in ('Dropped','Failed') and
a.Endtechnology = 'GSM'
group by
a.sessionID
if @debug=1
BEGIN
PRINT 'Last HO Message calculated. Duration: ' + CONVERT(varchar,DateDiff(s,@
time,GetDate())) + ' sec'
Select @time = GetDate()
END
UPDATE callAnalysis
set LastHoTimeStamp = d.MsgTime,
LastHoType = case
when SUBSTRING(d.message, 6, 2)='2B' then 'HO_CMD'
when SUBSTRING(d.message, 6, 2)='2C' then 'HO_CMPL'
when SUBSTRING(d.message, 6, 2)='28' then 'HO_FAIL'
when SUBSTRING(d.message, 6, 2)='2E' then 'ASS_CMD'
when SUBSTRING(d.message, 6, 2)='29' then 'ASS_CMPL'
when SUBSTRING(d.message, 6, 2)='2F' then 'ASS_FAIL'
when SUBSTRING(d.message, 6, 2)='63' then 'HO_IRAT' end,
LastHoCause = 'Normal event'
from callAnalysis e,
#lastHOMessage t,
MsgGSMData d
where e.sessionId = t.sessionId and
d.sessionID = e.sessionID and
t.maxmsg = d.msgID
if @debug=1
BEGIN
PRINT 'Last HO updated. Duration: ' + CONVERT(varchar,DateDiff(s,@time,GetDat
e())) + ' sec'
Select @time = GetDate()
END
select v.SessionId,
v.MsgTime,
g.msg,
dbo.GetL3MsgType(v.message) COLLATE Latin1_General_CI_AS as MsgType,
substring(SUBSTRING(v.message, 8, 300), 1, 2) as CauseValue,
case substring(SUBSTRING(v.message, 8, 300), 1, 2)
when '00' then 'Normal event'
when '01' then 'Abnormal release, unspecified'
when '02' then 'Abnormal release, channel unacceptable'
when '03' then 'Abnormal release, timer expired'
when '04' then 'Abnormal release, no activity on the radio path'
when '05' then 'Preemptive release'
when '08' then 'Handover impossible, timing advance out of range'
when '09' then 'Channel mode unacceptable'
when '0A' then 'Frequency not implemented'
when '0C' then 'Lower layer failure'
when '41' then 'Call already cleared'
when '5F' then 'Semantically incorrect message'
when '60' then 'Invalid mandatory information'
when '61' then 'Message type non-existent or not implemented'
when '62' then 'Message type not compatible with protocol state'
when '64' then 'Conditional IE error'
when '65' then 'No cell allocation available'
when '6F' then 'Protocol error unspecified'
end as Cause
into #tmpHo
from MsgGsmData v,
GSML3Messages g,
callanalysis a,
#lastHOMessage h
where v.sessionID = a.sessionID AND
h.sessionID = a.sessionID and
v.msgId = h.maxmsg and
(SUBSTRING(v.message, 5, 1) = g.ProtDiscr) AND
dbo.GetL3MsgType(v.message) = g.MsgType AND
(g.MsgType in ('2F','2B','28') or
(g.MsgType in ('2C','29','2E') and SUBSTRING(v.message, 8, 2) <> '00'))
if @debug=1
BEGIN
PRINT 'Last HO cause calculated. Duration: ' + CONVERT(varchar,DateDiff(s,@ti
me,GetDate())) + ' sec'
Select @time = GetDate()
END
UPDATE callAnalysis
set LastHoCause = t.cause
from callAnalysis e,
#tmpHO t
where e.sessionId = t.sessionId
if @debug=1
BEGIN
PRINT 'Last HO cause updated. Duration: ' + CONVERT(varchar,DateDiff(s,@time,
GetDate())) + ' sec'
Select @time = GetDate()
END
SELECT e.SessionId,
e.callSetupEndTimeStamp
INTO #tmpCallsASS
FROM callAnalysis e, CA_Sessions
WHERE e.SessionId = CA_Sessions.sessionId AND
e.callstatus in ('Dropped','Failed') AND
e.Endtechnology = 'GSM'
UPDATE callAnalysis
set LastAssTimeStamp = rr.MsgTime,
LastAssMsg = case
when rr.msgType='2B' then 'ASS_CMD'
when rr.msgType='29' then 'ASS_CMPL'
when rr.msgType='2F' then 'ASS_FAIL' end,
LastAssCause = case
when substring(v.l3data, 1, 2) = '00' then 'Normal event'
when substring(v.l3data, 1, 2) = '01' then 'Abnormal release, unspecifi
ed'
when substring(v.l3data, 1, 2) = '02' then 'Abnormal release, channel u
nacceptable'
when substring(v.l3data, 1, 2) = '03' then 'Abnormal release, timer exp
ired'
when substring(v.l3data, 1, 2) = '04' then 'Abnormal release, no activi
ty on the radio path'
when substring(v.l3data, 1, 2) = '05' then 'Preemptive release'
when substring(v.l3data, 1, 2) = '08' then 'Handover impossible, timing
advance out of range'
when substring(v.l3data, 1, 2) = '09' then 'Channel mode unacceptable'
when substring(v.l3data, 1, 2) = '0A' then 'Frequency not implemented'
when substring(v.l3data, 1, 2) = '41' then 'Call already cleared'
when substring(v.l3data, 1, 2) = '5F' then 'Semantically incorrect mess
age'
when substring(v.l3data, 1, 2) = '60' then 'Invalid mandatory informati
on'
when substring(v.l3data, 1, 2) = '61' then 'Message type non-existent o
r not implemented'
when substring(v.l3data, 1, 2) = '62' then 'Message type not compatible
with protocol state'
when substring(v.l3data, 1, 2) = '64' then 'Conditional IE error'
when substring(v.l3data, 1, 2) = '65' then 'No cell allocation availabl
e'
when substring(v.l3data, 1, 2) = '6F' then 'Protocol error unspecified'
END
FROM vgsmrr rr, vMsgGsmL3Data v, #tmpCallsASS e
WHERE
e.SessionId = v.sessionId AND
e.SessionId = rr.SessionId AND
rr.msgId in (SELECT max(msgId)
FROM vgsmrr
WHERE msgType in ('2F','2B','29') AND -- 2F=AssFail, 2
9=AssCmpl
vgsmrr.SessionId = e.SessionId AND
vgsmrr.msgTime <= e.callSetupEndTimeStamp) AND
rr.msgId = v.msgId
DROP TABLE #tmpCallsASS
if @debug=1
BEGIN
PRINT 'Last ASS cause updated. Duration: ' + CONVERT(varchar,DateDiff(s,@time
,GetDate())) + ' sec'
Select @time = GetDate()
END
select a.sessionID,
max(msgId) as maxmsg
into #lastUMTSHOMessage
from WCDMARRCMessages d, callanalysis a,CA_Sessions
where d.MsgType in ('HandoverFromUTRANFailure','HandoverFromUTRANCommand-GSM')

AND a.sessionId = CA_Sessions.sessionID
AND d.sessionId = a.sessionId AND
a.callstatus in ('Dropped','Failed') and
a.Endtechnology = 'UMTS'
group by
a.sessionID
if @debug=1
BEGIN
PRINT 'Last 3G HO Message calculated. Duration: ' + CONVERT(varchar,DateDiff(
s,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
UPDATE callAnalysis
set LastUMTSHoTimeStamp = d.MsgTime,
LastUMTSHoType = case
when d.MsgType = 'HandoverFromUTRANFailure' then 'HO_IRAT_FAIL'
when d.MsgType = 'HandoverFromUTRANCommand-GSM' then 'HO_IRAT' e
nd,
LastUMTSCause = 'unknown'
from callAnalysis e,
#lastUMTSHOMessage t,
WCDMARRCMessages d
where e.sessionId = t.sessionId and
t.maxmsg = d.msgID
if @debug=1
BEGIN
PRINT 'Last 3G HO Message updated. Duration: ' + CONVERT(varchar,DateDiff(s,@
time,GetDate())) + ' sec'
Select @time = GetDate()
END
drop table #tmpHO
drop table #lastHOMessage
drop table #lastUMTSHOMessage
if @debug=1
BEGIN
PRINT 'Last HO/ASS calculated. Duration: ' + CONVERT(varchar,DateDiff(s,@time
,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- L3 Event Counter
-- This Query counts the relevant events (CC , MM, RR(C)) for call progress
--
-- Result stored in #callAnalysisCallProgressInfo
--------------------------------------------------------------------------------
------------------------
Select e.SessionId as sessionId,
sum(case when (d.Msg = 'CM Re-Establishment Request') then 1 else 0 end)
as CMReestablishmentRequest
into #callAnalysisCallInfoGen
from vmsgGSML3Data d,callAnalysis e,CA_Sessions
where CA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.callStatus = 'Dropped'
group by
e.SessionId
order by
e.sessionID
Select e.SessionId as sessionId,
sum(case when (d.Msg = 'CM Service Request') AND (d.MsgTime <= e.callSet
upEndTimeStamp) then 1 else 0 end) as CMServiceRequest,
sum(case when (d.Msg = 'CM Service Reject') AND (d.MsgTime <= e.callSetu
pEndTimeStamp) then 1 else 0 end) as CMServiceReject,
sum(case when (d.Msg = 'Setup') AND (d.MsgTime <= e.callSetupEndTimeStam
p) then 1 else 0 end) As Setup,
sum(case when (d.Msg = 'Call Proceeding') AND (d.MsgTime <= e.callSetupE
ndTimeStamp) then 1 else 0 end) As CallProceding,
sum(case when (d.Msg = 'Call Confirmed') AND (d.MsgTime <= e.callSetupEn
dTimeStamp) then 1 else 0 end) As CallConfirmed,
sum(case when (d.Msg = 'Progress') AND (d.MsgTime <= e.callSetupEndTimeS
tamp) then 1 else 0 end) As Progress,
sum(case when (d.Msg = 'Alerting') AND (d.MsgTime <= e.callSetupEndTimeS
tamp) then 1 else 0 end) As Alerting,
sum(case when (d.Msg = 'Connect') AND (d.MsgTime <= e.callEndTimeStamp)
then 1 else 0 end) As Conn,
sum(case when (d.Msg LIKE 'Connect Ack%') AND (d.MsgTime <= e.callEndTim
eStamp) then 1 else 0 end) As ConnAck,
sum(case when (d.Msg = 'Location Updating Request') AND (d.MsgTime <= e.
callSetupEndTimeStamp) then 1 else 0 end) As LURequest,
sum(case when (d.Msg = 'Location Updating Accept') AND (d.MsgTime <= e.c
allSetupEndTimeStamp) then 1 else 0 end) As LUAccept,
sum(case when (d.Msg = 'Location Updating Reject') AND (d.MsgTime <= e.c
allSetupEndTimeStamp) then 1 else 0 end) As LUReject
into #callAnalysisCallSetupInfoGen
from vmsgGSML3Data d,callAnalysis e,CA_Sessions
where CA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.callStatus = 'Failed'
group by
e.SessionId
order by
e.sessionID
if @debug=1
BEGIN
PRINT 'General Call Setup events count. Duration: ' + CONVERT(varchar,DateDif
f(s,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
Select e.SessionId as sessionId,
sum(case when (dbo.HexToInt(substring(message,2,2)) & 0xE0 <> 0xE0) AND
(d.MsgTime <= e.callSetupEndTimeStamp) then 1 else 0 end) as ChannelRequest -- n
o req for TBF
into #callAnalysisCallSetupChnReq
from MsgGSMData d,callAnalysis e,CA_Sessions
where CA_Sessions.sessionId = e.sessionId AND
d.parseCode = '62A' and
e.SessionId = d.SessionId AND
e.callStatus = 'Failed' AND
e.startTechnology = 'GSM'
group by
e.SessionId
Select e.SessionId as sessionId,
sum(case when (d.Msg = 'Paging Response') AND (d.MsgTime <= e.callSetupE
ndTimeStamp) then 1 else 0 end) As pageResponse,
sum(case when (d.Msg = 'Immediate Assignment') AND (d.MsgTime <= e.callS
etupEndTimeStamp) AND ((dbo.HexToInt(substring(d.L3Data,1,2)) & 0x10 = 0)) then
1 else 0 end) As ImmASS, -- Only Dedicated Channels
sum(case when (d.Msg = 'Immediate Assignment Reject') AND (d.MsgTime <=
e.callSetupEndTimeStamp) then 1 else 0 end) As ImmAssRej,
sum(case when (d.Msg = 'Assignment Command') AND (d.MsgTime <= e.callSet
upEndTimeStamp) then 1 else 0 end) As AssCmd,
sum(case when (d.Msg = 'Assignment Complete') AND (d.MsgTime <= e.callSe
tupEndTimeStamp) then 1 else 0 end) As AssCmpl,
sum(case when (d.Msg = 'Assignment Failure') AND (d.MsgTime <= e.callSet
upEndTimeStamp) then 1 else 0 end) As AssFail
into #callAnalysisCallSetupInfoGSM
from vmsgGSML3Data d,callAnalysis e,CA_Sessions
where CA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.callStatus = 'Failed' AND
e.startTechnology = 'GSM'
group by
e.SessionId
Select e.SessionId as sessionId,
sum(case when (d.KPIID = 15700) then d.Counter else 0 end) as DCCH2G,
sum(case when (d.KPIID = 15700 and d.KPIStatus = 'Successful') then 1 el
se 0 end) As DCCH2GSuccess,
sum(case when (d.KPIID = 15600) then d.Counter else 0 end) as TCH2G,
sum(case when (d.KPIID = 15600 and d.KPIStatus = 'Successful') then 1 el
se 0 end) As TCH2GSuccess,
sum(case when (d.KPIID = 16000) then d.Counter else 0 end) as DCCH3G,
sum(case when (d.KPIID = 16000 and d.KPIStatus = 'Successful') then 1 el
se 0 end) As DCCH3GSuccess,
sum(case when (d.KPIID = 15800) then d.Counter else 0 end) as TCH3G,
sum(case when (d.KPIID = 15800 and d.KPIStatus = 'Successful') then 1 el
se 0 end) As TCH3GSuccess
into #callAnalysisCallSetupInfoGSMKPI
from vResultsKPI d,callAnalysis e,CA_Sessions
where CA_Sessions.sessionId = d.sessionId AND
d.StartTime >= e.CallStartTimeStamp and
d.EndTime <= e.CallSetupendtimeStamp and
d.sessionID = e.sessionID AND
e.callStatus = 'Failed'
group by
e.SessionId
order by
e.sessionID
if @debug=1
BEGIN
PRINT 'GSM Call Setup events count. Duration: ' + CONVERT(varchar,DateDiff(s,
@time,GetDate())) + ' sec'
Select @time = GetDate()
END
Select e.sessionId as sessionId,
sum(case when (d.MsgType = 'RRCConnectionSetup') AND (d.MsgTime <= e.cal
lSetupEndTimeStamp) then 1 else 0 end) As RRCConnSetup,
sum(case when (d.MsgType = 'RRCConnectionReject') AND (d.MsgTime <= e.ca
llSetupEndTimeStamp) then 1 else 0 end) As RRCConnRej,
sum(case when (d.MsgType = 'RadioBearerSetup') AND (d.MsgTime <= e.callS
etupEndTimeStamp) then 1 else 0 end) As RBSetup,
sum(case when (d.MsgType = 'RadioBearerSetupComplete') AND (d.MsgTime <=
e.callSetupEndTimeStamp) then 1 else 0 end) As RBSetupCmpl,
sum(case when (d.MsgType = 'RadioBearerSetupFailure') AND (d.MsgTime <=
e.callSetupEndTimeStamp) then 1 else 0 end) As RBSetupFail
into #callAnalysisCallSetupInfoUMTS
from WCDMARRCMessages d,callAnalysis e,CA_Sessions
where CA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.callStatus = 'Failed'
group by
e.SessionId
if @debug=1
BEGIN
PRINT 'UMTS Call Setup events count. Duration: ' + CONVERT(varchar,DateDiff(s
,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
Select e.sessionId as sessionId,
sum(case when (d.MessageType = 'Origination Message') AND (d.MsgTime <=
e.callSetupEndTimeStamp) then 1 else 0 end) As CDMAOriginationMsg,
sum(case when (d.MessageType = 'Page Response Message') AND (d.MsgTime <
= e.callSetupEndTimeStamp) then 1 else 0 end) As CDMAPageResponse,
sum(case when (d.MessageType = 'Channel Assignment Message') AND (d.MsgT
ime <= e.callSetupEndTimeStamp) then 1 else 0 end) As CDMAChnAssMsg,
sum(case when (d.MessageType = 'Service Connect Message') AND (d.MsgTime
<= e.callSetupEndTimeStamp) then 1 else 0 end) As CDMAServiceConnect,
sum(case when (d.MessageType = 'Service Connect Completion Message') AND
(d.MsgTime <= e.callSetupEndTimeStamp) then 1 else 0 end) As CDMAServiceConnect
Cmpl
into #callAnalysisCallSetupInfoCDMA
from vCDMALayer3 d,callAnalysis e,CA_Sessions
where CA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.callStatus = 'Failed'
group by
e.SessionId
if @debug=1
BEGIN
PRINT 'CDMA Call Setup events count. Duration: ' + CONVERT(varchar,DateDiff(s
,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
Select e.SessionId as sessionId,
sum(case when (d.ProtDiscr = '8') then 1 else 0 end) as GMM,
sum(case when (d.ProtDiscr = '9') then 1 else 0 end) As SMS,
sum(case when (d.ProtDiscr = '5') then 1 else 0 end) As MM
into #callAnalysisCallBSideInfo
from vmsgGSML3Data d,callAnalysis e,CA_Sessions
where CA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.callStatus = 'Failed'
group by
e.SessionId
Select e.SessionId as sessionId,
sum(case when (d.ProtDiscr = '8') then 1 else 0 end) as GMM2,
sum(case when (d.ProtDiscr = 'A') then 1 else 0 end) As SM
into #callAnalysisCallBSideInfo2
from vGPRSInterLayerGMMSM d,callAnalysis e,CA_Sessions
where CA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.callStatus = 'Failed'
group by
e.SessionId
Update CallAnalysis
set NumReestablishmentRequests = CMReestablishmentRequest
from #callAnalysisCallInfoGen
where #callAnalysisCallInfoGen.sessionID = CallAnalysis.sessionID
Update CallAnalysis
set numCMServiceRequest = CMServiceRequest,
numCMServiceReject = CMServiceReject,
numSetup = Setup,
numCallProceding = CallProceding + CallConfirmed,
numProgress = Progress,
numAlerting = Alerting,
numConn = Conn,
numConnAck = ConnAck,
numLURequest = LURequest,
numLUAccept = LUAccept,
numLUReject = LUReject
from #callAnalysisCallSetupInfoGen
where #callAnalysisCallSetupInfoGen.sessionID = CallAnalysis.sessionID
Update CallAnalysis
set numChnReq = ChannelRequest
from #callAnalysisCallSetupChnReq
where #callAnalysisCallSetupChnReq.sessionID = CallAnalysis.sessionID
Update CallAnalysis
set numpageResponse = pageResponse,
numImmASS = ImmASS,
numImmAssRej = ImmAssRej,
numAssCmd = AssCmd,
numAssCmpl = AssCmpl,
numAssFail = AssFail
from #callAnalysisCallSetupInfoGSM
where #callAnalysisCallSetupInfoGSM.sessionID = CallAnalysis.sessionID
Update CallAnalysis
set numRRCConnSetup = RRCConnSetup,
numRRCConnRej = RRCConnRej,
numRBSetup = RBSetup,
numRBSetupCmpl = RBSetupCmpl,
numRBSetupFail = RBSetupFail
from #callAnalysisCallSetupInfoUMTS
where #callAnalysisCallSetupInfoUMTS.sessionID = CallAnalysis.sessionID
Update CallAnalysis
set numCDMAOriginationMsg = CDMAOriginationMsg,
numCDMAPageResponse = CDMAPageResponse,
numCDMAServiceConnectCmpl = CDMAServiceConnectCmpl,
numCDMAChnAssMsg = CDMAChnAssMsg
from #callAnalysisCallSetupInfoCDMA
where #callAnalysisCallSetupInfoCDMA.sessionID = CallAnalysis.sessionID
Update CallAnalysis
set numDCCH2GTrial = DCCH2G ,
numDCCH2GSuccess = DCCH2GSuccess,
numTCHTrial = TCH2G,
numTCHSuccess = TCH2GSuccess,
numDCCH3GTrial = DCCH3G,
numDCCH3GSuccess = DCCH3GSuccess,
numRABTrial = TCH3G,
numRABSuccess =TCH3GSuccess
from #callAnalysisCallSetupInfoGSMKPI
where #callAnalysisCallSetupInfoGSMKPI.sessionID = CallAnalysis.sessionID
Update CallAnalysis
set numGMMMessages = GMM + GMM2 + SM,
numSMSMessages = SMS,
numMMMessages = MM
from #callAnalysisCallBSideInfo,#callAnalysisCallBSideInfo2
where #callAnalysisCallBSideInfo.sessionID = CallAnalysis.sessionID and
#callAnalysisCallBSideInfo2.sessionID = CallAnalysis.sessionID
drop table #callAnalysisCallInfoGen
drop table #callAnalysisCallSetupInfoUMTS
drop table #callAnalysisCallSetupInfoCDMA
drop table #callAnalysisCallSetupInfoGen
drop table #callAnalysisCallSetupInfoGSM
drop table #callAnalysisCallSetupInfoGSMKPI
drop table #callAnalysisCallBSideInfo
drop table #callAnalysisCallBSideInfo2
drop table #callAnalysisCallSetupChnReq
UPDATE callAnalysis SET numCMServiceRequest = 0 where numCMServiceRequest IS N
ULL and SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numpageResponse = 0 where numpageResponse IS NULL
and SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numImmASS = 0 where numImmASS IS NULL and Se
ssionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numImmAssRej = 0 where numImmAssRej IS NULL and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numCallProceding = 0 where numCallProceding IS NULL
and SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numSetup = 0 where numSetup IS NULL and Ses
sionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numAssCmd = 0 where numAssCmd IS NULL and Se
ssionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numAssCmpl = 0 where numAssCmpl IS NULL and S
essionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numAssFail = 0 where numAssFail IS NULL and S
essionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numProgress = 0 where numProgress IS NULL and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numAlerting = 0 where numAlerting IS NULL and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numConn = 0 where numConn IS NULL and Sess
ionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numConnAck = 0 where numConnAck IS NULL and S
essionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numChnRelCallSetup = 0 where numChnRelCallSetup IS NU
LL and SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numLURequest = 0 where numLURequest IS NULL and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numLUAccept = 0 where numLUAccept IS NULL and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numLUReject = 0 where numLUReject IS NULL and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numDisconnect = 0 where numDisconnect IS NULL an
d SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numRelease = 0 where numRelease IS NULL and S
essionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numRelCmpl = 0 where numRelCmpl IS NULL and S
essionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numChnRel = 0 where numChnRel IS NULL and Se
ssionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numRRCConnSetup = 0 where numRRCConnSetup IS NULL
and SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numRRCConnRej = 0 where numRRCConnRej IS NULL an
d SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numRRCConnRel = 0 where numRRCConnRel IS NULL an
d SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numRBSetup = 0 where numRBSetup IS NULL and S
essionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numRBSetupCmpl = 0 where numRBSetupCmpl IS NULL a
nd SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numRBSetupFail = 0 where numRBSetupFail IS NULL a
nd SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numDCCH2GTrial = 0 where numDCCH2GTrial IS NULL a
nd SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numDCCH2GSuccess = 0 where numDCCH2GSuccess IS NULL
and SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numTCHTrial = 0 where numTCHTrial IS NULL and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numTCHSuccess = 0 where numTCHSuccess IS NULL an
d SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numDCCH3GTrial = 0 where numDCCH3GTrial IS NULL a
nd SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numDCCH3GSuccess = 0 where numDCCH3GSuccess IS NULL
and SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numRABTrial = 0 where numRABTrial IS NULL and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numRABSuccess = 0 where numRABSuccess IS NULL an
d SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numGMMMessages = 0 where numGMMMessages IS NULL a
nd SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numSMSMessages = 0 where numSMSMessages IS NULL a
nd SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numMMMessages = 0 where numMMMessages IS NULL an
d SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numCDMAOriginationMsg = 0 where numCDMAOriginationMsg I
S NULL and SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numCDMAPageResponse = 0 where numCDMAPageResponse IS NU
LL and SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numCDMAServiceConnectCmpl = 0 where numCDMAServiceConne
ctCmpl IS NULL and SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
UPDATE callAnalysis SET numCDMAChnAssMsg = 0 where numCDMAChnAssMsg IS NULL and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
if @debug=1
BEGIN
PRINT 'Call Setup events count. Duration: ' + CONVERT(varchar,DateDiff(s,@tim
e,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- Detects sequences without Layer3 Messages for more than 10 sec
-- [noL3Duration] [int] NULL,
--------------------------------------------------------------------------------
------------------------
--Alter Table callAnalysis Add [noL3Duration] [int] NULL
DECLARE @count as integer
--Select @count = count(l.msgId) * 10
--Select l.sessionID,
-- count(l.msgId) * 10 as l3count
--into #layer3count
--from MsgLogTrace l,CA_Sessions
--where l.info like '%No Layer 3 messages%' AND
-- l.SessionId = CA_Sessions.sessionId
--group by
-- l.sessionID
--select
-- d.sessionID,
-- Count(*) as l3count
--into #layer3count
--from MsgGSMData d, WCDMARRCMessages r, MsgCDMALayer3 c,CA_Sessions
--where (d.SessionId = CA_Sessions.sessionId and d.parseCode = '626') or
-- r.SessionId = CA_Sessions.sessionId or
-- c.SessionId = CA_Sessions.sessionId
--group by
-- d.sessionID
Select a.sessionId,
datediff(ms,a.CallEndTimeStamp, max(d.msgTime)) as duration,
count(d.msgTime) as num
into #layer3count
from msgGSMData d, CallAnalysis a, CA_Sessions s
where s.sessionId = a.sessionId AND
a.sessionID = d.sessionID and
EndTechnology = 'GSM' and
d.parseCode = '626'
group by a.sessionId,a.CallEndTimeStamp
UPDATE callAnalysis
Set noL3Duration = CASE when duration > 5 or num = 0 then 1 else 0 end
from #layer3count
where --sessionId = @sessionId
callAnalysis.sessionID = #layer3count.sessionID
drop table #layer3count
UPDATE CallAnalysis
SET CRRandomCode = SUBSTRING(d.message, 2, 2)
FROM CallAnalysis c
JOIN CA_Sessions s on s.SessionId = c.SessionId
JOIN MsgGSMData d on d.SessionId = s.SessionId
JOIN MsgGSMData m on m.sessionId = s.SessionId
WHERE d.parseCode in ('62A', '62B', '62C', '62D') AND -- Channel Request
m.parseCode = '626' AND
SUBSTRING(d.message, 2, 2) = SUBSTRING(m.message, 16, 2) AND -- match on
CRRandomCode
SUBSTRING(m.message, 5, 1) = '6' AND
SUBSTRING(m.message, 6, 2) = '3F' -- Immediate Assignment
if @debug=1
BEGIN
PRINT 'NoL3Data duration calculated. Duration: ' + CONVERT(varchar,DateDiff(s
,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- Detects unsuccessful registrations attempts
--------------------------------------------------------------------------------
------------------------
/*
select
s.*
into #FailedSessions
from
Sessions s
where
s.Info = 'Failed' and
s.SessionType = 'CALL'
UNION
select
k.*
from
sessions r,
sessions k
where
k.sessionID = r.sessionID - 1
and r.info = 'Failed'
*/
-- Take all failed Calls
select s.SessionId, s.SessionType
into #FailedSessions
from CA_Sessions s
where s.Info = 'Failed'
UNION ALL
-- the related IDLE sessions before
select k.SessionId, k.SessionType
from CA_Sessions r, sessions k
where k.sessionID = r.sessionID - 1 and
r.Info = 'Failed'
if @debug=1
BEGIN
PRINT 'Failed Sessions. Duration: ' + CONVERT(varchar,DateDiff(s,@time,GetDat
e())) + ' sec'
Select @time = GetDate()
END
select
r.*
into #Registrations
from
vRRCEstablishmentCause r,
CA_Sessions s,
#FailedSessions f
where
-- s.sessionID = 66 and
f.sessionID = s.sessionID and
r.sessionID = s.sessionID and
r.establishmentCause in ('registration', 'interRAT-CellReselection')
if @debug=1
BEGIN
PRINT 'Registration duration calculated. Duration: ' + CONVERT(varchar,DateDi
ff(s,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
select
distinct s.sessionID,
max(k.startTime) as lastTrial
into #FailedRegistrations
from
#Registrations r,
CA_Sessions s,
ResultsKPI k
where
k.sessionID = r.sessionID and
s.sessionID = r.sessionID and
r.msgTime = k.StartTime and
k.KPIID = 16000 and
k.ErrorCode <> 0
group by
s.sessionID
order by
s.sessionID
UPDATE callAnalysis
SET FailedRegistration = r.sessionID
from #FailedRegistrations r,callAnalysis c
where c.sessionID = r.sessionID
UPDATE callAnalysis
SET FailedRegistration = 0
where FailedRegistration IS NULL and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
if @debug=1
BEGIN
PRINT 'FailedRegistration duration calculated. Duration: ' + CONVERT(varchar,
DateDiff(s,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
drop table #FailedRegistrations
drop table #Registrations
drop table #FailedSessions
--------------------------------------------------------------------------------
------------------------
UPDATE callAnalysis
set code = 'S'
from CA_Sessions
where callAnalysis.sessionId = CA_Sessions.sessionId
Update CallAnalysis
set Technology = 'IS136'
where technology = 'IS13' and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
Update CallAnalysis
set Technology = 'AMPS/IS136'
where technology = 'AMPS/IS13' and
SessionId in (SELECT DISTINCT SessionId from CA_Sessions)
if @debug=1
BEGIN
PRINT 'Technology Update. Duration: ' + CONVERT(varchar,DateDiff(s,@time,GetD
ate())) + ' sec'
Select @time = GetDate()
END
drop table CA_Sessions
END
GO
--------------------------------------------------------------------------------
--
--------------------------------------------------------------------------------
--
CREATE PROCEDURE sqCallAnalysisCode
@poorRxQual real, -- avg of the last 8 RxQualSub values before cal
l end
@poorRxLev real, -- avg of the last 8 RxLevSub or avgBCCHRxLev va
lues before call end
@normalCallDuration int, -- threshold for normal call duration in millise
conds
@noL3Duration int, -- duration of no l3 data received (in seconds)
@BLERThreshold int,
@UEEcIoThreshold int,
@UERxLevThreshold int,
@CDMAFERThreshold int,
@CDMAEcIoThreshold int,
@CDMAAGCThreshold int,
@BadSampleThreshold real,
@BadCallPercentage real,
@iDENRxLevThreshold real, -- avg of the last 8 RxLev values before ca
ll end
@TDMARxLevThreshold real, -- avg of the last 8 RxLev values before cal
l end
@copyComment int,
@overwriteCallStatus int,
@copyRoamingInfo int,
@RecalcSessionId bigint = 0, -- sessionid is only supported when changing ca
ll status (in DataSelection)
@mode int = 0
AS
BEGIN
--------------------------------------------------------------------------------
------------------------
-- Call Analysis Code Calculation
-- Calculates the call code based on the information stored in the table 'CallAn
alysis'
--
-- Version: 2.02
-- Written by: A.Hellenbart
-- Last change: 06.04.2005
--------------------------------------------------------------------------------
------------------------
--------------------------------------------------------------------------------
------------------------
-- Generate a list with Sessions where a calculation is needed
--------------------------------------------------------------------------------
------------------------
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CAC_Sessio
ns]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[CAC_Sessions
]
CREATE TABLE [dbo].[CAC_Sessions] (
[SessionId] [bigint] NOT NULL
) ON [MainGroup]
CREATE UNIQUE CLUSTERED INDEX [IX_CAC_Sessions_1] ON [dbo].[CAC_Sessions]([Sessi
onId]) ON [MainGroup]
INSERT INTO CAC_Sessions
SELECT DISTINCT s.SessionId
FROM Sessions s
WHERE s.sessionType = 'CALL' and
s.valid = 1 and
((@mode = 0) or
(@mode = 1 and s.sessionID in (select l.sessionID from sessionlist l)) o
r
(@mode = 2 and s.sessionID = @RecalcSessionId))
IF (Select Count(SessionId) from CAC_Sessions) = 0
BEGIN
DROP TABLE CAC_Sessions
Return
END
--------------------------------------------------------------------------------
------------------------
-- calculate Call Quality on the basis of speech samples
--------------------------------------------------------------------------------
------------------------
select
c.sessionID,
t.TypeofTest,
c.callStatus,
sum(case when (l.LQFloat < @BadSampleThreshold) then 1 else 0 end) as Ba
dSamples,
convert(real,sum(case when (l.LQFloat < @BadSampleThreshold) then 1 else
0 end))/convert(real,count(*))*100 as Percentage,
case when (@BadCallPercentage < convert(real,sum(case when (l.LQFloat <
@BadSampleThreshold) then 1 else 0 end))/convert(real,count(*))*100) then
'Yes' else 'No' end as BadCall,
convert(real,avg(l.LQFloat)) as AvgLQ ,
count(*) as NumSamples
into #callquality
from
CallSession c,
TestInfo t,
vResultsLQAvgSimple l,
callanalysis a
where
c.sessionID = t.sessionID and
c.sessionID = a.sessionID and
t.testID = l.testID and
t.typeofTest = 'Speech' and
@RecalcSessionId = 0 and -- only for normal call analysis, not when chan
ging call status
a.SessionId in (Select SessionId from CAC_Sessions)
group by
c.sessionID,
t.TypeofTest,
c.callStatus
order by
c.sessionID
Update CallAnalysis
set NumBadSamples = q.BadSamples,
percentage = q.Percentage,
badCall = q.BadCall,
avgLQ = q.AvgLQ
from #callquality q
where q.sessionID = callAnalysis.sessionID
drop table #callquality
--------------------------------------------------------------------------------
------------------------
-- Eliminate NULL values in print fields
--------------------------------------------------------------------------------
------------------------
UPDATE CallAnalysis
set CallCause = 'unknown'
WHERE CallCause is NULL
and SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
set disconCause = ''
WHERE disconCause is NULL and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
set disconClass = ''
WHERE disconClass is NULL and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
set disconLocation = ''
WHERE disconLocation is NULL and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
set lastHOCause = ''
WHERE lastHOCause is NULL and
lastHoType is not NULL and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- reset CallAnalysis code
--------------------------------------------------------------------------------
------------------------
Update CallAnalysis
Set code = '',
codeDescription = ''
where (code = 'S' -- to check if the spCallAnalysis is done. Code is set to 'S
' as soon as it is scanned
OR code LIKE 'C%') and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Exclude all configuration calls first
--------------------------------------------------------------------------------
------------------------
Update CallAnalysis
Set code = 'C0.00',
codeDescription = 'Config Call'
where configCall<>0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Exclude all system released calls first
--------------------------------------------------------------------------------
------------------------
Update CallAnalysis
Set code = 'C0.01',
codeDescription = 'System Release'
where callStatus = 'System Release' and
SessionId in (Select SessionId from CAC_Sessions)
SELECT
sessions.sessionId,
sessions.startTime,
sessions.duration
INTO #tmp0
FROM
Sessions
JOIN FileList ON FileList.FileId = Sessions.FileId
WHERE ASideDevice LIKE '%Sagem%' AND
sessions.SessionType = 'CALL' AND
SessionId in (Select SessionId from CAC_Sessions)
SELECT #tmp0.sessionId,
datediff(ms,dateAdd(ms,#tmp0.duration,#tmp0.startTime), max(msgGSMData.m
sgTime)) AS duration,
count(msgGSMData.msgTime) AS num
INTO #tmp1
FROM
#tmp0
LEFT JOIN MsgGSMData ON MsgGSMData.SessionId = #tmp0.SessionId
GROUP BY
#tmp0.sessionId,
#tmp0.startTime,
#tmp0.duration
drop table #tmp0
Update CallAnalysis
SET code = case when c.callStatus = 'Completed' then 'C1.00'
when c.CallStatus = 'Dropped' then 'C2.99'
when c.CallStatus = 'Failed' then 'C3.99'
else 'C.0.00' end,
codeDescription = case when c.callStatus = 'Completed' then 'Completed,
Normal'
when c.CallStatus = 'Dropped' then 'Dropped, No Layer 3
Messages'
when c.CallStatus = 'Failed' then 'Failed, No Layer 3 Me
ssages'
else 'unknown' end
from CallAnalysis ca, sessions s, callSession c, FileList f
where ca.SessionId = s.SessionId AND
s.SessionId = c.SessionId AND
s.FileId = f.FileId AND
f.CallIngModule <> 0 AND -- Seven.Five data only!
s.SessionId IN (select sessionId from #tmp1 where duration<(-8000) or nu
m = 0)
drop table #tmp1
--------------------------------------------------------------------------------
------------------------
--******************************************************************************
************************
-- Completed Calls 'C1.XX'
--******************************************************************************
************************
-- CallDuration >= @normalCallDuration AND
-- CallTerminationType <> 'Max Retries'
Update CallAnalysis
Set code = 'C1.',
codeDescription = 'Completed'
where code = '' AND -- only calls th
at are not calculated
callStatus = 'Completed' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Normal Calls Bad Samples exeed BadCallPercentage
-- Identification: C1.10
--
UPDATE CallAnalysis
Set code = code + '10',
codeDescription = codeDescription + ', Bad Call' + ', ' + disconCause
from CallAnalysis
where code = 'C1.' AND -- only calls th
at are not calculated
BadCall = 'Yes' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Normal Calls Bad Samples
-- Identification: C1.11
--
UPDATE CallAnalysis
Set code = code + '11',
codeDescription = codeDescription + ', Bad Samples' + ', ' + disconCause
from CallAnalysis
where code = 'C1.' AND -- only calls th
at are not calculated
BadCall = 'No' AND
NumBadSamples > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Normal Calls
-- Identification: C1.00
--
UPDATE CallAnalysis
Set code = code + '00',
codeDescription = codeDescription + ', ' + disconCause
from CallAnalysis
where code = 'C1.' and -- only calls th
at are not calculated
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = code + '99',
codeDescription = codeDescription + ', Others'
from CallAnalysis
where Code = 'C1.' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
--******************************************************************************
************************
-- Dropped Calls 'C2.XX'
--******************************************************************************
************************
Update CallAnalysis
Set code = 'C2.',
codeDescription = 'Dropped'
where code = '' AND
CallStatus = 'Dropped' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.98
-- No Layer3 Messages
--
UPDATE CallAnalysis
Set code = code + '98',
codeDescription = codeDescription + ',No Layer 3 Messages'
from CallAnalysis
where Code = 'C2.' AND
Layer3Messages = 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.02
-- Call Re-Established
--
UPDATE CallAnalysis
Set code = code + '02',
codeDescription = codeDescription + ', Call Re-Established'
from CallAnalysis
where code = 'C2.' AND -- no other code
disconDirection = 'U' and
NumReestablishmentRequests > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.11
-- DL Disconnect received
--
UPDATE CallAnalysis
Set code = code + '11',
codeDescription = codeDescription + ', Disconnect received (' + disconCa
use + '-' + disconClass + '-' + disconLocation + ')'
from CallAnalysis
where code = 'C2.' AND -- no other code
disconDirection = 'D' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.10
-- DL Disconnect sent
--
UPDATE CallAnalysis
Set code = code + '10',
codeDescription = codeDescription + ', Disconnect sent (' + disconCause
+ '-' + disconClass + '-' + disconLocation + ')'
from CallAnalysis
where code = 'C2.' AND -- no other code
disconDirection = 'U' and
callDir = 'B->A' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.12
-- DL Disconnect sent
--
UPDATE CallAnalysis
Set code = code + '12',
codeDescription = codeDescription + ', Disconnect sent by Calling Party(
' + disconCause + '-' + disconClass + '-' + disconLocation + ')'
from CallAnalysis
where code = 'C2.' AND -- no other code
disconDirection = 'U' and
callDir = 'A->B' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.20
-- DL Channel Release received
--
UPDATE CallAnalysis
Set code = code + '20',
codeDescription = codeDescription + ', Channel Release received(' + Rele
aseCause + ')'
from CallAnalysis
where code = 'C2.' AND -- no other code
numChnRel > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.21
-- DL RRCConnectionRelease received
--
UPDATE CallAnalysis
Set code = code + '21',
codeDescription = codeDescription + ', RRCConnectionRelease received'
from CallAnalysis
where code = 'C2.' AND -- no ot
her code
numRRCConnRel > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.34
-- Failed IRAT-Handover
--
UPDATE CallAnalysis
Set code = code + '34',
codeDescription = codeDescription + ', Failed IRAT-Handover'
from CallAnalysis
where code = 'C2.' AND -- no ot
her code
(lastUMTSHoType = 'HO_IRAT_FAIL' ) and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.30
-- Failed Handover
--
UPDATE CallAnalysis
Set code = code + '30',
codeDescription = codeDescription + ', Failed Handover (' + lastHOCause
+ ')'
from CallAnalysis
where code = 'C2.' AND -- no ot
her code
lastHoType = 'HO_FAIL' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.31
-- Failed Handover
--
UPDATE CallAnalysis
Set code = code + '31',
codeDescription = codeDescription + ', Handover uncompleted'
from CallAnalysis
where code = 'C2.' AND -- no ot
her code
lastHoType = 'HO_CMD' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.32
-- Failed Assignment
--
UPDATE CallAnalysis
Set code = code + '32',
codeDescription = codeDescription + ', Failed Assignment (' + lastHOCaus
e + ')'
from CallAnalysis
where code = 'C2.' AND -- no ot
her code
lastHoType = 'ASS_FAIL' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.33
-- Assignment uncompleted
--
UPDATE CallAnalysis
Set code = code + '33',
codeDescription = codeDescription + ', Assignment uncompleted'
from CallAnalysis
where code = 'C2.' AND -- no ot
her code
lastHoType = 'ASS_CMD' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.40
-- RLC Timeout maybe in connect with Failed HO
--
UPDATE CallAnalysis
Set code = case when code = 'C2.' then code + '40' else code end,
codeDescription = codeDescription + ', Radio Link Timeout'
from CallAnalysis
where (code = 'C2.' or code = 'C2.30' or code = 'C2.31' or
code = 'C2.32' or code = 'C2.33' or code = 'C2.03' or
code = 'C2.02' ) AND -- no other code
RLCExp > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.41
-- High RxQual
--
UPDATE CallAnalysis
Set code = case when code = 'C2.' then code + '41' else code end,
codeDescription = codeDescription + ', High RxQual'
from CallAnalysis
where substring(code,1,3) = 'C2.' AND
avgRxQual >= @poorRxQual and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.42
-- Low RxLev
--
UPDATE CallAnalysis
Set code = case when code = 'C2.' then code + '42' else code end,
codeDescription = codeDescription + ', Low RxLev'
from CallAnalysis
where substring(code,1,3) = 'C2.' AND
(avgRxLev <= @poorRxLev OR
avgBCCHRxLev <= @poorRxLev
--OR avgRxQual >= @poorRxQual
) and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.43
-- High BLER
--
UPDATE CallAnalysis
Set code = case when code = 'C2.' then code + '43' else code end,
codeDescription = codeDescription + ', High BLER'
from CallAnalysis
where substring(code,1,3) = 'C2.' AND
avgBLER >= @BLERThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.44
-- Low Total Ec/Io
--
UPDATE CallAnalysis
Set code = case when code = 'C2.' then code + '44' else code end,
codeDescription = codeDescription + ', Low Total Ec/Io'
from CallAnalysis
where substring(code,1,3) = 'C2.' AND
avgTotEcIo <= @UEEcIoThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.45
-- Low UE Rx Power
--
UPDATE CallAnalysis
Set code = case when code = 'C2.' then code + '45' else code end,
codeDescription = codeDescription + ', Low UE Rx Power'
from CallAnalysis
where substring(code,1,3) = 'C2.' AND
avgUERxPwr <= @UERxLevThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.46
-- High Frame Error Rate
--
UPDATE CallAnalysis
Set code = case when code = 'C2.' then code + '46' else code end,
codeDescription = codeDescription + ', High FER'
from CallAnalysis
where substring(code,1,3) = 'C2.' AND
avgCDMAFER >= @CDMAFERThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.47
-- Low Ec/Io
--
UPDATE CallAnalysis
Set code = case when code = 'C2.' then code + '47' else code end,
codeDescription = codeDescription + ', Low Total Ec/Io'
from CallAnalysis
where substring(code,1,3) = 'C2.' AND
avgCDMATotEcIo <= @CDMAECIOThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.48
-- Low AGC
--
UPDATE CallAnalysis
Set code = case when code = 'C2.' then code + '48' else code end,
codeDescription = codeDescription + ', Low AGC'
from CallAnalysis
where substring(code,1,3) = 'C2.' AND
avgCDMAAGC <= @CDMAAGCThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.49
-- Low TDMA RxLev
--
UPDATE CallAnalysis
Set code = case when code = 'C2.' then code + '49' else code end,
codeDescription = codeDescription + ', Low IS-136 RxLev'
from CallAnalysis
where substring(code,1,3) = 'C2.' AND
avgTDMARxlev <= @TDMARxLevThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.49
-- Low iDEN RxLev
--
UPDATE CallAnalysis
Set code = case when code = 'C2.' then code + '50' else code end,
codeDescription = codeDescription + ', Low iDEN RxLev'
from CallAnalysis
where substring(code,1,3) = 'C2.' AND
avgiDENRRSSI <= @iDENRxLevThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.05
-- No Service/Scanning
--
UPDATE CallAnalysis
Set code = code + '05',
codeDescription = codeDescription + ', No Service/Scanning'
from CallAnalysis
where code = 'C2.' AND -- no ot
her code
(NoService > 0 or Initializing > 0) and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.98
-- No Service/Scanning
--
UPDATE CallAnalysis
Set code = code + '98',
codeDescription = codeDescription + ', Layer 3 Gaps'
from CallAnalysis
where code = 'C2.' AND -- no ot
her code
noL3Duration > @noL3Duration and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.06
-- Successful Handover
--
UPDATE CallAnalysis
Set code = code + '06',
codeDescription = codeDescription + ', Last Handover Successful'
from CallAnalysis
where code = 'C2.' AND -- no ot
her code
lastHoType = 'HO_CMPL' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.07
-- No Handover
--
UPDATE CallAnalysis
Set code = code + '07',
codeDescription = codeDescription + ', No Handover'
from CallAnalysis
where code = 'C2.' AND -- no ot
her code
lastHoType <> 'HO_FAIL' AND
lastHoType <> 'HO_CMPL' AND
lastHoType <> 'HO_CMD' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.03
-- DL Disconnect received
--
UPDATE CallAnalysis
Set code = case when code = 'C2.' then code + '03' else code end,
codeDescription = codeDescription + ', Call Re-Establishment attempt'
from CallAnalysis
where substring(code,1,3) = 'C2.' AND
NumReestablishmentRequests > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Calls,
-- Identification: C2.99
-- others
--
UPDATE CallAnalysis
Set code = code + '99',
codeDescription = codeDescription + ', others '
from CallAnalysis
where Code = 'C2.' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
--******************************************************************************
************************
-- Failed Calls 'C3.XX'
--******************************************************************************
************************
UPDATE CallAnalysis
Set code = 'C3.',
codeDescription = 'Failed'
where code = '' and
CallStatus = 'Failed' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.00
-- Scanning
--
--UPDATE CallAnalysis
--Set code = code + '00',
-- codeDescription = codeDescription + ', Scanning'
--from CallAnalysis
--where code = 'C3.' AND -- no ot
her code --
-- Initializing > 0 and numDisconnect = 0 and numconn = 0 and
-- SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.98
-- No Layer 3 Messages
--
UPDATE CallAnalysis
Set code = code + '98',
codeDescription = codeDescription + ', No Layer 3 Messages'
from CallAnalysis
where Code = 'C3.' AND
Layer3Messages = 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.
-- Disconnect Detected
--
UPDATE CallAnalysis
Set code = code + 'Disconnect'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
numDisconnect > 0 and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.UDisconnect'
from CallAnalysis
where code = 'C3.Disconnect' AND -- no ot
her code
disconDirection = 'U' and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.CgPUDisconnect'
from CallAnalysis
where code = 'C3.UDisconnect' AND -- no ot
her code
callDir = 'A->B' and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.10',
codeDescription = codeDescription + ', Disconnect sent by Called Party (
' + disconCause + ')'
from CallAnalysis
where code = 'C3.UDisconnect' AND -- no ot
her code
callDir <> 'A->B' and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.11',
codeDescription = codeDescription + ', B-Side not correctly connected ('
+ callCause + ')'
from CallAnalysis
where code = 'C3.CgPUDisconnect' AND -- no ot
her code
numconn > 0 and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.12',
codeDescription = codeDescription + ',No Answer (' + disconCause + ')'
from CallAnalysis
where code = 'C3.CgPUDisconnect' AND -- no ot
her code
numAlerting > 0 and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.13',
codeDescription = codeDescription + ',Disconnect sent after Progress ('
+ disconCause + ')'
from CallAnalysis
where code = 'C3.CgPUDisconnect' AND -- no ot
her code
numProgress > 0 and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.14',
codeDescription = codeDescription + ',Disconnect sent by Calling Party (
' + disconCause + ')'
from CallAnalysis
where code = 'C3.CgPUDisconnect' and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.DDisconnect'
from CallAnalysis
where code = 'C3.Disconnect' AND -- no ot
her code
disconDirection = 'D' and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.CdPDDisconnect'
from CallAnalysis
where code = 'C3.DDisconnect' AND -- no ot
her code
callDir = 'A->B' and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.15',
codeDescription = codeDescription + ',Disconnect received by Called Part
y after Alerting (' + disconCause + ')'
from CallAnalysis
where code = 'C3.DDisconnect' AND -- no ot
her code
callDir <> 'A->B' and
numAlerting > 0 and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.16',
codeDescription = codeDescription + ',Disconnect received by Called Part
y (' + disconCause + ')'
from CallAnalysis
where code = 'C3.DDisconnect' AND -- no ot
her code
callDir <> 'A->B' and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.17',
codeDescription = codeDescription + ', Disconnect received by Calling Pa
rty after Alerting (' + disconCause + ')'
from CallAnalysis
where code = 'C3.CdPDDisconnect' AND -- no ot
her code
numAlerting > 0 and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.18',
codeDescription = codeDescription + ', Disconnect received by Calling Pa
rty (' + disconCause + ')'
from CallAnalysis
where code = 'C3.CdPDDisconnect' AND -- no ot
her code
numAlerting = 0 and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.19',
codeDescription = codeDescription + 'Disconnect not determined'
from CallAnalysis
where CallStatus = 'Failed' and
codeDescription = 'Failed' and
numDisconnect > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.2
-- Channel Release received
--
UPDATE CallAnalysis
Set code = code + 'Release'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
(numChnRel > 0 or numRRCConnRel > 0 or numCDMAReleaseOrder > 0) and
(NumLuRequest + numLuAccept + NumLuReject +
numGMMMessages + numSMSMessages = 0) and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.20',
codeDescription = codeDescription + ', Service Reject '
from CallAnalysis
where code = 'C3.Release' AND -- no ot
her code
numCMServiceReject > 0 and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.21',
codeDescription = codeDescription + ', Release after Alerting (' + Relea
seCause + ')'
from CallAnalysis
where code = 'C3.Release' AND -- no ot
her code
numAlerting > 0 and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.22',
codeDescription = codeDescription + ', Release after Progress (' + Relea
seCause + ')'
from CallAnalysis
where code = 'C3.Release' AND -- no ot
her code
numProgress > 0 and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.23',
codeDescription = codeDescription + ', Release after Service Request ('
+ ReleaseCause + ')'
from CallAnalysis
where code = 'C3.Release' AND -- no ot
her code
numCMServiceRequest > 0 and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.24',
codeDescription = codeDescription + ', Release after Page Response (' +
ReleaseCause + ')'
from CallAnalysis
where code = 'C3.Release' AND
NumPageResponse > 0 and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.CgPRelease'
from CallAnalysis
where code = 'C3.Release' AND -- no ot
her code
callDir = 'A->B' and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.25',
codeDescription = codeDescription + ', Release Received by Calling Party
(' + ReleaseCause + ')'
from CallAnalysis
where code = 'C3.CgPRelease' and
SessionId in (Select SessionId from CAC_Sessions)
UPDATE CallAnalysis
Set code = 'C3.26',
codeDescription = codeDescription + ', Release Received by Called Party
(' + ReleaseCause + ')'
from CallAnalysis
where code = 'C3.Release' AND
callDir <> 'A->B' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.20
-- Radio Link Timeout
--
UPDATE CallAnalysis
Set code = code + '40',
codeDescription = codeDescription + ', Radio Link Timeout'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
RLCExp > 0 and
--callDir = 'A->B' and
numTCHSuccess > 0 and
(NumLuRequest + numLuAccept + NumLuReject) = 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.30
-- Last Message is Alerting
--
UPDATE CallAnalysis
Set code = code + '30',
codeDescription = codeDescription + ', No Progress after Alerting'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
numAlerting > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.31
-- Last Message is Progress (maybe voice anouncement
--
UPDATE CallAnalysis
Set code = code + '31',
codeDescription = codeDescription + ', Stop with Progress '
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
numProgress > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.32
-- No Progress after TCH assignment
--
UPDATE CallAnalysis
Set code = code + '32',
codeDescription = codeDescription + ', No Progress after TCH assignment
'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
(numTCHSuccess > 0 or numRABSuccess > 0) and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.41
-- TCH assignment Failed
--
UPDATE CallAnalysis
Set code = code + '41',
codeDescription = codeDescription + ', TCH assignment Failed '
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
(numTCHTrial> 0 or numRABTrial > 0) and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.33
-- No Progress after Setup
--
UPDATE CallAnalysis
Set code = code + '33',
codeDescription = codeDescription + ', No Progress after Call Confirmed/
Proceeding '
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
numCallProceding > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.34
-- No Progress after Setup
--
UPDATE CallAnalysis
Set code = code + '34',
codeDescription = codeDescription + ', No Progress after Setup '
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
numSetup> 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.42
-- Service Reject
--
UPDATE CallAnalysis
Set code = code + '42',
codeDescription = codeDescription + ', Service Reject '
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
numCMServiceReject > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.35
-- No Service Request/Page Response
--
UPDATE CallAnalysis
Set code = code + '35',
codeDescription = codeDescription + ', No Progress after Service Request
/Page Response'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
(numPageResponse + numCMServiceRequest) > 0 and
(NumLuRequest + numLuAccept + NumLuReject) = 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.36
-- No Service Request/Page Response
--
UPDATE CallAnalysis
Set code = code + '36',
codeDescription = codeDescription + ', No Service Request/Page Response'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
(numPageResponse + numCMServiceRequest) = 0 and
(numDCCH2GSuccess > 0 or numDCCH3GSuccess > 0) and
(NumLuRequest + numLuAccept + NumLuReject) = 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.60
-- No Progress after CDMA ServiceConnectComplete
--
UPDATE CallAnalysis
Set code = code + '60',
codeDescription = codeDescription + ', No Progress after Service Connect
Complete'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
numCDMAServiceConnectCmpl > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.61
-- No CDMA ServiceConnect
--
UPDATE CallAnalysis
Set code = code + '61',
codeDescription = codeDescription + ', No Service Connect'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
numCDMAServiceConnect=0 and
(numCDMAPageResponse + numCDMAOriginationMsg) > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.62
-- No Progress after CDMA Origination /Page Response
--
UPDATE CallAnalysis
Set code = code + '62',
codeDescription = codeDescription + ', No Progress after Origination/Pag
e Response'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
(numCDMAPageResponse + numCDMAOriginationMsg) > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.63
-- No Service Request/Page Response
--
UPDATE CallAnalysis
Set code = code + '63',
codeDescription = codeDescription + ', No Origination/Page Response'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
(numCDMAPageResponse + numCDMAOriginationMsg) = 0 and
Technology in ('CDMA') and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.50
-- Location Updating
--
UPDATE CallAnalysis
Set code = code + '50',
codeDescription = codeDescription + ', No Setup -> Location Updating '
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
(NumLuRequest + numLuAccept + NumLuReject) > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.51
-- Routing Area Updating
--
UPDATE CallAnalysis
Set code = code + '51',
codeDescription = codeDescription + ', No Setup -> RA Updating '
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
NumGMMmessages > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.52
-- SMS Messages
--
UPDATE CallAnalysis
Set code = code + '52',
codeDescription = codeDescription + ', No Setup -> SMS '
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
NumSMSmessages > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.37
-- No Progress after DCCH assignment
--
UPDATE CallAnalysis
Set code = code + '37',
codeDescription = codeDescription + ', No Progress after DCCH assignment
'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
(numDCCH2GSuccess > 0 or numDCCH3GSuccess > 0) and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.43
-- DCCH Failed/Rejected
--
UPDATE CallAnalysis
Set code = code + '43',
codeDescription = codeDescription + ', DCCH Failed/Rejected '
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
(numDCCH2GTrial> 0 or numDCCH3GTrial > 0) and
FailedRegistration = 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.44
-- Registration failed
--
UPDATE CallAnalysis
Set code = code + '44',
codeDescription = codeDescription + ', Registration failed '
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
FailedRegistration > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.39
-- No DCCH Request
--
UPDATE CallAnalysis
Set code = code + '39',
codeDescription = codeDescription + ', No DCCH Request '
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
(numDCCH2GTrial = 0 or numDCCH3GTrial = 0)and
NumImmAss = 0 and Technology in ('GSM','UMTS','GSM /UMTS') and
callDir = 'A->B' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.38
-- Not filled should be checked by KPIs
--
UPDATE CallAnalysis
Set code = code + '38',
codeDescription = codeDescription + ',No IMM_ASS for this Random Code'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
CRRandomCode = '' AND
numChnReq > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.98
-- No Layer3 Messages
--
UPDATE CallAnalysis
Set code = code + '98',
codeDescription = codeDescription + ', Layer3 Gaps'
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
noL3Duration > @noL3Duration and -- no di
sconnect received
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.53
-- Called Party active LU or SMS receiving etc.
--
UPDATE CallAnalysis
Set code = code + '53',
codeDescription = case when CallCause <> 'unknown'
then codeDescription + ', Called Party active '--
+ CallCause
else codeDescription + ', Called Party active ' e
nd
from CallAnalysis
where code = 'C3.' AND -- no other code
callDir = 'B->A' AND
((numGMMMessages + numMMMessages + numSMSMessages) > 0 or
(NumLuRequest + numLuAccept + NumLuReject) > 0 ) and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.54
-- Called Party did not react.
--
UPDATE CallAnalysis
Set code = code + '54',
codeDescription = case when CallCause <> 'unknown'
then codeDescription + ', Called Party not reache
d ' --+ CallCause
else codeDescription + ', Called Party not reache
d ' end
from CallAnalysis
where code = 'C3.' AND -- no ot
her code
(numDCCH2GTrial + numDCCH3GTrial + numCDMAPageResponse) = 0 and
callDir = 'B->A' and
Technology not in ('IS136','SMR','AMPS','AMPS/IS136','AMPS/CDMA') and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.01
-- No Service
--
UPDATE CallAnalysis
Set code = case when code = 'C3.' then code + '01' else code end,
codeDescription = codeDescription + ', No Service'
from CallAnalysis
where (code = 'C3.' or code = 'C3.98') AND -- no ot
her code --
NoService > 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.
-- Scanning
--
UPDATE CallAnalysis
Set code = code + '00',
codeDescription = codeDescription + ', Scanning'
from CallAnalysis
where Code = 'C3.' AND
--
Initializing > 0 and numDisconnect = 0 and numconn = 0 and numRRCConnRel
= 0 and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.
-- Scanning
--
UPDATE CallAnalysis
Set --code = code + '00',
codeDescription = codeDescription + ', Scanning'
from CallAnalysis
where substring(code,1,3) = 'C3.' AND
--
Initializing > 0 and numDisconnect = 0 and numconn = 0 and numRRCConnRe
l = 0 and code <> 'C3.00' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.
-- High BLER
--
UPDATE CallAnalysis
Set --code = code + '20',
codeDescription = codeDescription + ', High BLER'
from CallAnalysis
where substring(code,1,3) = 'C3.' AND
avgBLER >= @BLERThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.
-- Low Total Ec/Io
--
UPDATE CallAnalysis
Set --code = code + '22',
codeDescription = codeDescription + ', Low Total Ec/Io'
from CallAnalysis
where substring(code,1,3) = 'C3.' AND
-- no other code
avgTotEcIo <= @UEEcIoThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.
-- Low UE Rx Power
--
UPDATE CallAnalysis
Set --code = code + '25',
codeDescription = codeDescription + ', Low UE Rx Power'
from CallAnalysis
where substring(code,1,3) = 'C3.' AND
avgUERxPwr <= @UERxLevThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.
-- Low RxLev
--
UPDATE CallAnalysis
Set --code = code + '01',
codeDescription = codeDescription + ', Low RxLev'
from CallAnalysis
where substring(code,1,3) = 'C3.' AND
(avgRxLev <= @poorRxLev OR
avgBCCHRxLev <= @poorRxLev ) and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.
-- High RxQual
--
UPDATE CallAnalysis
Set --code = code + '12',
codeDescription = codeDescription + ', High RxQual'
from CallAnalysis
where substring(code,1,3) = 'C3.' AND
avgRxQual >= @poorRxQual and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.
-- High Frame Error Rate
--
UPDATE CallAnalysis
Set --code = case when code = 'C3.' then code + '46' else code end,
codeDescription = codeDescription + ', High FER'
from CallAnalysis
where substring(code,1,3) = 'C3.' AND
avgCDMAFER >= @CDMAFERThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.
-- Low Ec/Io
--
UPDATE CallAnalysis
Set --code = case when code = 'C3.' then code + '47' else code end,
codeDescription = codeDescription + ', Low Total Ec/Io'
from CallAnalysis
where substring(code,1,3) = 'C3.' AND
avgCDMATotEcIo <= @CDMAECIOThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.
-- Low AGC
--
UPDATE CallAnalysis
Set --code = case when code = 'C3.' then code + '48' else code end,
codeDescription = codeDescription + ', Low AGC'
from CallAnalysis
where substring(code,1,3) = 'C3.' AND
avgCDMAAGC <= @CDMAAGCThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.
-- Low IS-136 RxLev
--
UPDATE CallAnalysis
Set --code = case when code = 'C3.' then code + '49' else code end,
codeDescription = codeDescription + ', Low IS-136 RxLev'
from CallAnalysis
where substring(code,1,3) = 'C3.' AND
avgTDMARxlev <= @TDMARxLevThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.
-- Low iDEN RxLev
--
UPDATE CallAnalysis
Set --code = case when code = 'C3.' then code + '50' else code end,
codeDescription = codeDescription + ', Low iDEN RxLev'
from CallAnalysis
where substring(code,1,3) = 'C3.' AND
avgiDENRRSSI <= @iDENRxLevThreshold and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: C3.99
-- others
--
UPDATE CallAnalysis
Set code = code + '99',
codeDescription = codeDescription + ', others '
from CallAnalysis
where code = 'C3.' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: none
-- Calling Party Diagnosis
UPDATE CallAnalysis
Set codeDescription = case when CallCause <> 'unknown'
then codeDescription + ' ; Calling Party: ' + Cal
lCause
else codeDescription end
from CallAnalysis
where substring(code,1,3) = 'C3.' and
callDir = 'B->A' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
--******************************************************************************
************************
-- Unknown Calls 'C9.XX'
--******************************************************************************
************************
Update CallAnalysis
Set code = 'C9.',
codeDescription = 'Others'
where code = '' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Unknown Calls or System Problems
-- Identification: C9.98
-- No Layer3 for a long time
UPDATE CallAnalysis
Set code = code + '98',
codeDescription = codeDescription + ',No Layer3 Messages'
where code = 'C9.' AND -- no ot
her code
noL3Duration > @noL3Duration and -- no di
sconnect received
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Unknown Calls,
-- Identification: C9.99
-- others
UPDATE CallAnalysis
Set code = code + '99',
codeDescription = codeDescription + ',others'
where code = 'C9.' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Unknown Calls,
-- Identification: C9.00
-- PLMN Disconnect
UPDATE CallAnalysis
Set code = 'C9.01',
codeDescription = 'Others,User busy'
where disconCause like '%busy%' and
code = 'C9.' and
SessionId in (Select SessionId from CAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Unknown Calls,
-- Identification: C9.01
-- PLMN Disconnect
declare @sessionId bigint
declare @lastId bigint
declare @firstId bigint
declare @count bigint
CREATE TABLE #tmp (
[FirstSession] [int],
[LastSession] [int],
[sessionCount] [int]
)
declare noidle cursor for
select sessionId
from sessions s
where sessionType = 'CALL'
and (((s.sessionId - (select min(sessionId) from sessions where sessions.s
essionId > s.sessionId and sessionType = 'CALL' and fileId = s.fileId)) = -1)
or ((s.sessionId - (select max(sessionId) from sessions where sessions.ses
sionId < s.sessionId and sessionType = 'CALL' and fileId = s.fileId)) = 1)) and
s.SessionId in (Select SessionId from CAC_Sessions)
select @count = 1;
OPEN noidle
FETCH NEXT FROM noidle
INTO @lastId
select @firstId = @lastId
WHILE @@FETCH_STATUS = 0
BEGIN
FETCH NEXT FROM noidle
INTO @sessionId
if ((@sessionId - @lastId) = 1)
BEGIN
select @count = @count + 1
select @lastId = @sessionId
END
else
BEGIN
Insert Into #tmp (firstSession, lastSession, sessionCount) Values (@firstId,
@lastId, @count)
select @firstId = @sessionId
select @lastId = @sessionId
select @count = 1
END
END
close noidle
deallocate noidle
UPDATE CallAnalysis
Set code = '9.01',
codeDescription = 'Others,-'
from CallAnalysis c, #tmp t
where c.sessionId between t.FirstSession and t.LastSession AND
c.code not like '%1.%'
drop table #tmp
if @copyRoamingInfo=1
BEGIN
UPDATE CallAnalysis
Set codeDescription = codeDescription + ' -> Roaming to: ' + NetworkInfo.Ope
rator
from CallAnalysis, NetworkInfo, sessions
where CallAnalysis.SessionId = sessions.SessionId AND
sessions.NetworkId = NetworkInfo.NetworkId AND
NetworkInfo.Operator <> NetworkInfo.HomeOperator and
CallAnalysis.SessionId in (Select SessionId from CAC_Sessions)
END
--------------------------------------------------------------------------------
------------------------
-- This code can be used to copy the code description to the Analysis comment fi
eld
--
--
--------------------------------------------------------------------------------
------------------------
if @copyComment=1
BEGIN
Delete from AnalysisComment
FROM CallAnalysis
WHERE CallAnalysis.SessionId in (Select SessionId from CAC_Sessions) and
CallAnalysis.sessionID = AnalysisComment.sessionID

Insert AnalysisComment (sessionId, comment, testid)
Select CallAnalysis.sessionId,codeDescription, 0
FROM CallAnalysis
WHERE CallAnalysis.SessionId in (Select SessionId from CAC_Sessions)

END
END -- End of sqCallAnalysisCode
GO
--------------------------------------------------------------------------------
--
--------------------------------------------------------------------------------
--
CREATE PROCEDURE sqDataCallAnalysis
@mode int,
@sessionId bigint = 0
AS
BEGIN
--@mode = 0 all sessions
--@mode = 1 all sessions in Sessionlist
--@mode = 2 only @session
--declare @mode integer
--declare @sessionID bigint
--set @mode = 0
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DCA_Sessio
ns]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[DCA_Sessions
]
CREATE TABLE [dbo].[DCA_Sessions] (
[SessionId] [bigint] NOT NULL ,
[sessionType] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
[startTime] [datetime] NULL ,
[duration] [int] NULL
) ON [MainGroup]
CREATE INDEX [IX_DCA_Sessions_1] ON [dbo].[DCA_Sessions]([SessionId]) ON [MainGr
oup]
INSERT INTO DCA_Sessions
select s.SessionId, s.SessionType, s.StartTime, s.Duration
FROM sessions s
where s.sessionType = 'DATA' and --sessionID = 298
s.valid = 1 and
((@mode = 0) or
(@mode = 1 and s.sessionID in (select l.sessionID from sessionlist l)) or
(@mode = 2 and s.sessionID = @sessionID))
if (Select Count(SessionId) from DCA_Sessions) = 0
begin
drop table DCA_Sessions
Return
end
--------------------------------------------------------------------------------
------------------------
-- calculate Data Call Characteristics
-- [technology] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
-- [band] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
-- [Roaming] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
-- [NetIds] [int] NULL ,
--------------------------------------------------------------------------------
------------------------
DECLARE @time as datetime
DECLARE @debug integer
DECLARE @code as varchar(255)
Select @debug = 1 -- set to one for debug reasons only
if @debug=1
BEGIN
Select @time = GetDate()
PRINT 'Script started - ' + CONVERT(varchar,@time,114)
END
select
s.sessionID,
case when max(substring(n.technology,1,4)) = min(substring(n.technology,
1,4))
then max(substring(n.technology,1,4))
else min(substring(n.technology,1,4))+'/'+ max(substring(n.technolo
gy,1,4)) end as Technology,
case when max(substring(n.technology,1,4)) = min(substring(n.technology,
1,4))
then case when max(n.technology) = min(n.technology)
then max(n.technology)
else 'Dualband' end
else 'RAT-Change' end as Band,
case when (max(n.Operator) = min(n.HomeOperator))
then 'No'
else 'Yes' end as Roaming,
count(*) as NetIds
into #DataCallCharacteristics
from
DataCallAnalysis a,
DCA_Sessions s,
NetworkIDRelation r,
NetworkInfo n
where
a.sessionID = s.sessionID and
n.networkID = r.networkID and
r.sessionID = s.sessionID and
s.SessionType = 'DATA'
group by
s.sessionID
order by
s.sessionID asc
Update DataCallAnalysis
set
DataCallAnalysis.Technology = c.Technology,
Band = c.Band,
Roaming = c.Roaming,
NetIds = c.NetIDs
from
#DataCallCharacteristics c
where
DataCallAnalysis.sessionID = c.sessionID
drop table #DataCallCharacteristics
if @debug=1
BEGIN
PRINT 'Characteristics duration calculation finished. Duration: ' + CONVERT(v
archar,DateDiff(s,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- calculate the start time, end time and duraton for each session
-- [StartTimeStamp] [datetime] NULL,
-- [DialTimeStamp] [datetime] NULL ,
-- [ConnectTimeStamp] [datetime] NULL ,
-- [DisconnectTimeStamp] [datetime] NULL ,
-- [EndTimeStamp] [datetime] NULL,
-- [SetupTime] [int] NULL ,
-- [ConnectTime] [int] NULL ,
-- [Duration] [int] NULL ,
-- [StartTechnology][varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
-- [EndTechnology][varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
--------------------------------------------------------------------------------
------------------------
UPDATE datacallAnalysis
set DialTimeStamp = Markers.msgTime,
StartTechnology = substring(NetworkInfo.Technology,1,4)
from Markers,
datacallAnalysis ,
DCA_Sessions,
networkInfo
where DCA_Sessions.SessionId = Markers.sessionId AND
markers.sessionId = datacallAnalysis.sessionId AND
networkInfo.networkID = markers.networkID and
Markers.MarkerText = 'DialUp Dial'
UPDATE datacallAnalysis
set ConnectTimeStamp = Markers.msgTime,
EndTechnology = substring(NetworkInfo.Technology,1,4)
from Markers,
datacallAnalysis ,
DCA_Sessions,
networkInfo
where DCA_Sessions.SessionId = Markers.sessionId AND
markers.sessionId = datacallAnalysis.sessionId AND
networkInfo.networkID = markers.networkID and
(Markers.MarkerText = 'DialUp Connected' or
Markers.MarkerText = 'DialUp ConnectFailed')
select markers.sessionID,
min (Markers.msgTime) as DisconTime,
min (substring(NetworkInfo.Technology,1,4)) as EndTech
into #DisconnectTime
from Markers,
DCA_Sessions,
networkInfo
where DCA_Sessions.SessionId = markers.SessionId AND
networkInfo.networkID = markers.networkID and
(Markers.MarkerText = 'DialUp Hangup' or
Markers.MarkerText = 'DialUp HangupCompleted' or
Markers.MarkerText = 'DialUp Dropped')
group by
Markers.sessionID
UPDATE datacallAnalysis
set DisconnectTimeStamp = DisconTime,
EndTechnology = EndTech,
SetupTime = datediff(ms,StartTimeStamp,ConnectTimeStamp),
ConnectTime = datediff(ms,ConnectTimeStamp,DisconTime)
from #DisconnectTime
where datacallAnalysis.sessionID = #DisconnectTime.sessionID
--- Setting call end of failed calls per default
UPDATE datacallAnalysis
set EndTimeStamp = dateadd(ms,duration,startTimeStamp)
where datacallAnalysis.Status = 'Failed' and
EndTimeStamp is NULL and
SessionId in (SELECT DISTINCT SessionId from DCA_Sessions)
UPDATE datacallAnalysis
set ConnectTimeStamp = EndTimeStamp,
EndTechnology = StartTechnology
where datacallAnalysis.Status = 'Failed' and
ConnectTimeStamp is NULL and
SessionId in (SELECT DISTINCT SessionId from DCA_Sessions)
UPDATE datacallAnalysis
set DisconnectTimeStamp = ConnectTimeStamp,
EndTechnology = StartTechnology
where datacallAnalysis.Status = 'Failed' and
DisconnectTimeStamp is NULL and
SessionId in (SELECT DISTINCT SessionId from DCA_Sessions)
--- Setting data call duration
Update datacallAnalysis
Set Duration = DateDiff(ms,DialTimeStamp,DisconnectTimeStamp)
from DCA_Sessions
where DCA_Sessions.sessionId = datacallAnalysis.sessionId
-- if CallTerminated occurs after session end
Update datacallAnalysis
Set Duration = DCA_Sessions.Duration,
EndTimeStamp = DateAdd(ms,DCA_Sessions.Duration,startTimestamp)
from DCA_Sessions
where DCA_Sessions.sessionId = datacallAnalysis.sessionId and
datacallAnalysis.Duration is NULL
drop table #DisconnectTime
if @debug=1
BEGIN
PRINT 'Start,end, duration calculation finished. Duration: ' + CONVERT(varcha
r,DateDiff(s,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- calculate the last RAT-change before Disconnect
-- [SgnChnReq] [datetime] NULL ,
-- [SgnChnAss] [datetime] NULL ,
-- [StartTechnology][varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
--------------------------------------------------------------------------------
------------------------
select
d.sessionID,
max(k.StartTime) as IRATTime,
max(Technology) as Technology,
sum(case when k.KPIStatus = 'Successful' then 1 else 0 end) as Status
into #lastIRAT
from
vResultsKPI k,
datacallAnalysis d,
DCA_Sessions s
where
s.sessionID = d.sessionID and
d.sessionID = k.sessionID and
k.KPIID in (35040,35050,35060,35070) and
k.startTime <= d.DisconnectTimeStamp and
k.endTime >= d.DialTimeStamp and
d.status in ('Failed', 'Dropped')
group by
d.sessionID
order by
d.sessionID
Update DatacallAnalysis
set lastIRATChange = IRATTime
from #lastIRAT
where #lastIRAT.sessionID = DatacallAnalysis.sessionID
Update DataCallAnalysis
set lastIRATChange = ConnectTimeStamp
where lastIRATChange is NULL and
SessionId in (SELECT DISTINCT SessionId from DCA_Sessions)
drop table #lastIRAT
if @debug=1
BEGIN
PRINT 'Last RAT change. Duration: ' + CONVERT(varchar,DateDiff(s,@time,GetDat
e())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- calculate the signaling channel assignment time, end time and duraton for eac
h session setup
-- [SgnChnReq] [datetime] NULL ,
-- [SgnChnAss] [datetime] NULL ,
-- [StartTechnology][varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
--------------------------------------------------------------------------------
------------------------
DECLARE @t as datetime
select
k.sessionID,
max(k.KPIID)as KPIID,
sum(case when k.KPIStatus = 'Successful' then 1 else 0 end) as Status,
min(k.StartTime) as Starttime,
min(k.EndTime) as EndTime,
max(k.EndTime) as MaxEndTime,
dateDiff(ms,min(k.EndTime),max(k.EndTime))as Duration
into #SetupTimes
from
vResultsKPI k,
datacallAnalysis a,
DCA_Sessions c
where
c.sessionID = a.sessionID and
a.sessionID = k.sessionID and
(KPIID = 15700 or KPIID = 16000) and
a.status = 'Failed'
group by
k.sessionID,
k.KPIID
order by
k.sessionID
Update datacallAnalysis
set
SgnChnReq = startTime,
SgnChnAss = endTime,
StartTechnology = case when KPIID = 15700
then 'GSM'
else 'UMTS' end
from
#SetupTimes s
where
datacallAnalysis.sessionID = s.sessionID

Update datacallAnalysis
Set StartTechnology = Technology
where Technology = 'CDMA' and
SessionId in (SELECT DISTINCT SessionId from DCA_Sessions)

drop table #SetupTimes
if @debug=1
BEGIN
PRINT 'Setup calculation finished. Duration: ' + CONVERT(varchar,DateDiff(s,@
time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- calculates PDP Context Deactivation, SM Status
-- [PDPDeactDirection] [varchar] (2) COLLATE Latin1_General_CI_AS NULL ,
-- [PDPDeactCause] [varchar] (100) COLLATE Latin1_General_CI_AS NULL ,
-- [SMStatusDirection] [varchar] (100) COLLATE Latin1_General_CI_AS NULL ,
-- [SMStatusCause] [varchar] (100) COLLATE Latin1_General_CI_AS NULL ,
-- [PDPActRejDirection] [varchar] (2) COLLATE Latin1_General_CI_AS NULL ,
-- [PDPActRejCause] [varchar] (100) COLLATE Latin1_General_CI_AS NULL ,
--------------------------------------------------------------------------------
------------------------
--
-- 8 7 6 5 4 3 2 1
-- 0 0 0 1 1 0 0 1 LLC or SNDCP failure(GSM only)
-- 0 0 0 1 1 0 1 0 Insufficient resources
-- 0 0 0 1 1 0 1 1 Missing or unknown APN
-- 0 0 0 1 1 1 0 0 Unknown PDP address or PDP type
-- 0 0 0 1 1 1 0 1 User Authentication failed
-- 0 0 0 1 1 1 1 0 Activation rejected by GGSN
-- 0 0 0 1 1 1 1 1 Activation rejected, unspecified
-- 0 0 1 0 0 0 0 0 Service option not supported
-- 0 0 1 0 0 0 0 1 Requested service option not subscribed
-- 0 0 1 0 0 0 1 0 Service option temporarily out of order
-- 0 0 1 0 0 0 1 1 NSAPI already used (not sent)
-- 0 0 1 0 0 1 0 0 Regular deactivation
-- 0 0 1 0 0 1 0 1 QoS not accepted
-- 0 0 1 0 0 1 1 0 Network failure
-- 0 0 1 0 0 1 1 1 Reactivation required
-- 0 0 1 0 1 0 0 0 Feature not supported
-- 0 0 1 0 1 0 0 1 Semantic error in the TFT operation
-- 0 0 1 0 1 0 1 0 Syntactical error in the TFT operation
-- 0 0 1 0 1 0 1 1 Unknown PDP context
-- 0 0 1 0 1 1 1 0 PDP context without TFT already activated
-- 0 0 1 0 1 1 0 0 Semantic errors in packet filter(s)
-- 0 0 1 0 1 1 0 1 Syntactical errors in packet filter(s)
-- 0 1 0 1 0 0 0 1 Invalid transaction identifier value
-- 0 1 0 1 1 1 1 1 Semantically incorrect message
-- 0 1 1 0 0 0 0 0 Invalid mandatory information
-- 0 1 1 0 0 0 0 1 Message type non-existent or not implemented
-- 0 1 1 0 0 0 1 0 Message type not compatible with the protocol state
-- 0 1 1 0 0 0 1 1 Information element non-existent or not implemented
-- 0 1 1 0 0 1 0 0 Conditional IE error
-- 0 1 1 0 0 1 0 1 Message not compatible with the protocol state
-- 0 1 1 0 1 1 1 1 Protocol error, unspecified
UPDATE datacallAnalysis
Set PDPDeactDirection = SUBSTRING(d.message, 1, 1),
PDPDeactCause = case dbo.HexToInt(SUBSTRING(d.message,10,2))
when 25 then 'LLC or SNDCP failure(GSM only)'
when 26 then 'Insufficient resources'
when 27 then 'Missing or unknown APN'
when 28 then 'Unknown PDP address or PDP type'
when 29 then 'User Authentication failed'
when 30 then 'Activation rejected by GGSN'
when 31 then 'Activation rejected, unspecified'
when 32 then 'Service option not supported'
when 33 then 'Requested service option not subsc
ribed'
when 34 then 'Service option temporarily out of
order'
when 35 then 'NSAPI already used (not sent)'
when 36 then 'Regular deactivation'
when 37 then 'QoS not accepted'
when 38 then 'Network failure'
when 39 then 'Reactivation required'
when 40 then 'Feature not supported'
when 41 then 'Semantic error in the TFT operatio
n'
when 42 then 'Syntactical error in the TFT opera
tion'
when 43 then 'Unknown PDP context'
when 44 then 'PDP context without TFT already ac
tivated'
when 45 then 'Semantic errors in packet filter(s
)'
when 46 then 'Syntactical errors in packet filte
r(s)'
when 47 then 'Invalid transaction identifier val
ue'
when 48 then 'Semantically incorrect message'
when 49 then 'Invalid mandatory information'
when 50 then 'Message type non-existent or not i
mplemented'
when 51 then 'Message type not compatible with t
he protocol state'
when 52 then 'Information element non-existent o
r not implemented'
when 53 then 'Conditional IE error'
when 54 then 'Message not compatible with the pr
otocol state'
when 55 then 'Protocol error, unspecified'
else 'Protocol error, unspecified/Service option
not supported' end COLLATE Latin1_General_CI_AS
-- from
FROM datacallAnalysis c, MsgGPRSInterLayerGMMSM d, DCA_Sessions
WHERE DCA_Sessions.SessionId = c.SessionId AND
c.SessionId = d.sessionId AND
d.parseCode = '62G1' AND -- SM L3
SUBSTRING(d.message, 7, 1) = 'A' AND -- SM
SUBSTRING(d.message, 8, 2) = '46' -- msgType = '46' (Deactivate PDP
context request)
UPDATE datacallAnalysis
Set SMStatusDirection = SUBSTRING(d.message, 1, 1),
SMStatusCause = case dbo.HexToInt(SUBSTRING(d.message,10,2))
when 25 then 'LLC or SNDCP failure(GSM only)'
when 26 then 'Insufficient resources'
when 27 then 'Missing or unknown APN'
when 28 then 'Unknown PDP address or PDP type'
when 29 then 'User Authentication failed'
when 30 then 'Activation rejected by GGSN'
when 31 then 'Activation rejected, unspecified'
when 32 then 'Service option not supported'
when 33 then 'Requested service option not subsc
ribed'
when 34 then 'Service option temporarily out of
order'
when 35 then 'NSAPI already used (not sent)'
when 36 then 'Regular deactivation'
when 37 then 'QoS not accepted'
when 38 then 'Network failure'
when 39 then 'Reactivation required'
when 40 then 'Feature not supported'
when 41 then 'Semantic error in the TFT operatio
n'
when 42 then 'Syntactical error in the TFT opera
tion'
when 43 then 'Unknown PDP context'
when 44 then 'PDP context without TFT already ac
tivated'
when 45 then 'Semantic errors in packet filter(s
)'
when 46 then 'Syntactical errors in packet filte
r(s)'
when 47 then 'Invalid transaction identifier val
ue'
when 48 then 'Semantically incorrect message'
when 49 then 'Invalid mandatory information'
when 50 then 'Message type non-existent or not i
mplemented'
when 51 then 'Message type not compatible with t
he protocol state'
when 52 then 'Information element non-existent o
r not implemented'
when 53 then 'Conditional IE error'
when 54 then 'Message not compatible with the pr
otocol state'
when 55 then 'Protocol error, unspecified'
else 'Protocol error, unspecified/Service option
not supported' end COLLATE Latin1_General_CI_AS
-- from
FROM datacallAnalysis c, MsgGPRSInterLayerGMMSM d, DCA_Sessions
WHERE DCA_Sessions.SessionId = c.SessionId AND
c.SessionId = d.sessionId AND
d.parseCode = '62G1' AND -- SM L3
SUBSTRING(d.message, 7, 1) = 'A' AND -- SM
SUBSTRING(d.message, 8, 2) = '55' -- msgType = '55' (SM Status)
UPDATE datacallAnalysis
Set PDPActRejDirection = SUBSTRING(d.message, 1, 1),
PDPActRejCause = case dbo.HexToInt(SUBSTRING(d.message,10,2))
when 25 then 'LLC or SNDCP failure(GSM only)'
when 26 then 'Insufficient resources'
when 27 then 'Missing or unknown APN'
when 28 then 'Unknown PDP address or PDP type'
when 29 then 'User Authentication failed'
when 30 then 'Activation rejected by GGSN'
when 31 then 'Activation rejected, unspecified'
when 32 then 'Service option not supported'
when 33 then 'Requested service option not subsc
ribed'
when 34 then 'Service option temporarily out of
order'
when 35 then 'NSAPI already used (not sent)'
when 36 then 'Regular deactivation'
when 37 then 'QoS not accepted'
when 38 then 'Network failure'
when 39 then 'Reactivation required'
when 40 then 'Feature not supported'
when 41 then 'Semantic error in the TFT operatio
n'
when 42 then 'Syntactical error in the TFT opera
tion'
when 43 then 'Unknown PDP context'
when 44 then 'PDP context without TFT already ac
tivated'
when 45 then 'Semantic errors in packet filter(s
)'
when 46 then 'Syntactical errors in packet filte
r(s)'
when 47 then 'Invalid transaction identifier val
ue'
when 48 then 'Semantically incorrect message'
when 49 then 'Invalid mandatory information'
when 50 then 'Message type non-existent or not i
mplemented'
when 51 then 'Message type not compatible with t
he protocol state'
when 52 then 'Information element non-existent o
r not implemented'
when 53 then 'Conditional IE error'
when 54 then 'Message not compatible with the pr
otocol state'
when 55 then 'Protocol error, unspecified'
else 'Protocol error, unspecified/Service option
not supported' end COLLATE Latin1_General_CI_AS
-- from
FROM datacallAnalysis c, MsgGPRSInterLayerGMMSM d, DCA_Sessions
WHERE DCA_Sessions.SessionId = c.SessionId AND
c.SessionId = d.sessionId AND
d.parseCode = '62G1' AND -- SM L3
SUBSTRING(d.message, 7, 1) = 'A' AND -- SM
SUBSTRING(d.message, 8, 2) = '43' -- msgType = '43' (PDP Context Ac
tivation Reject)
if @debug=1
BEGIN
PRINT 'SM termination calculation finished. Duration: ' + CONVERT(varchar,Dat
eDiff(s,@time,GetDate())) + ' sec'
SELECT @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- calculates Detach, Routing Area Update Reject
-- [DetachDirection] [varchar] (100) COLLATE Latin1_General_CI_AS NULL ,
-- [DetachCause] [varchar] (100) COLLATE Latin1_General_CI_AS NULL ,
-- [RARejectDirection] [varchar] (100) COLLATE Latin1_General_CI_AS NULL ,
-- [RARejectCause] [varchar] (100) COLLATE Latin1_General_CI_AS NULL ,
-- [AttachRejectDirection] [varchar] (100) COLLATE Latin1_General_CI_AS NUL
L ,
-- [AttachRejectCause] [varchar] (100) COLLATE Latin1_General_CI_AS NULL ,
--
--------------------------------------------------------------------------------
------------------------
--
-- Bits
-- 8 7 6 5 4 3 2 1
-- 0 0 0 0 0 0 1 0 IMSI unknown in HLR
-- 0 0 0 0 0 0 1 1 Illegal MS
-- 0 0 0 0 0 1 1 0 Illegal ME
-- 0 0 0 0 0 1 1 1 GPRS services not allowed
-- 0 0 0 0 1 0 0 0 GPRS services and non-GPRS services not allowed
-- 0 0 0 0 1 0 0 1 MS identity cannot be derived by the network
-- 0 0 0 0 1 0 1 0 Implicitly detached
-- 0 0 0 0 1 0 1 1 PLMN not allowed
-- 0 0 0 0 1 1 0 0 Location Area not allowed
-- 0 0 0 0 1 1 0 1 Roaming not allowed in this location area
-- 0 0 0 0 1 1 1 0 GPRS services not allowed in this PLMN
-- 0 0 0 0 1 1 1 1 No Suitable Cells In Location Area
-- 0 0 0 1 0 0 0 0 MSC temporarily not reachable
-- 0 0 0 1 0 0 0 1 Network failure
-- 0 0 0 1 0 1 0 0 MAC failure
-- 0 0 0 1 0 1 0 1 Synch failure
-- 0 0 0 1 0 1 1 0 Congestion
-- 0 0 0 1 0 1 1 1 GSM authentication unacceptable
-- 0 0 1 0 1 0 0 0 No PDP context activated
-- 0 0 1 1 0 0 0 0 }
-- to } retry upon entry into a new cell
-- 0 0 1 1 1 1 1 1 }
-- 0 1 0 1 1 1 1 1 Semantically incorrect message
-- 0 1 1 0 0 0 0 0 Invalid mandatory information
-- 0 1 1 0 0 0 0 1 Message type non-existent or not implemented
-- 0 1 1 0 0 0 1 0 Message type not compatible with the protocol state
-- 0 1 1 0 0 0 1 1 Information element non-existent or not implemented
-- 0 1 1 0 0 1 0 0 Conditional IE error
-- 0 1 1 0 0 1 0 1 Message not compatible with the protocol state
-- 0 1 1 0 1 1 1 1 Protocol error, unspecified
UPDATE datacallAnalysis
Set DetachDirection = SUBSTRING(d.message, 1, 1),
DetachCause = case dbo.HexToInt(SUBSTRING(d.message,14,2))
when 2 then 'IMSI unknown in HLR'
when 3 then 'Illegal MS'
when 6 then 'Illegal ME'
when 7 then 'GPRS services not allowed'
when 8 then 'GPRS services and non-GPRS servic
es not allowed'
when 9 then 'MS identity cannot be derived by
the network'
when 10 then 'Implicitly detached'
when 11 then 'PLMN not allowed'
when 12 then 'Location Area not allowed'
when 13 then 'Roaming not allowed in this locat
ion area'
when 14 then 'GPRS services not allowed in this
PLMN'
when 15 then 'No Suitable Cells In Location Are
a'
when 16 then 'MSC temporarily not reachable'
when 17 then 'Network failure'
when 20 then 'MAC failure'
when 21 then 'Synch failure'
when 22 then 'Congestion'
when 23 then 'GSM authentication unacceptable'
when 40 then 'No PDP context activated'
when 48 then 'retry upon entry into a new cell'

when 63 then 'retry upon entry into a new cell'
when 95 then 'Semantically incorrect message'
when 96 then 'Invalid mandatory information'
when 97 then 'Message type non-existent or not
implemented'
when 98 then 'Message type not compatible with
the protocol state'
when 99 then 'Information element non-existent
or not implemented'
when 100 then 'Conditional IE error'
when 101 then 'Message not compatible with the p
rotocol state'
when 111 then 'Protocol error, unspecified'
else 'retry upon entry into a new cell' end COLL
ATE Latin1_General_CI_AS

FROM datacallAnalysis c, MsgGPRSInterLayerGMMSM d, DCA_Sessions
WHERE DCA_Sessions.SessionId = c.SessionId AND
c.SessionId = d.sessionId AND
d.parseCode = '62G1' AND -- GMM/SM L3
SUBSTRING(d.message, 7, 1) = '8' AND -- GMM
SUBSTRING(d.message, 8, 2) = '05' -- msgType = '05' (Detach Request
)
UPDATE datacallAnalysis
Set RARejectDirection = SUBSTRING(d.message, 1, 1),
RARejectCause = case dbo.HexToInt(SUBSTRING(d.message,10,2))
when 2 then 'IMSI unknown in HLR'
when 3 then 'Illegal MS'
when 6 then 'Illegal ME'
when 7 then 'GPRS services not allowed'
when 8 then 'GPRS services and non-GPRS servic
es not allowed'
when 9 then 'MS identity cannot be derived by
the network'
when 10 then 'Implicitly detached'
when 11 then 'PLMN not allowed'
when 12 then 'Location Area not allowed'
when 13 then 'Roaming not allowed in this locat
ion area'
when 14 then 'GPRS services not allowed in this
PLMN'
when 15 then 'No Suitable Cells In Location Are
a'
when 16 then 'MSC temporarily not reachable'
when 17 then 'Network failure'
when 20 then 'MAC failure'
when 21 then 'Synch failure'
when 22 then 'Congestion'
when 23 then 'GSM authentication unacceptable'
when 40 then 'No PDP context activated'
when 48 then 'retry upon entry into a new cell'

when 63 then 'retry upon entry into a new cell'
when 95 then 'Semantically incorrect message'
when 96 then 'Invalid mandatory information'
when 97 then 'Message type non-existent or not
implemented'
when 98 then 'Message type not compatible with
the protocol state'
when 99 then 'Information element non-existent
or not implemented'
when 100 then 'Conditional IE error'
when 101 then 'Message not compatible with the p
rotocol state'
when 111 then 'Protocol error, unspecified'
else 'retry upon entry into a new cell' end COLL
ATE Latin1_General_CI_AS

FROM datacallAnalysis c, MsgGPRSInterLayerGMMSM d, DCA_Sessions
WHERE DCA_Sessions.SessionId = c.SessionId AND
c.SessionId = d.sessionId AND
d.parseCode = '62G1' AND -- GMM/SM L3
SUBSTRING(d.message, 7, 1) = '8' AND -- GMM
SUBSTRING(d.message, 8, 2) = '0B' -- msgType = '0B' (Routing Area U
pdate Reject)
UPDATE datacallAnalysis
Set AttachRejectDirection = SUBSTRING(d.message, 1, 1),
AttachRejectCause = case dbo.HexToInt(SUBSTRING(d.message,10,2))
when 2 then 'IMSI unknown in HLR'
when 3 then 'Illegal MS'
when 6 then 'Illegal ME'
when 7 then 'GPRS services not allowed'
when 8 then 'GPRS services and non-GPRS servic
es not allowed'
when 9 then 'MS identity cannot be derived by
the network'
when 10 then 'Implicitly detached'
when 11 then 'PLMN not allowed'
when 12 then 'Location Area not allowed'
when 13 then 'Roaming not allowed in this locat
ion area'
when 14 then 'GPRS services not allowed in this
PLMN'
when 15 then 'No Suitable Cells In Location Are
a'
when 16 then 'MSC temporarily not reachable'
when 17 then 'Network failure'
when 20 then 'MAC failure'
when 21 then 'Synch failure'
when 22 then 'Congestion'
when 23 then 'GSM authentication unacceptable'
when 40 then 'No PDP context activated'
when 48 then 'retry upon entry into a new cell'

when 63 then 'retry upon entry into a new cell'
when 95 then 'Semantically incorrect message'
when 96 then 'Invalid mandatory information'
when 97 then 'Message type non-existent or not
implemented'
when 98 then 'Message type not compatible with
the protocol state'
when 99 then 'Information element non-existent
or not implemented'
when 100 then 'Conditional IE error'
when 101 then 'Message not compatible with the p
rotocol state'
when 111 then 'Protocol error, unspecified'
else 'retry upon entry into a new cell' end COLL
ATE Latin1_General_CI_AS

FROM datacallAnalysis c, MsgGPRSInterLayerGMMSM d, DCA_Sessions
WHERE DCA_Sessions.SessionId = c.SessionId AND
c.SessionId = d.sessionId AND
d.parseCode = '62G1' AND -- GMM/SM L3
SUBSTRING(d.message, 7, 1) = '8' AND -- GMM
SUBSTRING(d.message, 8, 2) = '04' -- msgType = '04' (Attach Reject)
if @debug=1
BEGIN
PRINT 'GMM termination calculation finished. Duration: ' + CONVERT(varchar,Da
teDiff(s,@time,GetDate())) + ' sec'
SELECT @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- calculates the avg values for different Quality relevant values at the end of
a call
--
-- [avgRxQual] [real] NULL ,
-- [avgRxLev] [real] NULL ,
-- [avgTA] [real] NULL ,
-- [avgMsTxPwr] [real] NULL ,
-- [avgBCCHRxLev] [real] NULL ,
-- [numOfRadioValues] [int] NULL,
-- [LastRadioTimeStamp] [datetime] NULL,
-- [avgTotEcIo] [real] NULL ,
-- [avgUETxPwr] [real] NULL ,
-- [avgUERxPwr] [real] NULL ,
-- [numOfWCDMARadioValues] [int] NULL ,
-- [LastWCDMARadioTimeStamp] [datetime] NULL ,
--------------------------------------------------------------------------------
------------------------
SELECT
g.MsgId,
g.MsgTime,
g.SessionID
into #tempgsm
FROM
msgGSMLayer1 g ,
DCA_Sessions,
DataCallAnalysis a
WHERE
g.sessionId = DCA_Sessions.SessionId
and a.sessionID = g.sessionID
AND a.DisconnectTimeStamp > g.msgTime
and dateadd(s,-20,a.DisconnectTimeStamp) < g.msgTime
ORDER BY
msgId DESC
Select -- @sessionId As sessionId,
a.sessionID,
max(msgGSMLayer1.msgTime) as LastTimeStamp,
count(msgGSMLayer1.msgId) as numOfValues,
avg(convert(real,RxQualSub)) As AvgRxQual,
avg(convert(real,RxLevSub)) As AvgRxLev,
avg(convert(real,TA)) as AvgTA,
avg(convert(real,TxPwr)) as AvgMsTxPwr,
avg(convert(real,BCCH_RxLev)) as AvgBCCHRxLev
into #Tmp20
from msgGSMLayer1,
datacallanalysis a,
DCA_Sessions
where DCA_Sessions.SessionId = msgGsmLayer1.SessionId AND
a.sessionID = msgGSMLayer1.sessionID and
a.EndTechnology like 'GSM%' and
a.Status in ('Dropped','Failed') and
msgGSMLayer1.msgId IN ( SELECT TOP 8 msgId
FROM #tempgsm g
WHERE g.sessionId = a.Se
ssionId)
/* (select TOP 8 msgId
from msgGSMLayer1 g
where g.sessionId = DCA_Sessions.SessionId an
d
a.DisconnectTimeStamp > g.msgTime
order by msgId DESC)
*/
group by a.sessionID
order by a.sessionID
UPDATE datacallAnalysis
SET
LastRadioTimeStamp = #Tmp20.LastTimeStamp,
numOfRadioValues = #Tmp20.numOfValues,
AvgRxQual = #Tmp20.AvgRxQual,
AvgRxLev = #Tmp20.AvgRxLev,
AvgTA = #Tmp20.AvgTA,
AvgMsTxPwr = #Tmp20.AvgMsTxPwr,
AvgBCCHRxLev = #Tmp20.AvgBCCHRxLev
from datacallAnalysis, #tmp20
where --@sessionId = callAnalysis.sessionId AND
datacallAnalysis.sessionId = #tmp20.sessionId
Select -- @sessionId As sessionId,
a.sessionID,
max(WCDMAAGC.msgTime) as LastTimeStamp,
count(WCDMAAGC.msgId) as numOfValues,
avg(case when TxPwr > -50.0 then convert(real,TxPwr) else NULL end) as a
vgUETxPwr,
avg(case when RxPwr > -110.0 then convert(real,RxPwr) else NULL end) as
avgUERxPwr
into #Tmp21
from WCDMAAGC,
datacallanalysis a,
DCA_Sessions
where DCA_Sessions.SessionId = WCDMAAGC.SessionId AND
a.sessionID = WCDMAAGC.sessionID and
a.EndTechnology = 'UMTS' and
a.Status in ('Dropped','Failed') and
--DateDiff(s,WCDMAAGC.msgTime,a.DisconnectTimeStamp) < 5 and
--DateDiff(s,WCDMAAGC.msgTime,a.DisconnectTimeStamp) > 0
WCDMAAGC.msgId IN (select TOP 8 msgId
from WCDMAAGC g
where g.sessionId = DCA_Sessions.SessionId an
d-- ??AND RxQualSub IS NOT NULL
a.DisconnectTimeStamp > g.msgTime
order by msgId DESC)
group by a.sessionID
order by a.sessionID
Select-- @sessionId As sessionId,
a.sessionID,
avg(CASE WHEN (crcRec) > 0 then (convert(real,CRCError)/convert(real,CRC
Rec))ELSE 0 END)*100 as AvgBLER
into #Tmp22
from WCDMABLER,
datacallanalysis a,
DCA_Sessions
where DCA_Sessions.SessionId = WCDMABLER.SessionId AND
a.sessionID = WCDMABLER.sessionID and
a.EndTechnology = 'UMTS' and
a.Status in ('Dropped','Failed') and
--DateDiff(s,WCDMABLER.msgTime,a.DisconnectTimeStamp) < 5 and
--DateDiff(s,WCDMABLER.msgTime,a.DisconnectTimeStamp) > 0
WCDMABLER.msgId IN (select TOP 4 msgId
from WCDMABLER g
where g.sessionId = DCA_Sessions.SessionId a
nd
a.DisconnectTimeStamp > g.msgTime
order by msgId DESC)
group by a.sessionID
order by a.sessionID
CREATE TABLE #tmpSess_23 (
[MsgId] [bigint] NOT NULL ,
[SessionId] [bigint] NOT NULL
)
Declare @sessionId_23 as bigint
Declare sCursor Cursor fOR
Select Distinct d.SessionId
from DataCallAnalysis d
JOIN WCDMAActiveSet w ON w.SessionId = d.SessionId
JOIN DCA_Sessions c ON c.SessionId = d.SessionId
Open sCursor
Fetch Next from sCursor
into @sessionId_23
while @@FETCH_STATUS = 0
begin
Insert Into #tmpSess_23
Select Top 8 g.MsgId, g.SessionId
from WCDMAActiveSet g
JOIN datacallanalysis a ON a.SessionId = g.SessionId
where a.SessionId = @sessionId_23 and
a.DisconnectTimeStamp > g.msgTime
order by g.MsgId desc

Fetch Next from sCursor
into @sessionId_23
end
Close sCursor
Deallocate sCursor
Select a.sessionID,
Avg(case when AggrEcIo > -30 then AggrEcIo else NULL end) as AvgTotEcIo
into #Tmp23
from WCDMAActiveSet w
JOIN DatacallAnalysis a ON a.SessionId = w.SessionId
JOIN #tmpSess_23 t ON t.SessionId = w.SessionId
where a.EndTechnology = 'UMTS' AND
a.Status in ('Dropped','Failed') and
w.msgId = t.MsgId
group by a.sessionID
order by a.sessionID
drop table #tmpSess_23
UPDATE datacallAnalysis
SET
LastWCDMARadioTimeStamp = #Tmp21.LastTimeStamp,
numOfWCDMARadioValues = #Tmp21.numOfValues,
AvgUETxPwr = #Tmp21.AvgUETxPwr,
AvgUERxPwr = #Tmp21.AvgUERxPwr
from datacallAnalysis, #tmp21
where --@sessionId = callAnalysis.sessionId AND
datacallAnalysis.sessionId = #tmp21.sessionId
UPDATE datacallAnalysis
SET AvgBLER = #Tmp22.AvgBLER
from datacallAnalysis, #tmp22
where --@sessionId = callAnalysis.sessionId AND
datacallAnalysis.sessionId = #tmp22.sessionId
UPDATE datacallAnalysis
SET AvgTotEcIo = #Tmp23.AvgTotEcIo
from datacallAnalysis, #tmp23
where --@sessionId = callAnalysis.sessionId AND
datacallAnalysis.sessionId = #tmp23.sessionId
Select
a.sessionID,
max(CDMAFingerInfo.msgTime) as LastTimeStamp,
count(CDMAFingerInfo.msgId) as numOfValues,
avg(TotalEcIo) as CDMATotEcIo,
avg(RxAGC) as CDMARxAGC,
avg(TxAGC) as CDMATxPwr
into #Tmp24
from
datacallanalysis a,
CDMAFingerInfo,
DCA_Sessions
where
DCA_Sessions.SessionId = CDMAFingerInfo.SessionId AND
a.sessionID = CDMAFingerInfo.sessionID and
a.Technology = 'CDMA' and
a.Status in ('Dropped','Failed') and
CDMAFingerInfo.msgId IN (select TOP 8 msgId
from CDMAFingerInfo g
where g.sessionId = DCA_Sessions.SessionId
order by msgId DESC)
group by a.sessionID
order by a.sessionID
Select
e.sessionID,
avg( case when (b.tffch-a.tffch) <> 0.0
then (cast((b.bffch - a.bffch)as float)/cast((b.tffch-a.tffch) a
s float))*100
else NULL end) as CDMAFER
into #Tmp25
from
datacallanalysis e,
CDMAFER a,
CDMAFER b,
DCA_Sessions
where
DCA_Sessions.SessionId = e.SessionId AND
e.sessionID = b.sessionID and
e.sessionID = a.sessionID and
e.Technology = 'CDMA' and
e.Status in ('Dropped','Failed') and
b.msgID = a.msgID + 1 and
DateDiff(s,b.msgTime,e.DisconnectTimeStamp) < 10 and
DateDiff(s,b.msgTime,e.DisconnectTimeStamp) > 0
group by e.sessionID
order by e.sessionID
UPDATE datacallAnalysis
SET
LastCDMARadioTimeStamp = #Tmp24.LastTimeStamp,
numOfCDMARadioValues = #Tmp24.numOfValues,
AvgCDMATotEcIo = #Tmp24.CDMATotEcIo,
AvgCDMATxPwr = #Tmp24.CDMATxPwr,
AvgCDMAAGC = #Tmp24.CDMARxAGC
from datacallAnalysis, #tmp24
where
datacallAnalysis.sessionId = #tmp24.sessionId
UPDATE datacallAnalysis
SET
AvgCDMAFER = #Tmp25.CDMAFER
from datacallAnalysis, #tmp25
where
datacallAnalysis.sessionId = #tmp25.sessionId
drop table #Tmp20
drop table #Tmp21
drop table #Tmp22
drop table #Tmp23
drop table #Tmp24
drop table #Tmp25
drop table #tempgsm
if @debug=1
BEGIN
PRINT 'Call Quality at end finished. Duration: ' + CONVERT(varchar,DateDiff(s
,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- L3 Event Counter
-- This Query counts the relevant events (SM,GMM, MM, RR(C)) for session progres
s
-- Result stored in #datacallAnalysisSetupInfo
--------------------------------------------------------------------------------
------------------------
Select e.SessionId as sessionId,
sum(case when (d.msgTypeTxt = 'Deactivate PDP context accept') AND (d.Ms
gTime <= e.ConnectTimeStamp) then 1 else 0 end) As DeactivationAccept,
sum(case when (d.msgTypeTxt = 'Deactivate PDP context request') AND (d.M
sgTime <= e.ConnectTimeStamp) then 1 else 0 end) As DeactivationRequest,
sum(case when (d.msgTypeTxt = 'SM Status') AND (d.MsgTime <= e.ConnectTi
meStamp) then 1 else 0 end) As SMStatus,
sum(case when (d.msgTypeTxt = 'Activate PDP context accept') AND (d.MsgT
ime <= e.ConnectTimeStamp) then 1 else 0 end) As PDPContextaccept,
sum(case when (d.msgTypeTxt = 'Activate PDP context reject') AND (d.MsgT
ime <= e.ConnectTimeStamp) then 1 else 0 end) As PDPContextReject,
sum(case when (d.msgTypeTxt = 'Activate PDP context request') AND (d.Msg
Time <= e.ConnectTimeStamp) then 1 else 0 end) As PDPContextRequest,
sum(case when (d.msgTypeTxt = 'Service Accept') AND (d.MsgTime <= e.Conn
ectTimeStamp) then 1 else 0 end) as ServiceAccept,
sum(case when (d.msgTypeTxt = 'Service Reject') AND (d.MsgTime <= e.Conn
ectTimeStamp) then 1 else 0 end) as ServiceReject,
sum(case when (d.msgTypeTxt = 'Service Request') AND (d.MsgTime <= e.Con
nectTimeStamp) then 1 else 0 end) as ServiceRequest,
sum(case when (d.msgTypeTxt = 'Detach accept') AND (dateadd(s,5,e.StartT
imeStamp) <= d.MsgTime )AND (d.MsgTime <= e.ConnectTimeStamp) then 1 else 0 end)
As DetachAccept,
sum(case when (d.msgTypeTxt = 'Detach request') AND (dateadd(s,5,e.Start
TimeStamp) <= d.MsgTime ) AND (d.MsgTime <= e.ConnectTimeStamp) then 1 else 0 e
nd) As DetachRequest,
-- initil detach necessary for attach test
sum(case when (d.msgTypeTxt = 'Attach complete') AND (d.MsgTime <= e.Con
nectTimeStamp) then 1 else 0 end) As AttachComplete,
sum(case when (d.msgTypeTxt = 'Attach accept') AND (d.MsgTime <= e.Conne
ctTimeStamp) then 1 else 0 end) As AttachAccept,
sum(case when (d.msgTypeTxt = 'Attach reject') AND (d.MsgTime <= e.Conne
ctTimeStamp) then 1 else 0 end) As AttachReject,
sum(case when (d.msgTypeTxt = 'Attach request') AND (d.MsgTime <= e.Conn
ectTimeStamp) then 1 else 0 end) As AttachRequest
into #datacallAnalysisSetupInfo
from vGPRSInterLayerGMMSM d,datacallAnalysis e,DCA_Sessions
where DCA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.Status = 'Failed'
group by
e.SessionId
order by
e.sessionID
if @debug=1
BEGIN
PRINT 'General Setup events count. Duration: ' + CONVERT(varchar,DateDiff(s,@
time,GetDate())) + ' sec'
Select @time = GetDate()
END
Select e.SessionId as sessionId,
sum(case when (d.msgTypeTxt = 'Deactivate PDP context accept') AND (e.la
stIRATChange <= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else
0 end) As DeactivationAccept,
sum(case when (d.msgTypeTxt = 'Deactivate PDP context request') AND (e.l
astIRATChange <= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else
0 end) As DeactivationRequest,
sum(case when (d.msgTypeTxt = 'SM Status') AND (e.lastIRATChange <= d.Ms
gTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As SMStatus,
sum(case when (d.msgTypeTxt = 'Activate PDP context accept') AND (e.last
IRATChange <= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0
end) As PDPContextaccept,
sum(case when (d.msgTypeTxt = 'Activate PDP context reject') AND (e.last
IRATChange <= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0
end) As PDPContextReject,
sum(case when (d.msgTypeTxt = 'Activate PDP context request') AND (e.las
tIRATChange <= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0
end) As PDPContextRequest,
sum(case when (d.msgTypeTxt = 'Service Accept') AND (e.lastIRATChange <=
d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) as Servi
ceAccept,
sum(case when (d.msgTypeTxt = 'Service Reject') AND (e.lastIRATChange <=
d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) as Servi
ceReject,
sum(case when (d.msgTypeTxt = 'Service Request') AND (e.lastIRATChange <
= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) as Serv
iceRequest,
sum(case when (d.msgTypeTxt = 'Attach complete') AND (e.lastIRATChange <
= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As Atta
chComplete,
sum(case when (d.msgTypeTxt = 'Attach accept') AND (e.lastIRATChange <=
d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As Attach
Accept,
sum(case when (d.msgTypeTxt = 'Attach reject') AND (e.lastIRATChange <=
d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As Attach
Reject,
sum(case when (d.msgTypeTxt = 'Attach request') AND (e.lastIRATChange <=
d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As Attac
hRequest,
sum(case when (d.msgTypeTxt = 'Detach accept') AND (e.lastIRATChange <=
d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As Detach
Accept,
sum(case when (d.msgTypeTxt = 'Detach request') AND (e.lastIRATChange <=
d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As Detac
hRequest,
sum(case when (d.msgTypeTxt = 'Routing area update request') AND (e.last
IRATChange <= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0
end) As RARequest,
sum(case when (d.msgTypeTxt = 'Routing area update accept') AND (e.lastI
RATChange <= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 e
nd) As RAAccept,
sum(case when (d.msgTypeTxt = 'Routing area update reject') AND (e.lastI
RATChange <= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 e
nd) As RAReject,
sum(case when (d.msgTypeTxt = 'Routing area update complete') AND (e.las
tIRATChange <= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0
end) As RAComplete
into #datacallAnalysisSessionInfo
from vGPRSInterLayerGMMSM d,datacallAnalysis e,DCA_Sessions
where DCA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.Status = 'Dropped'
group by
e.SessionId
order by
e.sessionID
Select e.SessionId as sessionId,
sum(case when (d.Msg = 'Location Updating Request') AND (e.lastIRATChang
e <= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As L
URequest,
sum(case when (d.Msg = 'Location Updating Accept') AND (e.lastIRATChange
<= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As LU
Accept,
sum(case when (d.Msg = 'Location Updating Reject') AND (e.lastIRATChange
<= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As LU
Reject
into #datacallAnalysisSessionInfoMM
from vMsgGSML3Data d,datacallAnalysis e,DCA_Sessions
where DCA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.Status = 'Dropped'
group by
e.SessionId
order by
e.sessionID
if @debug=1
BEGIN
PRINT 'General Session events count. Duration: ' + CONVERT(varchar,DateDiff(s
,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
Select e.SessionId as sessionId,
sum(case when (dbo.HexToInt(substring(message,2,2)) & 0xE0 = 0xE0) AND (
d.MsgTime <= e.ConnectTimeStamp) then 1 else 0 end) as ChannelRequest -- no req
for TBF
into #datacallAnalysisSetupChnReq
from MsgGSMData d,datacallAnalysis e,DCA_Sessions
where DCA_Sessions.sessionId = e.sessionId AND
d.parseCode = '62A' and
e.SessionId = d.SessionId AND
e.Status = 'Failed' AND
e.startTechnology = 'GSM'
group by
e.SessionId
Select e.SessionId as sessionId,
sum(case when (d.Msg = 'Immediate Assignment') AND (d.MsgTime <= e.Conne
ctTimeStamp) AND ((dbo.HexToInt(substring(d.L3Data,1,2)) & 0x10 = 0)) then 1 els
e 0 end) As ImmASS, -- Only Dedicated Channels
sum(case when (d.Msg = 'Immediate Assignment Reject') AND (d.MsgTime <=
e.ConnectTimeStamp) then 1 else 0 end) As ImmAssRej
into #datacallAnalysisSetupInfoGSM
from vmsgGSML3Data d,datacallAnalysis e,DCA_Sessions
where DCA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.Status = 'Failed' AND
e.startTechnology = 'GSM'
group by
e.SessionId
Select e.SessionId as sessionId,
sum(case when (d.Msg = 'Immediate Assignment') AND (e.lastIRATChange <=
d.MsgTime)AND (d.MsgTime <= e.DisconnectTimeStamp) AND ((dbo.HexToInt(substring(
d.L3Data,1,2)) & 0x10 = 0)) then 1 else 0 end) As ImmASS, -- Only Dedicated Chan
nels
sum(case when (d.Msg = 'Immediate Assignment Reject') AND (e.lastIRATCha
nge <= d.MsgTime)AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As
ImmAssRej
into #datacallAnalysisSessionInfoGSM
from vmsgGSML3Data d,datacallAnalysis e,DCA_Sessions
where DCA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.Status = 'Dropped' AND
e.startTechnology = 'GSM'
group by
e.SessionId
if @debug=1
BEGIN
PRINT 'GSM Setup events count. Duration: ' + CONVERT(varchar,DateDiff(s,@time
,GetDate())) + ' sec'
Select @time = GetDate()
END
Select e.sessionId as sessionId,
sum(case when (d.MsgType = 'RRCConnectionSetupComplete') AND (dateadd(s,
5,e.StartTimeStamp) <= d.MsgTime ) AND (d.MsgTime <= e.ConnectTimeStamp) then 1
else 0 end) As RRCConnSetupComplete,
sum(case when (d.MsgType = 'RRCConnectionSetup') AND (dateadd(s,5,e.Star
tTimeStamp) <= d.MsgTime ) AND (d.MsgTime <= e.ConnectTimeStamp) then 1 else 0 e
nd) As RRCConnSetup,
sum(case when (d.MsgType = 'RRCConnectionReject') AND (dateadd(s,5,e.Sta
rtTimeStamp) <= d.MsgTime ) AND (d.MsgTime <= e.ConnectTimeStamp) then 1 else 0
end) As RRCConnRej,
sum(case when (d.MsgType = 'RRCConnectionRequest') AND (dateadd(s,5,e.St
artTimeStamp) <= d.MsgTime ) AND (d.MsgTime <= e.ConnectTimeStamp) then 1 else 0
end) As RRCConnReq,
sum(case when (d.MsgType = 'RadioBearerSetup') AND (d.MsgTime <= e.Conne
ctTimeStamp) then 1 else 0 end) As RBSetup,
sum(case when (d.MsgType = 'RadioBearerSetupComplete') AND (d.MsgTime <=
e.ConnectTimeStamp) then 1 else 0 end) As RBSetupCmpl,
sum(case when (d.MsgType = 'RadioBearerSetupFailure') AND (d.MsgTime <=
e.ConnectTimeStamp) then 1 else 0 end) As RBSetupFail
into #datacallAnalysisSetupInfoUMTS
from WCDMARRCMessages d,datacallAnalysis e,DCA_Sessions
where DCA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.Status = 'Failed'
group by
e.SessionId
Select e.sessionId as sessionId,
sum(case when (d.MsgType = 'RRCConnectionSetupComplete') AND (e.lastIRAT
Change <= d.MsgTime)AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end)
As RRCConnSetupComplete,
sum(case when (d.MsgType = 'RRCConnectionSetup') AND (e.lastIRATChange <
= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As RRCC
onnSetup,
sum(case when (d.MsgType = 'RRCConnectionReject') AND (e.lastIRATChange
<= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As RRC
ConnRej,
sum(case when (d.MsgType = 'RRCConnectionRequest') AND (e.lastIRATChange
<= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As RR
CConnReq,
sum(case when (d.MsgType = 'RadioBearerSetup') AND (e.lastIRATChange <=
d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As RBSetu
p,
sum(case when (d.MsgType = 'RadioBearerSetupComplete') AND (e.lastIRATCh
ange <= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) A
s RBSetupCmpl,
sum(case when (d.MsgType = 'RadioBearerSetupFailure') AND (e.lastIRATCha
nge <= d.MsgTime) AND (d.MsgTime <= e.DisconnectTimeStamp) then 1 else 0 end) As
RBSetupFail
into #datacallAnalysisSessionInfoUMTS
from WCDMARRCMessages d,datacallAnalysis e,DCA_Sessions
where DCA_Sessions.sessionId = e.sessionId AND
e.SessionId = d.SessionId AND
e.Status = 'Dropped'
group by
e.SessionId
if @debug=1
BEGIN
PRINT 'UMTS Setup events count. Duration: ' + CONVERT(varchar,DateDiff(s,@tim
e,GetDate())) + ' sec'
Select @time = GetDate()
END
Update DataCallAnalysis
set NumDeactivationAccept = DeactivationAccept,
NumDeactivationRequest = DeactivationRequest,
NumSMStatus = SMStatus,
NumPDPContextaccept = PDPContextaccept,
NumPDPContextReject = PDPContextReject,
NumPDPContextRequest = PDPContextRequest,
NumServiceAccept = ServiceAccept,
NumServiceReject = ServiceReject,
NumServiceRequest = ServiceRequest,
NumDetachRequest = DetachRequest,
NumDetachAccept = DetachAccept,
NumAttachComplete = AttachComplete,
NumAttachReject = AttachReject,
NumAttachRequest = AttachRequest
from #datacallAnalysisSetupInfo
where #datacallAnalysisSetupInfo.sessionID = DataCallAnalysis.sessionID
Update DataCallAnalysis
set NumDeactivationAccept = DeactivationAccept,
NumDeactivationRequest = DeactivationRequest,
NumSMStatus = SMStatus,
NumPDPContextaccept = PDPContextaccept,
NumPDPContextReject = PDPContextReject,
NumPDPContextRequest = PDPContextRequest,
NumServiceAccept = ServiceAccept,
NumServiceReject = ServiceReject,
NumServiceRequest = ServiceRequest,
NumAttachComplete = AttachComplete,
NumAttachAccept = AttachAccept,
NumAttachReject = AttachReject,
NumAttachRequest = AttachRequest,
NumDetachRequest = DetachRequest,
NumDetachAccept = DetachAccept,
NumRARequest = RARequest,
NumRAAccept = RAAccept,
NumRAComplete = RAComplete,
NumRAReject = RAReject
from #datacallAnalysisSessionInfo
where #datacallAnalysisSessionInfo.sessionID = DataCallAnalysis.sessionID
Update DataCallAnalysis
set NumLURequest = LURequest,
NumLUAccept = LUAccept,
NumLUReject = LUReject
from #datacallAnalysisSessionInfoMM
where #datacallAnalysisSessionInfoMM.sessionID = DataCallAnalysis.sessionID
Update DataCallAnalysis
set numChnReq = ChannelRequest
from #datacallAnalysisSetupChnReq
where #datacallAnalysisSetupChnReq.sessionID = DataCallAnalysis.sessionID
Update DataCallAnalysis
set numImmASS = ImmASS,
numImmAssRej = ImmAssRej
from #datacallAnalysisSetupInfoGSM
where #datacallAnalysisSetupInfoGSM.sessionID = DataCallAnalysis.sessionID
Update DataCallAnalysis
set numImmASS = ImmASS,
numImmAssRej = ImmAssRej
from #datacallAnalysisSessionInfoGSM
where #datacallAnalysisSessionInfoGSM.sessionID = DataCallAnalysis.sessionID
Update DataCallAnalysis
set numRRCConnSetupComplete = RRCConnSetupComplete,
numRRCConnSetup = RRCConnSetup,
numRRCConnRej = RRCConnRej,
numRRCConnReq = RRCConnReq,
numRBSetup = RBSetup,
numRBSetupCmpl = RBSetupCmpl,
numRBSetupFail = RBSetupFail
from #datacallAnalysisSetupInfoUMTS
where #datacallAnalysisSetupInfoUMTS.sessionID = DataCallAnalysis.sessionID
Update DataCallAnalysis
set numRRCConnSetupComplete = RRCConnSetupComplete,
numRRCConnSetup = RRCConnSetup,
numRRCConnRej = RRCConnRej,
numRRCConnReq = RRCConnReq,
numRBSetup = RBSetup,
numRBSetupCmpl = RBSetupCmpl,
numRBSetupFail = RBSetupFail
from #datacallAnalysisSessionInfoUMTS
where #datacallAnalysisSessionInfoUMTS.sessionID = DataCallAnalysis.sessionID
drop table #datacallAnalysisSetupInfo
drop table #datacallAnalysisSessionInfo
drop table #datacallAnalysisSetupChnReq
drop table #datacallAnalysisSetupInfoGSM
drop table #datacallAnalysisSessionInfoGSM
drop table #datacallAnalysisSetupInfoUMTS
drop table #datacallAnalysisSessionInfoUMTS
drop table #datacallAnalysisSessionInfoMM
UPDATE datacallAnalysis SET NumDeactivationAccept = 0 where NumDeactivationA
ccept is NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT Sessio
nId from DCA_Sessions)
UPDATE datacallAnalysis SET NumDeactivationRequest = 0 where NumDeactivationR
equest is NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT Sessi
onId from DCA_Sessions)
UPDATE datacallAnalysis SET NumSMStatus = 0 where NumSMStatus is N
ULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from D
CA_Sessions)
UPDATE datacallAnalysis SET NumPDPContextaccept = 0 where NumPDPContextacc
ept is NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionI
d from DCA_Sessions)
UPDATE datacallAnalysis SET NumPDPContextReject = 0 where NumPDPContextRej
ect is NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionI
d from DCA_Sessions)
UPDATE datacallAnalysis SET NumPDPContextRequest = 0 where NumPDPContextReq
uest is NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT Session
Id from DCA_Sessions)
UPDATE datacallAnalysis SET NumServiceAccept = 0 where NumServiceAccept
is NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId f
rom DCA_Sessions)
UPDATE datacallAnalysis SET NumServiceReject = 0 where NumServiceReject
is NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId f
rom DCA_Sessions)
UPDATE datacallAnalysis SET NumServiceRequest = 0 where NumServiceReques
t is NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId
from DCA_Sessions)
UPDATE datacallAnalysis SET NumAttachAccept = 0 where NumAttachAccept
is NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId fr
om DCA_Sessions)
UPDATE datacallAnalysis SET NumAttachReject = 0 where NumAttachReject
is NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId fr
om DCA_Sessions)
UPDATE datacallAnalysis SET NumAttachRequest = 0 where NumAttachRequest
is NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId f
rom DCA_Sessions)
UPDATE datacallAnalysis SET NumLURequest = 0 where NumLURequest is
NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from
DCA_Sessions)
UPDATE datacallAnalysis SET NumLUAccept = 0 where NumLUAccept is N
ULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from D
CA_Sessions)
UPDATE datacallAnalysis SET NumLUReject = 0 where NumLUReject is N
ULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from D
CA_Sessions)
UPDATE datacallAnalysis SET NumRARequest = 0 where NumRARequest is
NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from
DCA_Sessions)
UPDATE datacallAnalysis SET NumRAAccept = 0 where NumRAAccept is N
ULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from D
CA_Sessions)
UPDATE datacallAnalysis SET NumRAReject = 0 where NumRAReject is N
ULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from D
CA_Sessions)
UPDATE datacallAnalysis SET numImmASS = 0 where numImmASS IS NUL
L AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from DCA
_Sessions)
UPDATE datacallAnalysis SET numImmAssRej = 0 where numImmAssRej IS
NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from
DCA_Sessions)
UPDATE datacallAnalysis SET numChnRelCallSetup = 0 where numChnRelCallSet
up IS NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId
from DCA_Sessions)
UPDATE datacallAnalysis SET numChnRel = 0 where numChnRel IS NUL
L AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from DCA
_Sessions)
UPDATE datacallAnalysis SET numRRCConnSetup = 0 where numRRCConnSetup
IS NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId fr
om DCA_Sessions)
UPDATE datacallAnalysis SET numRRCConnRej = 0 where numRRCConnRej IS
NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from
DCA_Sessions)
UPDATE datacallAnalysis SET numRRCConnRel = 0 where numRRCConnRel IS
NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from
DCA_Sessions)
UPDATE datacallAnalysis SET numRBSetup = 0 where numRBSetup IS NU
LL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from DC
A_Sessions)
UPDATE datacallAnalysis SET numRBSetupCmpl = 0 where numRBSetupCmpl I
S NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId fro
m DCA_Sessions)
UPDATE datacallAnalysis SET numRBSetupFail = 0 where numRBSetupFail I
S NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId fro
m DCA_Sessions)
UPDATE datacallAnalysis SET numDCCH2GTrial = 0 where numDCCH2GTrial I
S NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId fro
m DCA_Sessions)
UPDATE datacallAnalysis SET numDCCH2GSuccess = 0 where numDCCH2GSuccess
IS NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId f
rom DCA_Sessions)
UPDATE datacallAnalysis SET numTCHTrial = 0 where numTCHTrial IS N
ULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from D
CA_Sessions)
UPDATE datacallAnalysis SET numTCHSuccess = 0 where numTCHSuccess IS
NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from
DCA_Sessions)
UPDATE datacallAnalysis SET numRABTrial = 0 where numRABTrial IS N
ULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from D
CA_Sessions)
UPDATE datacallAnalysis SET numRABSuccess = 0 where numRABSuccess IS
NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from
DCA_Sessions)
UPDATE datacallAnalysis SET numGMMMessages = 0 where numGMMMessages I
S NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId fro
m DCA_Sessions)
UPDATE datacallAnalysis SET numSMSMessages = 0 where numSMSMessages I
S NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId fro
m DCA_Sessions)
UPDATE datacallAnalysis SET numMMMessages = 0 where numMMMessages IS
NULL AND status <> 'Completed' and SessionId in (SELECT DISTINCT SessionId from
DCA_Sessions)
if @debug=1
BEGIN
PRINT 'Call Setup events count. Duration: ' + CONVERT(varchar,DateDiff(s,@tim
e,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- check for Layer 3 Messages
-- [Layer3Messages] [int] NULL
--------------------------------------------------------------------------------
------------------------
Update DataCallAnalysis
set Layer3Messages = 1
from
MsgGSMReport d,
DCA_Sessions s
where
s.sessionID = d.sessionID and
DataCallAnalysis.sessionID = d.sessionID
Update DataCallAnalysis
set Layer3Messages = 1
from
WCDMARRCMessages d,
DCA_Sessions s
where
s.sessionID = d.sessionID and
DataCallAnalysis.sessionID = d.sessionID
Update DataCallAnalysis
set Layer3Messages = 1
from
MsgCDMALayer3 d,
DCA_Sessions s
where
s.sessionID = d.sessionID and
DataCallAnalysis.sessionID = d.sessionID
Update DataCallAnalysis
set Layer3Messages = 1
from
MsgEVDOLayer3 e,
DCA_Sessions s
where
s.sessionID = e.sessionID and
DataCallAnalysis.sessionID = e.sessionID
UPDATE DatacallAnalysis
SET Layer3Messages = 0
where Layer3Messages IS NULL and
SessionId in (SELECT DISTINCT SessionId from DCA_Sessions)
if @debug=1
BEGIN
PRINT 'Layer 3 check finished. Duration: ' + CONVERT(varchar,DateDiff(s,@time
,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- check for Failed Attach
-- [AttachTestFailed] [int] NULL
--------------------------------------------------------------------------------
------------------------
UPDATE DataCallAnalysis
set AttachTestFailed = 1
from MsgLogTrace,
DCA_Sessions s
where
s.sessionID = DataCallAnalysis.sessionID and
MsgLogTrace.sessionID = DataCallAnalysis.sessionID and
DataCallAnalysis.status = 'Failed' and
substring(MsgLogTrace.info,1,24) = 'RESULT GPRSAttach Failed'
UPDATE DataCallAnalysis
SET AttachTestFailed = 0
where AttachTestFailed is NULL and
SessionId in (SELECT DISTINCT SessionId from DCA_Sessions)
if @debug=1
BEGIN
PRINT 'Failed Attach Test check finished. Duration: ' + CONVERT(varchar,DateD
iff(s,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
--------------------------------------------------------------------------------
------------------------
-- originating interactive Call
-- [RRCConnReqforDataCall] [int] NULL
--------------------------------------------------------------------------------
------------------------
select r.SessionId,
r.establishmentCause
into #tmpEstCause
from vRRCEstablishmentCause r
JOIN DCA_Sessions s ON s.SessionId = r.SessionId
update DataCallAnalysis
set RRCConnReqforDataCall = 1
from #tmpEstCause t
where DataCallAnalysis.status = 'Failed' and
t.SessionId = DataCallAnalysis.SessionId and
t.establishmentCause in ('originatingInteractiveCall')
drop table #tmpEstCause
UPDATE DataCallAnalysis
SET RRCConnReqforDataCall = 0
where RRCConnReqforDataCall is NULL and
SessionId in (SELECT DISTINCT SessionId from DCA_Sessions)
if @debug=1
BEGIN
PRINT 'Establishment Cause check finished. Duration: ' + CONVERT(varchar,Date
Diff(s,@time,GetDate())) + ' sec'
Select @time = GetDate()
END
UPDATE datacallAnalysis
set code = 'S'
from DCA_Sessions
where datacallAnalysis.sessionId = DCA_Sessions.sessionId
drop table DCA_Sessions
END
GO
--------------------------------------------------------------------------------
--
--------------------------------------------------------------------------------
--
CREATE PROCEDURE sqDataCallAnalysisCode
@poorRxLev real, -- avg of the last 8 RxLev or avgBCCHRxLev value
s before call end
@noL3Duration int, -- duration of no l3 data received (in seconds)
@BLERThreshold int,
@UEEcIoThreshold int,
@UERxLevThreshold int,
@copyComment int,
@copyRoamingInfo int,
@RecalcSessionId bigint = 0, -- sessionid is only supported when changing ca
ll status (in DataSelection)
@mode int = 0
AS
BEGIN
--------------------------------------------------------------------------------
------------------------
-- Data Call Analysis Code Calculation
-- Calculates the call code based on the information stored in the table 'CallAn
alysis'
--
-- Version: 2.50
-- Written by: A.Hellenbart
-- Last change: 17.06.2008
--------------------------------------------------------------------------------
------------------------
--------------------------------------------------------------------------------
------------------------
-- Generate a list with Sessions where a calculation is needed
--------------------------------------------------------------------------------
------------------------
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DCAC_Sessi
ons]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[DCAC_Sessio
ns]
CREATE TABLE [dbo].[DCAC_Sessions] (
[SessionId] [bigint] NOT NULL
) ON [MainGroup]
CREATE UNIQUE CLUSTERED INDEX [IX_DCAC_Sessions_1] ON [dbo].[DCAC_Sessions]([Ses
sionId]) ON [MainGroup]
INSERT INTO DCAC_Sessions
SELECT DISTINCT s.SessionId
FROM Sessions s
WHERE s.sessionType = 'DATA' and
s.valid = 1 and
((@mode = 0) or
(@mode = 1 and s.sessionID in (select l.sessionID from sessionlist l)) o
r
(@mode = 2 and s.sessionID = @RecalcSessionId))
IF (Select Count(SessionId) from DCAC_Sessions) = 0
BEGIN
DROP TABLE DCAC_Sessions
Return
END
--------------------------------------------------------------------------------
------------------------
-- Eliminate NULL values in print fields
--------------------------------------------------------------------------------
------------------------
UPDATE DataCallAnalysis set PDPDeactCause = '' WHERE PDPDeactCause is
NULL and SessionId in (Select SessionId from DCAC_Sessions)
UPDATE DataCallAnalysis set PDPActRejCause = '' WHERE PDPActRejCause is
NULL and SessionId in (Select SessionId from DCAC_Sessions)
UPDATE DataCallAnalysis set SMStatusCause = '' WHERE SMStatusCause is
NULL and SessionId in (Select SessionId from DCAC_Sessions)
UPDATE DataCallAnalysis set DetachCause = '' WHERE DetachCause is
NULL and SessionId in (Select SessionId from DCAC_Sessions)
UPDATE DataCallAnalysis set RARejectCause = '' WHERE RARejectCause is
NULL and SessionId in (Select SessionId from DCAC_Sessions)
UPDATE DataCallAnalysis set AttachRejectCause = '' WHERE AttachRejectCause is
NULL and SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- reset CallAnalysis code
--------------------------------------------------------------------------------
------------------------
Update DataCallAnalysis
Set code = '',
codeDescription = ''
where (code = 'S' -- to check if the spCallAnalysis is done. Code is set to 'S'
as soon as it is scanned
OR code LIKE 'D%') and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Init DB
--------------------------------------------------------------------------------
------------------------
--******************************************************************************
************************
-- System Release DataSessions 'D0.XX'
--******************************************************************************
************************
Update DataCallAnalysis
Set code = 'D0.01',
codeDescription = 'System Release'
where Status = 'System Release' and
SessionId in (Select SessionId from DCAC_Sessions)
--******************************************************************************
************************
-- Completed DataSessions 'D1.XX'
--******************************************************************************
************************
-- Duration >= @normalCallDuration
Update DataCallAnalysis
Set code = 'D1.',
codeDescription = 'Completed'
where code = '' AND -- only calls th
at are not calculated
Status = 'Completed' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Normal session
-- Identification: D1.00
--
UPDATE DataCallAnalysis
Set code = code + '00',
codeDescription = codeDescription + case when PDPDeactCause = '' then ''
else', ('+ PDPDeactCause+')' end
where code = 'D1.' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Normal session with reduced performance
-- Identification: D1.10
--
UPDATE DataCallAnalysis
Set code = code + '10',
codeDescription = codeDescription + ', session with reduced performance'
where code = 'D1.' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Normal tests with reduced performance
-- Identification: D.11
--
UPDATE DataCallAnalysis
Set code = code + '11',
codeDescription = codeDescription + ', tests with reduced performance'
where code = 'D1.' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Completed Session
-- Identification: D1.99
--
UPDATE DataCallAnalysis
Set code = code + '99',
codeDescription = codeDescription + ', Others'
where Code = 'D1.' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
--******************************************************************************
************************
-- Dropped Sessions 'D2.XX'
--******************************************************************************
************************
Update DataCallAnalysis
Set code = 'D2.',
codeDescription = 'Dropped'
where code = '' AND
Status = 'Dropped' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.98
-- No Layer3 Messages
--
UPDATE DataCallAnalysis
Set code = code + '98',
codeDescription = codeDescription + ', No Layer 3 Messages'
where Code = 'D2.' AND
Layer3Messages = 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.11
-- DL PDP Deact received
--
UPDATE DataCallAnalysis
Set code = code + '11',
codeDescription = codeDescription + ', PDP Context Deactivation Request b
y Network, (' + PDPDeactCause + ')'
where code = 'D2.' AND
NumDeactivationRequest > 0 and
PDPDeactDirection = 'D' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.12
-- DL PDP Deact sent
--
UPDATE DataCallAnalysis
Set code = code + '12',
codeDescription = codeDescription + ', PDP Context Deactivation Request b
y Device, (' + PDPDeactCause + ')'
where code = 'D2.' AND
NumDeactivationRequest > 0 and
PDPDeactDirection = 'U' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.02
-- PDP Context Cleared
--
UPDATE DataCallAnalysis
Set code = code + '02',
codeDescription = codeDescription + ', SM Status Message received, ('+ SM
StatusCause + ')'
where code = 'D2.' AND -- no other code
NumSMStatus > 0 and SMStatusDirection = 'D' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.03
-- PDP Context Cleared
--
UPDATE DataCallAnalysis
Set code = code + '03',
codeDescription = codeDescription + ', SM Status Message sent, ('+ SMStat
usCause + ')'
where code = 'D2.' AND -- no other code
NumSMStatus > 0 and SMStatusDirection = 'U' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.40
-- Routing Area Update Rejected
--
UPDATE DataCallAnalysis
Set code = code + '40',
codeDescription = codeDescription + ', Routing Area Update Rejected, (' +
RARejectCause + ')'
where code = 'D2.' AND
NumRAReject > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.38
-- Detach Requested by Phone
--
UPDATE DataCallAnalysis
Set code = code + '38',
codeDescription = codeDescription + ', Detach Requested by Phone'
where code = 'D2.' AND -- no other code
NumDetachRequest > 0 and DetachDirection = 'U' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.39
-- Detach Requested by Phone
--
UPDATE DataCallAnalysis
Set code = code + '39',
codeDescription = codeDescription + ', Detach Requested by Network, ('+ D
etachCause + ')'
where code = 'D2.' AND -- no other code
NumDetachRequest > 0 and DetachDirection = 'D' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.20
-- PDP Context Accept
--
UPDATE DataCallAnalysis
Set code = code + '20',
codeDescription = codeDescription + ', No Progress after PDP Context acce
pt'
where code = 'D2.' AND
NumPDPContextaccept > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.21
-- PDP Context Reject
--
UPDATE DataCallAnalysis
Set code = code + '21',
codeDescription = codeDescription + ', PDP Context Activation Rejected ('
+PDPActRejCause+')'
where code = 'D2.' AND
NumPDPContextReject > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.22
-- PDP Context Failed
--
UPDATE DataCallAnalysis
Set code = code + '22',
codeDescription = codeDescription + ', PDP Context Activation not answere
d'
where code = 'D2.' AND
NumPDPContextRequest > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.41
-- No Progress after Routing Area Update Complete
--
UPDATE DataCallAnalysis
Set code = code + '41',
codeDescription = codeDescription + ', No Progress after Routing Area Upd
ate Complete'
where code = 'D2.' AND
NumRAComplete > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.31
-- Service Accept
--
UPDATE DataCallAnalysis
Set code = code + '31',
codeDescription = codeDescription + ', Service Rejected'
where code = 'D2.' AND
NumServiceReject > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.30
-- Service Accept
--
UPDATE DataCallAnalysis
Set code = code + '30',
codeDescription = codeDescription + ', No Progress After Service Accept'
where code = 'D2.' AND
NumServiceAccept > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.32
-- Service Request
--
UPDATE DataCallAnalysis
Set code = code + '32',
codeDescription = codeDescription + ', Service Request failed'
where code = 'D2.' AND
NumServiceRequest > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.50
-- DCCH Setup
--
UPDATE DataCallAnalysis
Set code = code + '50',
codeDescription = codeDescription + ', No Progress After DCCH Setup'
where code = 'D2.' AND
numRRCConnSetupComplete + numImmASS > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.51
-- DCCH not Setup
--
UPDATE DataCallAnalysis
Set code = code + '51',
codeDescription = codeDescription + ', DCCH Setup not Completed'
where code = 'D2.' AND
numRRCConnSetup > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.52
-- DCCH Setup Rejected
--
UPDATE DataCallAnalysis
Set code = code + '52',
codeDescription = codeDescription + ', DCCH Setup Rejected'
where code = 'D2.' AND
numRRCConnRej + numImmAssRej > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.53
-- DCCH Setup Rejected
--
UPDATE DataCallAnalysis
Set code = code + '53',
codeDescription = codeDescription + ', No Answer to DCCH Request'
where code = 'D2.' AND
numRRCConnReq + numChnReq > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.60
-- Low RxLev
--
UPDATE DataCallAnalysis
Set code = case when code = 'D2.' then code + '60' else code end,
codeDescription = codeDescription + ', Low RxLev'
where substring(code,1,3) = 'D2.' AND
(avgRxLev <= @poorRxLev OR avgBCCHRxLev <= @poorRxLev --OR avgRxQual >= @
poorRxQual
) and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.61
-- High BLER
--
UPDATE DataCallAnalysis
Set code = case when code = 'D2.' then code + '61' else code end,
codeDescription = codeDescription + ', High BLER'
where substring(code,1,3) = 'D2.' AND
avgBLER >= @BLERThreshold and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.62
-- Low Total Ec/Io
--
UPDATE DataCallAnalysis
Set code = case when code = 'D2.' then code + '62' else code end,
codeDescription = codeDescription + ', Low Total Ec/Io'
where substring(code,1,3) = 'D2.' AND
avgTotEcIo <= @UEEcIoThreshold and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.63
-- Low UE Rx Power
--
UPDATE DataCallAnalysis
Set code = case when code = 'D2.' then code + '63' else code end,
codeDescription = codeDescription + ', Low UE Rx Power'
where substring(code,1,3) = 'D2.' AND
avgUERxPwr <= @UERxLevThreshold and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.05
-- No Service/Scanning
--
UPDATE DataCallAnalysis
Set code = code + '05',
codeDescription = codeDescription + ', No Service/Scanning'
where code = 'D2.' AND -- no other code
(NoService > 0 or Initializing > 0) and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.98
-- No Service/Scanning
--
UPDATE DataCallAnalysis
Set code = code + '98',
codeDescription = codeDescription + ', Layer 3 Gaps'
where code = 'D2.' AND -- no other code
noL3Duration > @noL3Duration and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.06
-- Successful IRAT
--
UPDATE DataCallAnalysis
Set code = code + '06',
codeDescription = codeDescription + ', Last RA Update Successful'
where code = 'D2.' AND -- no other code
NumRAComplete > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Dropped Sessions,
-- Identification: D2.99
-- others
--
UPDATE DataCallAnalysis
Set code = code + '99',
codeDescription = codeDescription + ', others '
where Code = 'D2.' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
--******************************************************************************
************************
-- Failed Sessions 'D3.XX'
--******************************************************************************
************************
UPDATE DataCallAnalysis
Set code = 'D3.',
codeDescription = 'Failed'
where code = '' and
Status = 'Failed' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.98
-- No Layer 3 Messages
--
UPDATE DataCallAnalysis
Set code = code + '98',
codeDescription = codeDescription + ', No Layer 3 Messages'
where Code = 'D3.' AND
Layer3Messages = 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.11
-- DL PDP Deact received
--
UPDATE DataCallAnalysis
Set code = code + '10',
codeDescription = codeDescription + ', PDP Context Deactivation Request b
y Network, ' + PDPDeactCause
where code = 'D3.' AND
NumDeactivationRequest > 0 and
PDPDeactDirection = 'D' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.12
-- DL PDP Deact sent
--
UPDATE DataCallAnalysis
Set code = code + '11',
codeDescription = codeDescription + ', PDP Context Deactivation Request b
y Device, ' + PDPDeactCause
where code = 'D3.' AND
NumDeactivationRequest > 0 and
PDPDeactDirection = 'U' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.20
-- PDP Context Accept
--
UPDATE DataCallAnalysis
Set code = code + '20',
codeDescription = codeDescription + ', No Progress after PDP Context acce
pt'
where code = 'D3.' AND
NumPDPContextaccept > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.02
-- PDP Context Cleared
--
UPDATE DataCallAnalysis
Set code = code + '02',
codeDescription = codeDescription + ', SM Status Message received, ('+ SM
StatusCause + ')'
where code = 'D3.' AND -- no other code
NumSMStatus > 0 and SMStatusDirection = 'D' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.03
-- PDP Context Cleared
--
UPDATE DataCallAnalysis
Set code = code + '03',
codeDescription = codeDescription + ', SM Status Message sent, ('+ SMStat
usCause + ')'
where code = 'D3.' AND -- no other code
NumSMStatus > 0 and SMStatusDirection = 'U' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D2.40
-- Routing Area Update Rejected
--
UPDATE DataCallAnalysis
Set code = code + '40',
codeDescription = codeDescription + ', Routing Area Update Rejected, (' +
RARejectCause + ')'
where code = 'D3.' AND
NumRAReject > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.38
-- Detach Requested by Phone
--
UPDATE DataCallAnalysis
Set code = code + '38',
codeDescription = codeDescription + ', Detach Requested by Phone'
where code = 'D3.' AND -- no other code
NumDetachRequest > 0 and DetachDirection = 'U' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.39
-- Detach Requested by Phone
--
UPDATE DataCallAnalysis
Set code = code + '39',
codeDescription = codeDescription + ', Detach Requested by Network, ('+ D
etachCause + ')'
where code = 'D3.' AND -- no other code
NumDetachRequest > 0 and DetachDirection = 'D' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.20
-- PDP Context Accept
--
UPDATE DataCallAnalysis
Set code = code + '20',
codeDescription = codeDescription + ', No Progress after PDP Context acce
pt'
where code = 'D3.' AND
NumPDPContextaccept > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.21
-- PDP Context Reject
--
UPDATE DataCallAnalysis
Set code = code + '21',
codeDescription = codeDescription + ', PDP Context Activation Rejected ('
+PDPActRejCause+')'
where code = 'D3.' AND
NumPDPContextReject > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.22
-- PDP Context Failed
--
UPDATE DataCallAnalysis
Set code = code + '22',
codeDescription = codeDescription + ', PDP Context Activation Request not
answered'
where code = 'D3.' AND
NumPDPContextRequest > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.41
-- No Progress after Routing Area Update Complete
--
UPDATE DataCallAnalysis
Set code = code + '41',
codeDescription = codeDescription + ', No Progress after Routing Area Upd
ate Complete'
where code = 'D3.' AND
NumRAComplete > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.31
-- Service Accept
--
UPDATE DataCallAnalysis
Set code = code + '31',
codeDescription = codeDescription + ', Service Rejected'
where code = 'D3.' AND
NumServiceReject > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D2.30
-- Service Accept
--
UPDATE DataCallAnalysis
Set code = code + '30',
codeDescription = codeDescription + ', No Progress after Service Accept'
where code = 'D3.' AND
NumServiceAccept > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.32
-- Service Request
--
UPDATE DataCallAnalysis
Set code = code + '32',
codeDescription = codeDescription + ', No Answer to Service Request'
where code = 'D3.' AND
NumServiceRequest > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.33
-- RRC Conn Request for Data Call
--
UPDATE DataCallAnalysis
Set code = code + '33',
codeDescription = codeDescription + ', RRCConnection for Data Call not es
tablished'
where code = 'D3.' AND
RRCConnReqforDataCall = 1 and numRRCConnSetupComplete = 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.34
-- No Progress after DialUp
--
UPDATE DataCallAnalysis
Set code = code + '34',
codeDescription = codeDescription + ', No Progress After DialUp'
where code = 'D3.' AND
NumAttachComplete > 0 and DialTimeStamp is not NULL and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.50
-- No Progress after Attach Complete
--
UPDATE DataCallAnalysis
Set code = code + '50',
codeDescription = codeDescription + ', No Progress after Attach Complete
(Attach test failed)'
where code = 'D3.' AND
NumAttachComplete > 0 and AttachTestFailed = 1 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.50
-- No Progress after Attach Complete
--
UPDATE DataCallAnalysis
Set code = code + '50',
codeDescription = codeDescription + ', No Progress after Attach Complete'

where code = 'D3.' AND
NumAttachComplete > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.51
-- No Progress after Attach Accept
--
UPDATE DataCallAnalysis
Set code = code + '51',
codeDescription = codeDescription + ', Attach not completed'
where code = 'D3.' AND
NumAttachAccept > 0 and NumAttachComplete = 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.52
-- Attach Reject
--
UPDATE DataCallAnalysis
Set code = code + '52',
codeDescription = codeDescription + ', Attach Reject (' + AttachRejectCau
se + ')'
where code = 'D3.' AND
NumAttachReject > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.53
-- Attach Request not answered
--
UPDATE DataCallAnalysis
Set code = code + '53',
codeDescription = codeDescription + ', Attach Request not answered'
where code = 'D3.' AND
NumAttachRequest > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.60
-- DCCH Setup
--
UPDATE DataCallAnalysis
Set code = code + '60',
codeDescription = codeDescription + ', No Progress After DCCH Setup'
where code = 'D3.' AND
numRRCConnSetupComplete + numImmASS > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.62
-- DCCH Setup Rejected
--
UPDATE DataCallAnalysis
Set code = code + '62',
codeDescription = codeDescription + ', DCCH Setup Rejected'
where code = 'D3.' AND
numRRCConnRej + numImmAssRej > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.61
-- DCCH not Setup
--
UPDATE DataCallAnalysis
Set code = code + '61',
codeDescription = codeDescription + ', DCCH Setup not Completed'
where code = 'D3.' AND
numRRCConnSetup > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.63
-- No Answer to DCCH Setup
--
UPDATE DataCallAnalysis
Set code = code + '63',
codeDescription = codeDescription + ', No Answer to DCCH Request'
where code = 'D3.' AND
numRRCConnReq + numChnReq > 0 and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.70
-- Low RxLev
--
UPDATE DataCallAnalysis
Set code = case when code = 'D3.' then code + '70' else code end,
codeDescription = codeDescription + ', Low RxLev'
where substring(code,1,3) = 'D3.' AND
(avgRxLev <= @poorRxLev OR
avgBCCHRxLev <= @poorRxLev
--OR avgRxQual >= @poorRxQual
) and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.71
-- High BLER
--
UPDATE DataCallAnalysis
Set code = case when code = 'D3.' then code + '71' else code end,
codeDescription = codeDescription + ', High BLER'
where substring(code,1,3) = 'D3.' AND
avgBLER >= @BLERThreshold and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.72
-- Low Total Ec/Io
--
UPDATE DataCallAnalysis
Set code = case when code = 'D3.' then code + '72' else code end,
codeDescription = codeDescription + ', Low Total Ec/Io'
where substring(code,1,3) = 'D3.' AND
avgTotEcIo <= @UEEcIoThreshold and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Sessions,
-- Identification: D3.72
-- Low UE Rx Power
--
UPDATE DataCallAnalysis
Set code = case when code = 'D3.' then code + '73' else code end,
codeDescription = codeDescription + ', Low UE Rx Power'
where substring(code,1,3) = 'D3.' AND
avgUERxPwr <= @UERxLevThreshold and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Failed Calls,
-- Identification: D3.99
-- others
--
UPDATE DataCallAnalysis
Set code = code + '99',
codeDescription = codeDescription + ', others '
where code = 'D3.' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
--******************************************************************************
************************
-- Unknown Calls 'C9.XX'
--******************************************************************************
************************
Update DataCallAnalysis
Set code = 'C9.00',
codeDescription = 'Others'
where code = '' and
SessionId in (Select SessionId from DCAC_Sessions)
--------------------------------------------------------------------------------
------------------------
-- Insert Roaming Info
--
--------------------------------------------------------------------------------
------------------------
if @copyRoamingInfo=1
BEGIN
UPDATE DataCallAnalysis
Set codeDescription = codeDescription + ' -> Roaming to: ' + NetworkInfo.Oper
ator
from DataCallAnalysis, NetworkInfo, sessions
where DataCallAnalysis.SessionId = sessions.SessionId AND
sessions.NetworkId = NetworkInfo.NetworkId AND
NetworkInfo.Operator <> NetworkInfo.HomeOperator and
DataCallAnalysis.SessionId in (Select SessionId from DCAC_Sessions)
END
--------------------------------------------------------------------------------
------------------------
-- This code can be used to copy the code description to the Analysis comment fi
eld
--
--
--------------------------------------------------------------------------------
------------------------
if @copyComment=1
BEGIN
Delete
from AnalysisComment
FROM DataCallAnalysis
WHERE DataCallAnalysis.sessionID = AnalysisComment.sessionID and
DataCallAnalysis.SessionId in (Select SessionId from DCAC_Sessions)

Insert AnalysisComment (sessionId, comment, testid)
Select DataCallAnalysis.sessionId, codeDescription, 0
FROM DataCallAnalysis
WHERE DataCallAnalysis.SessionId in (Select SessionId from DCAC_Sessions)
END
END -- End of sqDataCallAnalysisCode
GO

Вам также может понравиться