Forum Discussion
Teams bot intercepting incoming call
- Sep 21, 2023
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.
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?
- Prasad_Das-MSFTSep 21, 2023
Microsoft
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.
- PMcVriesSep 21, 2023Copper Contributor
In the https://learn.microsoft.com/en-us/graph/api/call-get?view=graph-rest-1.0&tabs=http 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?
- Prasad_Das-MSFTSep 22, 2023
Microsoft
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.
-
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
resourceparameter in the API call should be set tocommunications/callRecords. This ensures that your application receives notifications for call records. -
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.
-