Пример #1
0
        /// <summary>
        /// 注册SIP服务器
        /// </summary>
        private void RegisterSip()
        {
            SipAccount MySipAccount = new SipAccount(frmMain.m_SqlHelper);
            string     strError     = "";

            m_SipAccount = MySipAccount.GetDefaultSipAccount(ref strError);
            if (m_SipAccount.ID > 0)
            {
                m_Phone.RegisterSipServer(m_SipAccount.Server, m_SipAccount.Port, m_SipAccount.Name, m_SipAccount.Pwd, 0, m_SipAccount.Domain, false, "", false, "");
            }
            m_Dialer.UpdateSipAccount(m_SipAccount);
            //m_Phone.RegisterSipServer("192.168.0.247", 5060, "1019", "123456", 0, "192.168.0.247", false, "", false, "");
        }
Пример #2
0
        /// <summary>
        /// 更新控件值
        /// </summary>
        public void UpdateCtrlValue()
        {
            lbStatus.Text = "";
            SipAccount MySipAccount = new SipAccount(frmMain.m_SqlHelper);
            string     strError     = "";

            m_sttSipAccount = MySipAccount.GetDefaultSipAccount(ref strError);
            if (strError.Trim().Length > 0)
            {
                lbStatus.Text      = strError;
                lbStatus.ForeColor = Color.Red;
                //MessageBox.Show(strError, "错误");
                return;
            }
            if (m_sttSipAccount.ID > 0)
            {
                txtUserName.Text = m_sttSipAccount.Name;
                txtUserPwd.Text  = m_sttSipAccount.Pwd;
                txtServer.Text   = m_sttSipAccount.Server + ":" + m_sttSipAccount.Port.ToString();
                txtDomain.Text   = m_sttSipAccount.Domain;
            }
        }
Пример #3
0
 /// <summary>
 /// 更新SIP账号
 /// </summary>
 /// <param name="sttAccount"></param>
 public void UpdateSipAccount(SipAccountStruct sttAccount)
 {
     lbAccount.Text = sttAccount.Name + "@" + sttAccount.Server + ":" + sttAccount.Port;
 }