question

Ronald-7042 avatar image
0 Votes"
Ronald-7042 asked ChetanSharmamsft-3456 edited

Calling Call Queue from Media Bot not working

We have an Application Hosted Media Bot based upon the Bot Media Framework built in C#. This bot can perfectly setup a peer-to-peer call to a Teams user using the Cloud Communications API, but this same bot can't setup a peer-to-peer call to a Call Queue. No matter what we try, we always get the error response "7505, Request authorization tenant mismatch". This same Call Queue can be called from a Teams client without any problem.
There are some similar questions on other forms, but there is nowhere a clear answer if this scenario is supported or not.

What we have tried so far (based upon suggestion on forums and the examples in the documentation):

  • Creating an Application Instance for the bot (in the same tenant) and adding this in the ParticipantInfo of the Source property with the key 'applicationInstance'.

  • Assigning 'Microsoft 365 Phone System - Virtual User' license to this application instance.

  • Adding the Application Instance Id of the Call Queue (which is in the same tenant) in the InvitationParticipantInfo of the Targets property with the key 'applicationInstance'.

  • Assigning 'Microsoft 365 Phone System - Virtual User' to the call queue.

  • Adding the TenantId to the root of the Call object and every Identity.

  • Enabling/Disabling 'Conference mode' on the Call Queue.

The request body to the Graph API looks like the following (some information has been obfuscated):

 {
   "@odata.type": "#microsoft.graph.call",
   "callbackUri": "https://****/api/calls",
   "direction": "outgoing",
   "mediaConfig": {
     "@odata.type": "#microsoft.graph.appHostedMediaConfig",
     "blob": "{\"mpUri\":\"****"}"
   },
   "requestedModalities": [
     "audio",
     "video"
   ],
   "source": {
     "@odata.type": "#microsoft.graph.participantInfo",
     "identity": {
       "@odata.type": "#microsoft.graph.identitySet",
       "application": {
         "@odata.type": "#microsoft.graph.identity",
         "displayName": "(Identity: IoF5tQu/)",
         "id": "<AppId of Bot>",
         "tenantId": "<TenantId>"
       },
       "applicationInstance": {
         "@odata.type": "#microsoft.graph.identity",
         "displayName": "(Identity: 0c0JkUYA)",
         "id": "<Application Instance Id of Bot>",
         "tenantId": "<TenantId>"
       }
     }
   },
   "subject": "(Generic: 6wI7rO4b)",
   "targets": [
     {
       "@odata.type": "#microsoft.graph.invitationParticipantInfo",
       "identity": {
         "@odata.type": "#microsoft.graph.identitySet",
         "applicationInstance": {
           "@odata.type": "#microsoft.graph.identity",
           "displayName": "(Identity: W00pQ5ZB)",
           "id": "<Application Instance Id of Call Queue>",
           "tenantId": "<TenantId>"
         }
       }
     }
   ],
   "tenantId": "tenantId": "<TenantId>"
 }

A long introduction, but actually only two short questions:

  • Does the Graph API support calling a Call Queue from a Bot?

  • If so, what must be done to get this working?



office-teams-app-devmicrosoft-graph-cloud-communications
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for reaching out to us! I believe this issue is about the Phone System in Teams https://docs.microsoft.com/en-us/microsoftteams/what-is-phone-system-in-office-365 and the Graph API so I changed the tag.

Regards,
Yutong

0 Votes 0 ·
DianaWanjuhi-1579 avatar image
0 Votes"
DianaWanjuhi-1579 answered Ronald-7042 commented

Hello @Ronald-7042 Thank you for reaching out. To the best of my knowledge, calling a call queue from a bot is not currently supported. From the documentation on cloud-communications-calls

Currently, bots are able to:

  • Create group calls

  • Join exisiting group calls

  • Invite other participants into an existing group call

  • Be invited into existing group calls

It looks like the error you've linked above has also been reported here: Cannot Create Call - Error Code 7505 "Request Authorization Tenant Mismatch. You might also consider filing a feature request on the Microsoft365DeveloperPlatform so our team can look into this.

Let me know whether this helps and if you have further questions,

Diana.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for response.

The issue described in the link you have provided is not the same situation, even though the error message is the same. That issue turned out to be caused by missing tenantId values in the call and identity objects, which are all present in my call object.

I'm still looking for some official documentation that clearly states if calling a Call Queue from a Bot is supported or not. Since the error description is very generic, it could still be some configuration or licensing issue that I'm running into.

0 Votes 0 ·
ChetanSharmamsft-3456 avatar image
0 Votes"
ChetanSharmamsft-3456 answered Ronald-7042 commented

Hello @Rohand-7042,

Could you please try with below code:

POST https://graph.microsoft.com/beta/communications/calls/491f0b00-ffff-4bc9-a43e-b226498ec22a/redirect
Content-Type: application/json

{
"targets": [
{
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"application": {
"@odata.type": "#microsoft.graph.identity",
"displayName": "test bot 2",
"id": "22bfd41f-550e-477d-8789-f6f7bd2a5e8b"
}
}
}
],
"callbackUri": "https://bot.contoso.com/api/calls/24701998-1a73-4d42-8085-bf46ed0ae039"
}

Documentation link:
https://docs.microsoft.com/en-us/graph/api/call-redirect?view=graph-rest-beta&tabs=http#request

Your issue is similar to below:
https://stackoverflow.com/questions/65609300/ms-teams-bot-invite-call-queue-as-participant

Thanks!!

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @ChetanSharmansft-3456,

Could you please elaborate on how your proposed code snippet fits in my scenario? It seems to be a copy of the first example in the documentation of a redirect scenario, where an incoming call from a user to a bot is redirected to another bot. That example does not do anything with a Call Queue.

The link to the StackOverflow issue is indeed almost similar (except that a Call Queue is invited to an existing call). However the conclusion of the OP (hnnh) at July 1 in the comment of his own question is that it seems that calling a Call Queue from a bot is not possible.

So far I haven't seen anyone who was successful at calling a Call Queue from a bot, but on the other hand I also haven't seen an official statement from Microsoft that this scenario is not supported.

Ronald

0 Votes 0 ·
ChetanSharmamsft-3456 avatar image
0 Votes"
ChetanSharmamsft-3456 answered ChetanSharmamsft-3456 edited

I can't find any specific docs for it but as per my knowledge, calling a call queue from a bot is not currently supported.
Docs reference:
https://docs.microsoft.com/en-us/graph/cloud-communications-calls

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.