Larry Aultman
Larry Aultman

Reputation: 311

Integration of Microsoft Teams with UWP app, Cannot start 1:1 Teams user to Teams User for Voice and Video calling

I have been following the Microsoft documentation and generally using the "Calling" sample app. I am able to receive calls from another Teams user 1:1 and I am able to make outbound phone calls. For whatever reason, I am unable to make outbound Teams user 1:1 calls. I have Fiddler to watch the network traffic. When I use the Microsoft Teams app to place a 1:1 call I can see the user tokens in the raw data. When I use the UWP integration app there is simply a tunnel request and it ends there. The code making the call is found in the documentation [here] (https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/voice-video-calling/get-started-with-voice-video-calling-custom-teams-client?tabs=uwp&pivots=platform-windows) and it is this code:

private async void CallButton_Click(object sender, RoutedEventArgs e)
        {
            var callString = CalleeTextBox.Text.Trim();

            teamsCall = await StartCteCallAsync(callString);
            if (teamsCall != null)
            {
                teamsCall.StateChanged += OnStateChangedAsync;
            }
        }

The documentation does not give any description of what the "callee" should be. I am using the address of the Teams user from Microsoft Entra (formerly AAD).

Does anyone have insights that might point out my problem?

I have tried multiple Microsoft 365 users who have Teams licenses and I have verified that the licenses are valid for Azure Communications Services. I have had other people in our organization call me on Teams (voice and video) and it works. If I attempt to call that user by their Microsoft 365 username it fails with CallResonCode 500. These are found in this link. I am at a loss now.

UPDATE: I read that a "bot" is required. There is no mention of a bot in any of the documentation. I put in the 8:echo123 and it works. I tried 8:[teamsuserId] and now I get a CallResonCode Remote_client_endpoint_not_registered That seems to be a step in the right direction?

UPDATE 2: I've continued to work on the issue. There evidently is an issue with the "callee" and token to make a call. The following code always results in a callReason of 500. I am using a known Teams company account with a valid license for Teams as the callee in standard email name format: username@domain

        private async Task<TeamsCommunicationCall> StartCteCallAsync(string cteCallee)
    {
        var startCallOptions = new StartTeamsCallOptions()
        {
            OutgoingAudioOptions = new OutgoingAudioOptions() { IsMuted = true, Stream = micStream },
            OutgoingVideoOptions = new OutgoingVideoOptions() { Streams = new OutgoingVideoStream[] { cameraStream } }
        };

        var userCallId = new MicrosoftTeamsUserCallIdentifier(cteCallee);
        var call = await this.teamsCallAgent.StartCallAsync(userCallId, startCallOptions);
        return call;
    }

The method "MicrosoftTeamsUserCallIdentifier(callee)" should create a valid "CallIdentiter". It generates no errors but fails ultimately to create a call.

Update 3: All the TeamsCallClient and TeamsCallAgent stuff is now gone. Microsoft pushed out an updated nuget package for version 1.3.0 up from 1.3.0 beta 2. That only leaves the CallClient and CallAgent which are ACS type calls not CTE. After removing all the code that had to do with CTE calling, the app runs and again everything seems to work but I still can't make outgoing calls 1:1 to another teams user. I have tried several prefixes to the user name (8:, 8:acs:, no prefix). I get either response CallEndReason codes 500 or 400/subcode 5037. In any case, I cannot find by directly searching or using Bing AI, documentation that will help me create a correctly formatted user call identity.

Upvotes: 0

Views: 128

Answers (1)

Sanath Rao
Sanath Rao

Reputation: 1

The Teams user the Identity is in the format starting with 8:orgid, ACS users it starts with 8:acs. Documentation here might help you https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/manage-teams-identity?pivots=programming-language-csharp.

Upvotes: 0

Related Questions