Teams bot invite PSTN participant fails Intermittently when Compliant Recording Policy is enabled for user
We use the Graph Cloud Communications API for our Teams Calling Bot to answer an incoming call to the Bot from a Teams user, and then add a PSTN participant into the call (as per this example participant: invite - Microsoft Graph v1.0 | Microsoft Learn).
This works fine as expected if the Teams user making the initial call does not have a "Teams Compliance Recording Policy" set against them. However, if the Teams user has a recording policy set against them (and a recoding bot is brought into the call, even if it then drops out) the Invite Participant operation usually fails (It should be noted that it does work ok sometimes). When it fails we see the following error;
Steps to Reproduce;
1. Teams user (with Teams Compliance Recording Policy set against them) makes call to Teams Calling Bot (Call UPN or phone number of Resource Account/Application Instance)
2. Teams Bot answers call [call: answer - Microsoft Graph v1.0 | Microsoft Learn]
3. Teams Bot invites PSTN participant to the call [participant: invite - Microsoft Graph v1.0 | Microsoft Learn]
4. Intermittently, the invite fails with a 403 response
I can confirm that the Application Instance (Resource Account) has a phone number and Microsoft Teams Phone Resource Account license assigned, and also a suitable Voice Routing Policy has been applied to allow for calls over Teams Direct Routing. The Teams user also has a suitable Teams license for making PSTN calls.
Since this works ok for users without a recording policy, and we've tested with a number of different recording Bots, we believe that our Bot code must be correct and that the issue is within the Teams infrastructure.
Any help in this matter will be gratefully received. Cheers, Dave