Forum Discussion
Teams bot SDK - getting participants and events
Hello Jose_Parada
Thanks for your answer!
It was indeed as you suggested that in the body of Answer command, the wrong URL was sent. We're using ngrok for generating a callback URI which at the time changed every time you start it. And I wasn't aware that I should update it on 2 locations (bot config in azure and application config).
However, in the SDK, it seems that setting the notification callback URI is mandatory. It will throw an exception when you try to build an ICommunicationsClient without setting the URI in the CommunicationsClientBuilder.
Another thing is that I have trouble to see who is calling. This information should be available in the "source" property of the call, but this doesn't seem to supply a name or address/phone number:
...
"source": {
"@odata.type": "#microsoft.graph.participantInfo",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"user": {
"@odata.type": "#microsoft.graph.identity",
"id": "GUID",
"tenantId": "GUID"
}
},
"region": "emea",
"languageId": "en-US",
"id": "GUID",
"endpointType": "(Generic: qZhQWg/4)"
}
I noticed that the source.identity.user.id property can be used to retrieve the identity from the user graph using the GraphServiceClient. But I'm not sure this is the way to go. It requires an extra query outside the comms SDK, and there is no calling device info (e.g. no calling address). Also the Identity.DisplayName property is available in the model, but it is not set.
Do I need to turn on some permissions or other settings to be able to get extra caller info? Or is this how it is supposed to work?
Also about the issue of not being able to get the call participants, it turns out that I'm not the only one with this problem https://github.com/microsoftgraph/microsoft-graph-comms-samples/issues/102#issuecomment-514261814. Luckily we only need to know the caller, and that is already in the source property.
I hope you can help me with the question about the caller info.
Greetings
Johan
Hello JohanJdm. We indeed do not fill out the displayName for incoming calls to a bot. If you have the appropriate permissions you can look up all his registered information in Azure Active Directory or, as you mention, through MS Graph.
I'm not sure what you mean by calling address; if you'd like your bot to place an outgoing call to that user at a later time, the user ID should be all you need.
EDIT: I should've qualified my first statement: we do not always fill out displayName for incoming calls to the bot. Whether it's filled out or not depends on whether the displayName was sent in the call payload when the call was made. There are several situations where this can happen, for example, if the caller called from a PSTN number. In general, registered, non-guest Teams users calling your bot should usually provide a displayName for us to hand to your bot through the source Identity object displayName field.