【问题标题】:Send proactive chat message to initiator of Microsoft Teams Calling Bot voice caller向 Microsoft Teams Calling Bot 语音呼叫者的发起者发送主动聊天消息
【发布时间】:2022-01-21 00:10:58
【问题描述】:

我有一个可以接听一对一语音电话的团队机器人。在通话期间,我希望机器人能够向用户发送聊天消息并能够引用用户数据(例如他们的姓名)。

虽然来电确实具有加密的源身份,但从我的实验来看,这似乎不是主动消息传递的有效用户 ID。

有趣的是,这在群组通话中很容易实现,因为它开始向您传递参与者列表(我以前做过),但是一对一通话似乎依赖于源字段,这实际上使用户保持匿名。

{
  "@odata.type": "#microsoft.graph.commsNotifications",
  "value": [
    {
      "@odata.type": "#microsoft.graph.commsNotification",
      "changeType": "created",
      "resource": "/app/calls/4a1f2c00-831f-4e4e-9d7c-1648b6dddb73",
      "resourceUrl": "/communications/calls/4a1f2c00-831f-4e4e-9d7c-1648b6dddb73",
      "resourceData": {
        "@odata.type": "#microsoft.graph.call",
        "state": "incoming",
        "direction": "incoming",
        "callbackUri": "https://...",
        "source": {
          "@odata.type": "#microsoft.graph.participantInfo",
          "id": "7684a0ea-7db6-4f3e-a339-eb46e16d57f0",
          "identity": {
            "@odata.type": "#microsoft.graph.identitySet",
            "encrypted": {
              "@odata.type": "#microsoft.graph.identity",
              "id": "1g7qrdwga2udafuebrjcyobchnq7r4xigupowjluuccfdceufmew6ush6wlx-kellf96ky2nnhsl084rn6vegqmwawiqpux0kk5aw5lqq9oydrewxe9awkrk_uh_0nxat", // <-- not a valid chat user
              "tenantId": "{tenancyId}",
              "identityProvider": "None"
            }
          },
          "endpointType": "default",
          "region": "apac",
          "languageId": "en-us"
        },
        "targets": [
          {
            "@odata.type": "#microsoft.graph.invitationParticipantInfo",
            "identity": {
              "@odata.type": "#microsoft.graph.identitySet",
              "application": {
                "@odata.type": "#microsoft.graph.identity",
                "id": "a2716ab5-9b38-4364-8869-b9b8deeff897",
                "identityProvider": "AAD"
              }
            },
            "endpointType": "default",
            "id": "023126f0-904f-4c01-a78d-03f28e77e7a7",
            "region": null,
            "languageId": null
          }
        ],
        "tenantId": "{Azure Tenancy}",
        "myParticipantId": "023126f0-904f-4c01-a78d-03f28e77e7a7",
        "callChainId": "37de77c7-54b3-4d04-9e9c-181e5f5b5773",
        "incomingContext": {
          "@odata.type": "#microsoft.graph.incomingContext",
          "sourceParticipantId": "7684a0ea-7db6-4f3e-a339-eb46e16d57f0"
        },
        "id": "4a1f2c00-831f-4e4e-9d7c-1648b6dddb73"
      }
    }
  ]
}

【问题讨论】:

  • 嗨@betty,我们已经解决了您的问题,我们需要更多信息。我们可以打个电话吗,请告诉我们您的空闲时间。
  • 嗨@Jagadeesh-MSFT 我住在新西兰,所以时区可能很有趣。这是如何工作的?
  • 嗨@betty,你能试试这个sample
  • @Jagadeesh-MSFT 完全可以对机器人进行直接调用,这就是清单中的 supportsCalling 标志所启用的。只是该呼叫的通知似乎没有我可以使用的身份数据。
  • 您将在 turncontext.activity.from 中收到用户信息。请查看此sample 了解更多信息。

标签: microsoft-teams


【解决方案1】:

是的,我们可以通过从机器人创建响应者呼叫处理程序来发送聊天消息。 请您尝试实施sample code。 在示例代码中,会有一个名为“ResponderCallHandler.cs”的类,请看一下。

【讨论】:

  • 查看该代码,我看不到任何看起来像是在发送聊天消息的东西。您正在查看特定的线路吗?
猜你喜欢
  • 2019-04-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-12-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多