如何解读Microsoft Graph API通话记录并识别呼叫转接行为?
背景
我通过Microsoft Graph API的GET /callRecords端点获取通话记录数据,已添加expand=segments参数以查看每个会话中的通话段。返回的JSON响应约3100行,包含15个会话,每个会话对应1个通话段。我研究许久仍无法从中判断呼叫流程,还发现按StartDateTime排序会话后,顺序与原始通话记录对象中的会话顺序差异显著。
测试呼叫场景
测试呼叫流程为:使用测试Teams用户Diego呼叫Teams资源队列,Teams用户Adele接听队列呼叫,随后Adele将呼叫转接给另一位Teams用户Demo User。
需求
我希望找出能证明Adele将呼叫转接给Demo User的相关信息。
我已将序列化后的JSON存入sample.json文件。
C#代码片段
var config = new ConfigurationBuilder() .SetBasePath(projectDirectory) .AddJsonFile("appsettings.json", false, true) .Build(); var authenticationProvider = CreateAuthorizationProvider(config); var graphServiceClient = new GraphServiceClient(authenticationProvider); var config = LoadAppSettings(); var graphClient = GetAuthenticatedGraphClient(config); var testCallId = config["testCallId"]; var options = new List<QueryOption> { new QueryOption("$top", "1") }; CallRecord graphResult = await graphClient.Communications.CallRecords[testCallId] .Request() .Expand("sessions($expand=segments)") .GetAsync(); var jsonResult = JsonSerializer.Serialize(graphResult, new JsonSerializerOptions { WriteIndented = true });
内容的提问来源于stack exchange,提问作者Nate W
相关产品推荐
相关产品推荐

