Description
Library name and version
Azure.Communication.Calling.WindowsClient 1.2.0-beta.1
Describe the bug
There is an issue with the reliability of CallEndReason
codes of incoming calls in the Calling SDK when connected as a Teams user. This issue happens for calls that are accepted or declined in the Teams Client or if they timed out. Please refer to the table below in the "Actual behavior" section to see the observed codes. It is important that CallEndReason.Code
and CallEndReason.Subcode
together are consistent and correctly reflect the local and global events. As an example we need to display if the call was accepted or missed in our client application. This functionality does work in the Teams Client across all clients (mobile, desktop) so we should be able to also implement it in our own client applications to correctly display the call status.
Are the code-subcode combinations documented somewhere? The only reference I found about the "error codes" is on the following page however this documentation does not fully reflect the observed behavior:
https://learn.microsoft.com/en-us/azure/communication-services/concepts/troubleshooting-info?tabs=csharp%2Cjavascript%2Cdotnet#calling-sdk-error-codes
Expected behavior
Reliable CallEndReason
codes of incoming calls.
Actual behavior
The following codes were observed when calling the teams user and triggering the events in the Teams Client:
Event | End Reason Code | Subcode | Note |
---|---|---|---|
Accepted | 603 | 0 | |
Accepted | 487 | 10003 | |
Callee declined | 487 | 10024 | |
Callee declined | 603 | 0 | |
Caller declined | 487 | 0 | Shortly after starting the call |
Caller declined | 603 | 0 | Waiting for a longer time |
Timeout | 487 | 10004 | High probability |
Timeout | 603 | 0 | Low probability |
Reproduction Steps
The following MAUI project can be used to reproduce and observe the CallEndReason
codes:
https://github.com/wladimir-k-m/acs-calling-windows-end-reason-issue
- Clone and open the project in Visual Studio 2022.
- Change appId, tenantId, connectionString in TeamsCallListener.cs. Please refer to the following documentation for more info: https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/manage-teams-identity?pivots=programming-language-csharp
- Run the application.
- Click on the "ACS Login as Teams User" button and login with your Microsoft account of the specified tenant with a Teams license. You should see the text "Logged in" in the info label below the button.
- Call your teams user. You should see "Incoming Call..." in the info label.
- Test the following variations in the Teams Client: Accept as caller, decline as caller, accept as callee, decline as callee, wait for timeout. In each case you should see the call end reason code + subcode in the info label.
Environment
Target Framework: net6.0-windows10.0.22621.0
.NET SDK:
Version: 7.0.400-preview.23274.1
Commit: 44de7b351c
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.400-preview.23274.1\
Host:
Version: 7.0.5
Architecture: x64
Commit: 8042d61b17
.NET SDKs installed:
7.0.203 [C:\Program Files\dotnet\sdk]
7.0.400-preview.23274.1 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
IDE: Microsoft Visual Studio Community 2022 (64-bit) - 17.5.5