简体   繁体   English

在Lync 2010 LCSCDR数据库中,是一种告诉谁应答响应组的方法

[英]In a Lync 2010 LCSCDR database, is their a way to tell who answered a call to a response group

I am writing some SQL code to query the Lync LCSCDR database. 我正在编写一些SQL代码来查询Lync LCSCDR数据库。

If someone calls a response group externally and another one answers it, a record goes into the sessionDetails table (and the Voipdetails table) - to reflect the call made. 如果有人在外部调用响应组而另一个响应它,则记录会进入sessionDetails表(以及Voipdetails表) - 以反映所进行的调用。

However, there appears to be no way to identify who answered the call. 但是,似乎无法确定谁接听了电话。 The user2id column is populated with the userid (from the Users table) of the response group rather than the person who answered the call. user2id列使用响应组的userid (来自Users表)而不是应答呼叫的人填充。 Does anyone know if there is a way to guess who answered the call ? 有谁知道是否有办法猜测是谁接听了电话?

The query is: 查询是:

SELECT 
    sd.SessionIdTime, 
    sd.SessionEndTime,
    DATEDIFF(
        ss, 
        sd.SessionIdTime, 
        ISNULL(sd.SessionEndTime, sd.SessionIdTime)
    ) AS duration,
    ph1.PhoneUri AS caller1,
    ph2.PhoneUri AS receiver1, 
    U1.UserUri AS user1uri, 
    U2.UserUri AS user2uri, 
    U3.UserUri AS refeereruri, 
    sd.User1Id, 
    sd.User2Id,
    sd.ReferredById,
    sd.IsUser1Internal, 
    sd.IsUser2Internal,
    sd.SessionIdTime, 
    voipd.*, 
    '|||',
    sd.*
FROM 
    dbo.VoipDetails AS voipd 
INNER Join 
    dbo.SessionDetails AS sd 
ON 
    (
        voipd.SessionIdTime = sd.SessionIdTime AND 
        voipd.SessionIdSeq = sd.SessionIdSeq
    ) 
LEFT OUTER JOIN 
    dbo.Users AS U2 -- still 4795 with outer
ON 
    U2.UserId = sd.User2Id
LEFT OUTER JOIN 
    dbo.Users AS U1
ON 
    U1.UserId = sd.User1Id 
LEFT OUTER JOIN 
    dbo.Users AS U3
ON 
    U3.UserId = sd.ReferredById
LEFT OUTER JOIN 
    dbo.Phones AS ph1
ON 
    ph1.PhoneId = voipd.FromNumberId
LEFT OUTER JOIN 
    dbo.Phones AS ph2
ON 
    ph2.PhoneId = voipd.ConnectedNumberId
WHERE 
    sd.SessionIdTime > (GETDATE() - 2) 
    AND sd.MediaTypes = 16 
    AND voipd.FromGatewayId  is not null -- external
    AND User1Id IS NULL

There is a way to find an anwser to your question but you will need an second application to do it 有一种方法可以找到问题的答案,但是你需要第二个应用程序才能完成

When a RG is called, the call will fill the CorrelationID 调用RG时,调用将填充CorrelationID

For each line where the CorrelationID is filled, you must search for a line without CorrelationID where the RefferdByID is the called RG. 对于填充了CorrelationID的每一行,您必须搜索没有CorrelationID的行,其中RefferdByID是被调用的RG。 Most of the time the answering user will become the caller and the callee is the caller of the line with the CorrelationID 大多数情况下,应答用户将成为呼叫者,被呼叫者是具有CorrelationID的线路的呼叫者

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM