How to accept an incomming call in a C# custom client for Azure Comm Services and Teams Interoperability?

Carlos Corona 71 Reputation points

Hello everybody, I'm making a custom Teams client in C#, I have took: as base for my project, making some changes to integrate MSAL and getting a Communication Identity access token to call somebody in my organization.

At this moment I can perform a call and see the remote and local video, but I cannot answer a call, I someone tries to call me, nothing happens.

I've added the method and set up it as call back:

private async void Agent_OnIncomingCall(object sender, IncomingCall incomingcall)  
    Debug.Assert(deviceManager.Microphones.Count > 0);  
    Debug.Assert(deviceManager.Speakers.Count > 0);  
    Debug.Assert(deviceManager.Cameras.Count > 0);  
    if (deviceManager.Cameras.Count > 0)  
        VideoDeviceInfo videoDeviceInfo = deviceManager.Cameras[0];  
        localVideoStream = new LocalVideoStream[1];  
        localVideoStream[0] = new LocalVideoStream(videoDeviceInfo);  
        Uri localUri = await localVideoStream[0].MediaUriAsync();  
        await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>  
            LocalVideo.Source = localUri;  
    AcceptCallOptions acceptCallOptions = new AcceptCallOptions();  
    acceptCallOptions.VideoOptions = new VideoOptions(localVideoStream);  
    call = await incomingcall.AcceptAsync(acceptCallOptions);  

But looking deeper into the code from the example I cannot see any UI to handle the incomming calls, so how can I add support for this?

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
16,714 questions
Microsoft Graph Teamwork API
0 comments No comments
{count} vote