Esempio n. 1
0
        //public override void DidBegin(CXProvider provider)
        //{
        //    //base.DidBegin(provider);
        //}
        //public override bool ExecuteTransaction(CXProvider provider, CXTransaction transaction)
        //{
        //    //return base.ExecuteTransaction(provider, transaction);
        //}



        #endregion

        #region Public Methods
        public void ReportIncomingCall(NSUuid uuid, string handle)
        {
            Console.WriteLine("CXProviderDelegate: ReportIncomingCall ");

            // Create update to describe the incoming call and caller
            var update = new CXCallUpdate();

            update.RemoteHandle = new CXHandle(CXHandleType.Generic, handle);
            //update.RemoteHandle = new CXHandle(CXHandleType.PhoneNumber, handle);
            //update.RemoteHandle = new CXHandle(CXHandleType.EmailAddress, handle);

            // Report incoming call to system
            Provider.ReportNewIncomingCall(uuid, update, (error) =>
            {
                // Was the call accepted
                if (error == null)
                {
                    // Yes, report to call manager
                    CallManager.Calls.Add(new ActiveCall(uuid, handle, false));
                }
                else
                {
                    // Report error to user here
                    Console.WriteLine("Error: {0}", error);
                }
            });
        }
Esempio n. 2
0
        public void ReportIncomingCall(NSUuid uuid, string handle)
        {
            // Create update to describe the incoming call and caller
            var update = new CXCallUpdate
            {
                RemoteHandle = new CXHandle(CXHandleType.Generic, handle)
            };

            // Report incoming call to system
            Provider.ReportNewIncomingCall(uuid, update, (error) => {
                // Was the call accepted
                if (error == null)
                {
                    // Yes, report to call manager
                    CallManager.Calls.Add(new ActiveCall(uuid, handle, false));
                }
                else
                {
                    // Report error to user here
                    if (error.Code == (int)CXErrorCodeIncomingCallError.CallUuidAlreadyExists)
                    {
                        // Handle duplicate call ID
                    }
                    else if (error.Code == (int)CXErrorCodeIncomingCallError.FilteredByBlockList)
                    {
                        // Handle call from blocked user
                    }
                    else if (error.Code == (int)CXErrorCodeIncomingCallError.FilteredByDoNotDisturb)
                    {
                        // Handle call while in do-not-disturb mode
                    }
                    else
                    {
                        // Handle unknown error
                    }
                    Console.WriteLine("Error: {0}", error);
                }
            });
        }
Esempio n. 3
0
 public virtual void ReportNewIncomingCall(NSUuid uuid, CXCallUpdate update, Action <NSError> completion) => throw new PlatformNotSupportedException(Constants.UnavailableOnMacOS);
Esempio n. 4
0
 public virtual Task ReportNewIncomingCallAsync(NSUuid uuid, CXCallUpdate update) => throw new PlatformNotSupportedException(Constants.UnavailableOnMacOS);
Esempio n. 5
0
 public virtual void ReportCall(NSUuid uuid, CXCallUpdate update) => throw new PlatformNotSupportedException(Constants.UnavailableOnMacOS);