Get Teams Call state - microsoft-teams

When I start a call in Teams my user status is set to "busy-inacall" and as I have set "busy-on-busy" in the Teams admin policies, I am not available for a call anymore.
When I'm in a call and a planned meeting in Outlook starts the user status is set to "busy-inAmeeting" and I'm still not available for a call anymore.
When I'm not in a call and a planned meeting in Outlook starts, I am set to "busy-inAmeeting" as well but I'm available for a call.
So the user status/presence does not display the availability for a call.
How can I get (via MS Graph) if is user is available for a call?

Related

Power Automate: How will workflow know if item status changed while waiting for teams approval

So I have an SPFX application that is used to raise request, modify request, approve / reject. The usual request workflow. all these data are being saved in Azure SQL table. Now I have a workflow that runs on db item update trigger, it would start a teams "wait for approval" action and be sent to 2 approvers (1 for main and 1 for a backup approver, either of the two can approve and workflow would only wait for the first response). at the same time, approvers can also approve the request via the spfx app. they can approve it because the status of the request is "Pending Approval".
Now my issue is this: If the approver decides to approve the request from the SPFX app, db item's status would then change to Approve, However the request's teams approval is still "Requested"" in the teams.
I created a workaround for this by checking the request's status from the db so if the item is "Approved", doesn't matter what action the approver did in the teams approval, if the request is already approved or rejected in the db, the action made in the teams will not do anything.
BUT what if that backup approver, decides to reject the request. it would cause confusion because data would then be "Approved" in the database.
would it be possible to check the status, and then cancel the triggered teams approval for that request?
I hope I described the scenario well.

MS Teams call event

we have a windows form made using VB.net
Is there an API we can use, so that when a call is received in Teams an event is triggered?
And in the event it can determine the caller number?
And is there an event for when the call is finished, which can determine how long the call lasted?
Thanks
There is no direct way that you can handle the call triggered event at your custom application but you can get the call related details using Graph API: Reference doc https://learn.microsoft.com/en-us/graph/api/callrecords-callrecord-get?view=graph-rest-1.0&tabs=http
In order to get the Id which getting use to fetch callRecords you need to Create subscription to get call notifications.
Create subscription- Subscribes a listener application to receive change notifications when the requested type of changes occur to the specified resource in Microsoft Graph.

Retrieve caller-ID in Microsoft Teams in realtime

I'm trying to integrate Teams with an external service by using a Teams Bot/App. The app should call an external API with the caller-ID of the incoming PSTN call.
My success went so far, that I could get a list of the last calls but they were far away from being realtime and the caller-ID was masked.
Is it possible at all to "listen" to call metadata in realtime?
You can Retrieve the Call id by Subscribe for Microsoft Graph change notifications to be notified when your user's data changes, so you don't have to poll for changes. check Use the Microsoft Graph API to get change notifications also check this sample. when you subscribe to call

What happens to the activity if my end point is not accessible or returns a 500?

I have a Microsoft bot app that can be installed in Teams on a team.
For now, I save the tenant ID + team id in our DB when the app gets installed, via a received activity on our end point.
What happens if my prod is not up at the moment of the installation? (for whatever reason, could be an update or just a technical downtime...)
Is it lost forever? Is it retried?
Same question with a 500 error?
This activity is an example, it could be any other activity. Ex: a user is added/removed, a message has been sent etc...
For OnMembersAddedAsync; unfortunately there is no retry from the Teams side, it fires and forgets.
The information in that Activity will be included in any subsequent send from Teams - so the bot can recover, if the user interacts with the bot again. Messages would just be sent when the bot recovers.
You can find a bit more info on Teams and events here:
How do I send a 1:1 welcome message?

Get sip address, or username from identity in Teams Calling API

We have a calling enabled teams bot, that receives calls. From the data it receives, we want to retrieve who is actually calling. For PSTN calls, this is ok. However, for Teams-to-Teams-calls (or SfB-Teams calls) we get the calling identity as (underneath example is SfB->Teams):
"identity":{
"#odata.type":"#microsoft.graph.identitySet",
"onPremises":{
"#odata.type":"#microsoft.graph.identity",
"id":"<guid>",
"tenantId":"<guid>",
"identityProvider":"None"
}
When all participants live in the tenant of the calling bot, we can retrieve all info (by using the graph API and just query the user with that objectID). But in the case the caller is from another tenant, how can we retrieve the displayname/sipadres for the identity?
For example, if I am being called, my teams client shows a display name. Now if the bot is called, how can it know the displayname (or sip address)?
I've tried to read out more properties using https://graph.microsoft.com/beta/communications/calls/..., however, that returns a 'call not found' consistently.
Specifically we don't support calls from sfb with details of caller. From Teams client should be able to get caller object ID though

Resources