Пример #1
0
 public static extern int linphone_event_deny_subscription(IntPtr lev, LinphoneReason reason);
 public static extern int linphone_event_deny_subscription(IntPtr lev, LinphoneReason reason);
 public DeclineCallCommand(IntPtr callPtr, LinphoneReason reason)
     : base(LinphoneCommandType.DeclineCall, callPtr)
 {
     _reason = reason;
 }
Пример #4
0
 public static extern void linphone_core_disable_chat(IntPtr lc, LinphoneReason deny_reason);
Пример #5
0
 public static extern int linphone_core_decline_call(IntPtr lc, IntPtr call, LinphoneReason reason);
Пример #6
0
 public DeclineCallCommand(IntPtr callPtr, LinphoneReason reason)
     : base(LinphoneCommandType.DeclineCall, callPtr)
 {
     _reason = reason;
 }
        private void OnRegistrationChanged(LinphoneRegistrationState state, LinphoneReason reason)
        {
            if (RegistrationState == state)
                return;

            if (this.Dispatcher.Thread != Thread.CurrentThread)
            {
                this.Dispatcher.BeginInvoke((Action)(() => this.OnRegistrationChanged(state, reason)));
                return;
            }
            LOG.Info(String.Format("Registration state changed from {0} to {1}. Reason: {2}", RegistrationState, state, reason));
            var processSignOut = false;
            RegistrationState = state;
            RegistrationFailReason = reason;

            this.BtnMoreMenu.IsEnabled = true;
            _mainViewModel.ContactModel.RegistrationState = state;
            switch (state)
            {
                case LinphoneRegistrationState.LinphoneRegistrationProgress:
                    this.BtnMoreMenu.IsEnabled = false;
                    // VATRP-3225: here we want to kick off a timer - if we do not get the OK in a reasonable amount of time, then
                    //   we need to doa reset - preferably behind the scenes - and try to log in again.
                    lock (regLock)
                    {
                        if (registrationTimer == null)
                        {
                            registrationTimer = new System.Timers.Timer();
                            registrationTimer.Elapsed += new System.Timers.ElapsedEventHandler(RegistrationTimerTick);
                            registrationTimer.Interval = 30000;
                            registrationTimer.Enabled = true;
                            registrationTimer.Start();
                        }
                    }
                    return;
                case LinphoneRegistrationState.LinphoneRegistrationOk:
                    DestroyRegistrationTimer();

                    _playRegistrationFailureNotify = true;
                    if (_playRegisterNotify)
                    {
                        _playRegisterNotify = false;
                        ServiceManager.Instance.SoundService.PlayConnectionChanged(true);
                    }
                    signOutRequest = false;
                    break;
                case LinphoneRegistrationState.LinphoneRegistrationNone:
                case LinphoneRegistrationState.LinphoneRegistrationFailed:
                    DestroyRegistrationTimer();

                    if (state == LinphoneRegistrationState.LinphoneRegistrationFailed)
                    {
                        signOutRequest = false;
                        _playRegisterNotify = true;
                        if (_playRegistrationFailureNotify)
                        {
                            ServiceManager.Instance.SoundService.PlayConnectionChanged(false);
                            _playRegistrationFailureNotify = false;
                        }
                        lock (regLock)
                        {
                            registrationTimer = new System.Timers.Timer();
                            registrationTimer.Elapsed += new System.Timers.ElapsedEventHandler(RegistrationTimerTick);
                            registrationTimer.Interval = 120000;
                            registrationTimer.Start();
                        }
                        Debug.WriteLine("Start register retry timer: ");
                    }
                    break;
                case LinphoneRegistrationState.LinphoneRegistrationCleared:
                    DestroyRegistrationTimer();

                    ServiceManager.Instance.SoundService.PlayConnectionChanged(false);
                    _playRegisterNotify = true;
                    _playRegistrationFailureNotify = false;
                    if (registerRequested)
                    {
                        registerRequested = false;
                        _linphoneService.Register();
                    }
                    else if (signOutRequest || defaultConfigRequest)
                    {
                        processSignOut = true;
                    }

                    break;
                default:
                    break;
            }
            UpdateMenuSettingsForRegistrationState();
            if (processSignOut)
            {
                ProceedToLoginPage();
                signOutRequest = false;
            }
        }