Betty
Betty

Reputation: 9189

Send proactive chat message to initiator of Microsoft Teams Calling Bot voice caller

I have a teams bot that can answer 1-to-1 voice calls. During the call I want the bot to be able to send chat messages to the user and be able to reference user data (like their name).

Although an incoming call does have a encrypted source identity, from my experiments it appears this is not a valid user id for proactive messaging.

Interestingly enough this is easily possible in group calls as it starts passing you participant lists (which i've done before), but 1-to-1 calls appear to rely on the source field which effectively leaves the user as anonymous.

{
  "@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"
      }
    }
  ]
}

Upvotes: 0

Views: 181

Answers (1)

Jagadeesh-MSFT
Jagadeesh-MSFT

Reputation: 336

Yes, we can able to send the chat messages by creating Responder Call handler from bot. Could you please try to implement the sample code. In the sample code, will have a class named "ResponderCallHandler.cs", please have a look.

Upvotes: 1

Related Questions