Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incoming call handle #7

Closed
vvtoan opened this issue Oct 17, 2021 · 5 comments
Closed

Incoming call handle #7

vvtoan opened this issue Oct 17, 2021 · 5 comments

Comments

@vvtoan
Copy link

vvtoan commented Oct 17, 2021

Hi.
I want to handle incoming call to display customer's informations in our crm. Is there any api can do that?
When i use
var result = await BTDevice.GetRfcommServicesForIdAsync(RfcommServiceId.FromUuid( new Guid("0000111F-0000-1000-8000-00805F9B34FB")),BluetoothCacheMode.Uncached);

            if (result.Services.Count > 0)
            {
                BTService = result.Services[0];
                var status = await BTService.RequestAccessAsync();
                BTSocket = new StreamSocket();
                await BTSocket.ConnectAsync(BTService.ConnectionHostName, BTService.ConnectionServiceName,
                    SocketProtectionLevel.BluetoothEncryptionAllowNullAuthentication);

                _writer = new DataWriter(BTSocket.OutputStream);
                _reader = new DataReader(BTSocket.InputStream);

                return true;
            }
            else
            {
                Debug.WriteLine("This device does not support HFP");
                return false;
            }

I has an error 'DeniedBySystem'

Thanks you.

@BestOwl
Copy link
Owner

BestOwl commented Oct 18, 2021

Is this a UWP or Win32 app?

@BestOwl
Copy link
Owner

BestOwl commented Oct 18, 2021

The HFP demo here should work without errors.

@vvtoan
Copy link
Author

vvtoan commented Oct 18, 2021

Hi
"Is this a UWP or Win32 app?": UWP app
When i run HFP demo i get an error.
image

@BestOwl
Copy link
Owner

BestOwl commented Oct 18, 2021

You should run the Do() method instead.

DoTest is a demo to show how to use the PhoneLineTransportDevice API, which can only be called in an MSIX-packaged app. That's why you got this error in MyPhone.Demo because it is a Win32 .NET console app. I will document the demo code later.

For UWP apps, if you want to use the PhoneLineTransportDevice API, you need to add these permissions in the manifest:

<uap:Capability Name="phoneCall"/>
<rescap:Capability Name="phoneLineTransportManagement"/>
<rescap:Capability Name="phoneCallSystem"/>

@vvtoan
Copy link
Author

vvtoan commented Oct 23, 2021

This issues was resolved.
Thanks you.

@vvtoan vvtoan closed this as completed Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants