0

I'm trying to simulate a call with the simplest code possible (juste for testing purposes). Here's the code I use:

var handleTypes = new[] { (NSNumber)(int)CXHandleType.PhoneNumber };

CXProviderConfiguration config = new CXProviderConfiguration("Test")
{
    MaximumCallsPerCallGroup = 1,
    SupportedHandleTypes = new NSSet<NSNumber>(handleTypes)
};

CXProvider provider = new CXProvider(config);

provider.SetDelegate(new ProviderDelegate(), null);

CXCallController controller = new CXCallController();
CXHandle handle = new CXHandle(CXHandleType.Generic, "test");
CXStartCallAction action = new CXStartCallAction(new NSUuid(), handle);
CXTransaction transaction = new CXTransaction(action);

controller.RequestTransaction(transaction, (error) =>
{
    Console.WriteLine(error);
});

My ProviderDelegate looks like this:

class ProviderDelegate : CXProviderDelegate
{
    public override void DidReset(CXProvider provider)
    {

    }

    public override void PerformAnswerCallAction(CXProvider provider, CXAnswerCallAction action)
    {
        base.PerformAnswerCallAction(provider, action);
    }

    public override void PerformEndCallAction(CXProvider provider, CXEndCallAction action)
    {
        base.PerformEndCallAction(provider, action);
    }

    public override void PerformStartCallAction(CXProvider provider, CXStartCallAction action)
    {
        base.PerformStartCallAction(provider, action);
    }

    public override void PerformSetHeldCallAction(CXProvider provider, CXSetHeldCallAction action)
    {
        base.PerformSetHeldCallAction(provider, action);
    }

    public override void TimedOutPerformingAction(CXProvider provider, CXAction action)
    {
        base.TimedOutPerformingAction(provider, action);
    }

    public override void DidActivateAudioSession(CXProvider provider, AVAudioSession audioSession)
    {
        base.DidActivateAudioSession(provider, audioSession);
    }

    public override void DidDeactivateAudioSession(CXProvider provider, AVAudioSession audioSession)
    {
        base.DidDeactivateAudioSession(provider, audioSession);
    }

    public void ReportIncomingCall(NSUuid uuid, string handle)
    {

    }
}

Again, I'm just trying to get something to show on screen. The ProviderDelegate has breakpoints in every method so I know when they get called.

When I run the code, I get called back in my (error)=> delegate, with error Couldn’t communicate with a helper application. NSCocoaErrorDomain:4097.

Notes: I've added the VoIP entitlement to my app, reinstalled everything, running macOS with the latest version as well as the latest Xcode.

Philippe Paré
  • 4,279
  • 5
  • 36
  • 56

0 Answers0