Exemplo n.º 1
0
        public void OnCallStateChanged(object sender, CallStateArgs e)
        {
            if (AccountId != e.AccountId)
            {
                return;
            }

            int userData = App.SIPUA.GetCallUserData(e.CallId);

            if (userData != 0 && userData != (int)Id)
            {
                return;
            }

            if (e.STATE == sua_inv_state.PJSIP_INV_STATE_CONFIRMED)
            {
                Channel.IsBusy = true;
                Channel.CallId = e.CallId;

                SIPUri uri = new SIPUri(e.RemoteUri);
                Channel.SectionName = uri.User;
            }
            else if (e.STATE == sua_inv_state.PJSIP_INV_STATE_DISCONNECTED)
            {
                Channel.CallId      = -1;
                Channel.IsBusy      = false;
                Channel.SectionName = string.Empty;
                Channel.ZoneName    = string.Empty;
            }
        }
Exemplo n.º 2
0
        public void OnCallStateChanged(object sender, CallStateArgs e)
        {
            if (e.CallId != _callId)
            {
                return;
            }

            if (e.STATE == sua_inv_state.PJSIP_INV_STATE_DISCONNECTED)
            {
                this.Dispatcher.Invoke(DispatcherPriority.Normal,
                                       new Action(
                                           delegate()
                {
                    this.Close();
                }
                                           ));
            }
        }