Beispiel #1
0
        void mNativeEventsListener_onAVCallEvent(object sender, SipAVCallEventArgs e)
        {
            this.Dispatcher.BeginInvoke((System.Threading.ThreadStart) delegate
            {
                mViewModel.CallState = e.State;

                if ((e.State == SipAVCallState.Incoming || e.State == SipAVCallState.InCall) && !(mViewModel is CallStatusViewModel))
                {
                    SipService sipService = BackgroundProcessController.Instance.SipService;
                    if (sipService != null)
                    {
                        SipAVCall avCall = sipService.SipActiveAVCall;
                        if (avCall != null && avCall.UriRemote != null)
                        {
                            mViewModel.Page.NavigationService.Navigate(new Uri(NavigationUri.BuildReceiveCallUriString("/CallPage.xaml", avCall.UriRemote.getUserName(), avCall.WithVideo), UriKind.Relative));
                            return;
                        }
                    }
                }

                if (mViewModel is CallStatusViewModel)
                {
                    (mViewModel as CallStatusViewModel).Update();
                }

                if (e.SipCode > 299)
                {
                    mViewModel.CallStateText = e.Description;
                }
            });
        }
Beispiel #2
0
        void mNativeEventsListener_onAVCallEvent(object sender, SipAVCallEventArgs e)
        {
            this.Dispatcher.BeginInvoke((System.Threading.ThreadStart)delegate
            {
                mViewModel.CallState = e.State;

                if ((e.State == SipAVCallState.Incoming || e.State == SipAVCallState.InCall) && !(mViewModel is CallStatusViewModel))
                {
                    SipService sipService = BackgroundProcessController.Instance.SipService;
                    if (sipService != null)
                    {
                        SipAVCall avCall = sipService.SipActiveAVCall;
                        if (avCall != null && avCall.UriRemote != null)
                        {
                            mViewModel.Page.NavigationService.Navigate(new Uri(NavigationUri.BuildReceiveCallUriString("/CallPage.xaml", avCall.UriRemote.getUserName(), avCall.WithVideo), UriKind.Relative));
                            return;
                        }
                    }
                }

                if (mViewModel is CallStatusViewModel)
                {
                    (mViewModel as CallStatusViewModel).Update();
                }

                if (e.SipCode > 299)
                {
                    mViewModel.CallStateText = e.Description;
                }
            });
        }