A community member has associated this post with a similar question:
Issues with Access Permissions in PhoneLineTransportDevice API on Windows 11
Only moderators can edit this content.
Unable to get access permission of PhoneLineTransportDevice on Windows 11 22H2
I am attempting to use the PhoneLineTransportDevice API to develop a hands-free application for Windows. The first step is to call PhoneLineTransportDevice.RequestAccessAsync() in order to request access permissions. This has worked fine on my development PC running Windows 10.
I'm having trouble getting the same code to work on another PC running Windows 11 22H2, despite there being no differences in the code or API usage. Specifically, PhoneLineTransportDevice.RequestAccessAsync() always returns “DeniedBySystem" on this PC, no matter what steps I take.
Here is a snippet of the relevant code:
var access = await PhoneLineTransportDevice.RequestAccessAsync();
if (access != DeviceAccessStatus.AlwaysAllowed && access != DeviceAccessStatus.AllowedSubjectToSystemPolicy)
{
return default(BackgroundTaskRegistration);
}