SOLVED

Teams bot intercepting incoming call

Copper Contributor

Hi,

 

I want to develope a bot/app that intercepts an incoming call in Teams from a user to another user. It should notify the second user, provide informations about the call and give him the option to accept or decline the call. I've seen this https://techcommunity.microsoft.com/t5/teams-developer/intercept-incoming-call/m-p/871462 and was wondering if Microsoft has added this feature yet.

 

Thanks in advance!

7 Replies

@PMcVries - Could you please refer this and let us know if this is what you are looking for?
call: redirect - Microsoft Graph v1.0 | Microsoft Learn

Hello @Prasad_Das-MSFT,

I wasn't quite able to determine whether the redirect resource can enable a third party to intercept an incoming call between two users.

The background is:

My agency has agents with personalized Teams accounts. I want to develope an application that can intercept an incoming call to an agent and notifies the agent with informations about the call and the caller. According to these informations the agent is given the option to answer or decline the call. Is the redirect resource able to do that?

 

best response confirmed by PMcVries (Copper Contributor)
Solution

@PMcVries - Using the Get call API , you can get the source and targets details of a call and based on that you can take decision of redirecting the call using redirect call API.

 

 

 

Thanks, 

Prasad Das

------------------------------------------------------------------------------------------ 

If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link.

@Prasad_Das-MSFT 

 

In the Get call API documentation it is written that i have to use the following url:

GET /communications/calls/{id}

 

How does a third party receive the call id for a call that is directed from party1 to party2?

@PMcVries - 

To receive the call ID for a call that is directed from party1 to party2, a third party can use the Microsoft Teams Graph API. The call ID can be obtained by subscribing to the call records resource type using the Microsoft Graph API.
  1. Subscribe to the call records resource type using the Microsoft Graph API. This subscription allows your application to receive notifications whenever there is a new call or an update to an existing call. You can use the Create subscription API to create a subscription for call records.

    The resource parameter in the API call should be set to communications/callRecords. This ensures that your application receives notifications for call records.

  2. Handle the incoming notifications from the Microsoft Graph API. Whenever there is a new call or an update to an existing call, your application will receive a notification to the specified callback URL. The notification payload will contain the call ID among other details.

    You can use the call ID received in the notification payload to retrieve the call details by making a GET request to the following endpoint:

    GET /communications/calls/{id}
    

    Replace {id} with the call ID obtained from the notification payload.

    This API call will return the details of the call, including information about the parties involved, timestamps, and other relevant data.

By following these steps, a third-party application can receive the call ID for a call that is directed from party1 to party2. The call ID can be used to retrieve the call details and perform any necessary actions or processing.

 

 

Thanks, 

Prasad Das

------------------------------------------------------------------------------------------ 

If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link.

@Prasad_Das-MSFT 
What you describe works only for ended calls.
But I unserstood the question that @PMcVries was looking for a solution to get events for currently active calls.
That is what we are also looking for.
Is there any possibility to get an "ringing" event, if a MS Teams User gets an incomming call?

@relkniw - There doesn't seem to be any such option available currently. To achieve your requirements, we recommend you give your feedback in Teams Feedback Portal.