获取 Microsoft Teams 当前通话状态

Get current call status of Microsoft Teams

在我的 Windows PC 上,我安装了 Microsoft Teams 应用程序。我想通过适当的 API 了解我是否真的在通话中以及通话中我的麦克风是否静音。

所以我的问题是:

  1. 如何知道我当前是否正在通话?
  2. 通话中麦克风的当前状态是什么(静音/未静音)?

一些背景知识:我想实现一个在后台轮询这些信息的小 .NET Core 服务。

  1. 您可以使用 Graph API presence 请求获取用户状态,在响应正文中您将获得状态。

    获取https://graph.microsoft.com/v1.0/me/presence

响应:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1574

{  
    "id": "fa8bf3dc-eca7-46b7-bad1-db199b62afc3",
    "availability": "Available",
    "activity": "Available"
}
  1. 不可能知道通话中的当前麦克风状态(静音/未静音)。

团队中有一个 get participant API to get microphone state but for this you need to create a calling bot,在该机器人中创建一个呼叫,然后使用呼叫 ID 从创建的呼叫中,您可以使用 GET https://graph.microsoft.com/v1.0/communications/calls/{id}/participants/{id}

获取参与者麦克风状态