0
votes

I'm trying to replace an existing click to dial functionality in a .NET application that currently uses "Skype For Business/Lync" and switch it to "Microsoft Teams". It does not look as though there is many examples of this online. The examples I have found do not seem to work for me. The example to shows up in multiple sources is below:

IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder
                                                                                .Create(clientId)
                                                                                .WithTenantId(tenantID)
                                                                                .WithClientSecret(clientSecret)
                                                                                .Build();

            ClientCredentialProvider authProvider = new ClientCredentialProvider(confidentialClientApplication);

            GraphServiceClient graphClient = new GraphServiceClient(authProvider);

            var call = new Call
            {
                CallbackUri = redirectUri,
                Targets = new List<InvitationParticipantInfo>()
            {
                new InvitationParticipantInfo
                {
                    Identity = new IdentitySet
                    {
                        User = new Identity
                        {
                            DisplayName = "John",
                            Id = userId
                        }
                    }
                }
            },
                RequestedModalities = new List<Modality>()
            {
                Modality.Audio
            },
                MediaConfig = new ServiceHostedMediaConfig
                {
                }
            };

            var response = graphClient.Communications.Calls
                .Request()
                .AddAsync(call).GetAwaiter().GetResult();

This code ultimately returns an error

Message: {"errorCode":"7503","message":"Application is not registered in our store.","instanceAnnotations":[]}

There is not much documentation on this error. I have registered a bot in Azure Active Directory and plugged in all the necessary values into the variables in the snippen above.

I have also attempted to run this code in Postman using the example in this link which also contains the C# example. Postman returns the exact same error.

I can also confirm I have the Calls.Initialte API permissions granted with Admin consent.

enter image description here Has anyone made a successful outgoing call in C# via Microsoft Graph/Teams?

1
Could you please check the permission's have admin consent?Trinetra-MSFT
Yes, I can confirm I have the Admin Consent for the Calls.Initiate API. I have updated the question to reflect this.psycho
Calls.JoinGroupCallsasGuest.All, Calls.JoinGroupCalls.All, Calls.Initiate.All, Calls.InitiateGroupCalls.All Do you have consent to a the mentioned permission i can't see them, i can see only two..For a call with app-hosted media, you need the Calls.AccessMedia.All permission in addition to one of the permissions listedTrinetra-MSFT
Could you please confirm, if you are still facing this issue?Trinetra-MSFT
Did you enabled calling feature for your bot while registering bot?Trinetra-MSFT

1 Answers

0
votes

Create call enables your Bot to create peer to peer or group call, You need to register your calling Bot and assign the following Application permissions:

Calls.JoinGroupCallsasGuest.All, Calls.JoinGroupCalls.All, 
Calls.Initiate.All, Calls.InitiateGroupCalls.All 

1. To Create peer-to-peer VoIP call with service hosted media

Note: This call needs the Calls.Initiate.All Application permission.

while registering your Bot you need enable the calling feature for your Bot and to make your bot to participate in audio and video call You need to set supportsCalling and supportsVideo to true within your app manifest.