简体   繁体   English

呼叫的 RingCentral ExtensionCallLogResponse 对象

[英]RingCentral ExtensionCallLogResponse Object for Calls

I am new to using RingCentral and in using API calls.我是使用 RingCentral 和使用 API 调用的新手。

I am using RingCentral's C# nuget example to help me along with trying to get both outgoing and incoming call logs with their legs.我正在使用 RingCentral 的 C# nuget 示例来帮助我尝试用他们的腿获取呼出和呼入呼叫日志。

So far I am trying to get the incoming calls by using到目前为止,我正在尝试使用

ExtensionCallLogResponse callLogsInBound = await mainAccount.CallLog().List(new {
  dateFrom = monday.ToString("yyyy-MM-dd"),
  dateTo = monday.AddDays(5),
  view = "Detailed",
  direction = "Inbound"
});

This is a nested, object with Navigation information, paging info, and multiple records (Calls).这是一个嵌套的对象,包含导航信息、分页信息和多条记录(呼叫)。 What is the best way to read this information into a gridview for reporting UserNames, Call Counts, Legs of calls?将此信息读入 gridview 以报告用户名、呼叫计数、呼叫分支的最佳方法是什么? I have tried converting this object to a datatable, but I have not had any success yet, and I am wondering if there is a better way?我曾尝试将此对象转换为数据表,但还没有成功,我想知道是否有更好的方法? Thanks, K.谢谢,K。

There are several ways to avoid reading a big chunk or the entire call log which would force you to use the navigation data to navigate between pages.有几种方法可以避免阅读一大块或整个通话记录,这会迫使您使用导航数据在页面之间导航。

One way is to read the call log of each extension for a short period of time (fromDate and toDate) and set the perPage parameter to maximum of 1000 items.一种方法是在短时间内读取每个分机的通话记录(fromDate 和 toDate)并将 perPage 参数设置为最多 1000 个项目。 (use the User Call Log endpoint) (使用用户呼叫日志端点)

If you want to read the entire company call log using the Company Call Log endpoint, then specified even shorter period of time to ensure it would fit the 1000 items per page.如果您想使用公司呼叫日志端点读取整个公司呼叫日志,则指定更短的时间段以确保它适合每页 1000 个项目。

To add the data to your database, I am not sure what type of database you are thinking of, but you can make eg a .csv format then parse the response to extract the data you want to keep.要将数据添加到您的数据库中,我不确定您正在考虑哪种类型的数据库,但是您可以制作例如 .csv 格式,然后解析响应以提取您想要保留的数据。 See the API reference for response information.有关响应信息,请参阅 API 参考。

// e.g.
var callLogs = await rc.Restapi().Account().Extension(1234567890).CallLog().List(parameters);
var csv = "id,uri,result";
foreach(var record in callLogs.records)
{
  csv += "\r\n" + record.id + "," + record.uri + "," + record.result;
}
System.Console.WriteLine(csv);

Is the Username you mentioned the name of each extension/user under the account?您提到的用户名是帐户下每个分机/用户的名称吗? If so, I think you can call the Extension List to read information of all extensions under the account, the use the extension id to read the call log of that extension as shown above.如果是这样,我认为您可以调用分机列表读取帐户下所有分机的信息,使用分机id读取该分机的通话记录,如上图。 Then when you parse the call log response, just add the name of that extension to the name column of the csv data.然后在解析通话记录响应时,只需将该扩展名的名称添加到 csv 数据的名称列中即可。

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

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