예제 #1
0
        public void FncRegister(object sender, VMuktiEventArgs e)
        {
            try
            {
                DataSet da = new DataSet();
                if (VMuktiAPI.VMuktiInfo.strExternalPBX == "true")
                {
                    try
                    {
                        //MessageBox.show("Sip Number is: " + e._args[0].ToString() + "and Sip server is: " + e._args[2].ToString());
                        if (blIsVista)
                        {
                            ClientNetP2PRTCVistaChannel.svcRegisterSIPPhone(e._args[0].ToString(), e._args[1].ToString(), e._args[2].ToString());
                        }
                        else
                        {
                            RClient = new RTCClient(e._args[0].ToString(), e._args[1].ToString(), e._args[2].ToString());
                            RClient.entstatus += new RTCClient.delStatus(RClient_entstatus);
                            RClient.NonHumanDetected += OnNonHumanDetected;
                        }
                        lblUserNumber.Content = e._args[0].ToString() + "@" + e._args[2].ToString();
                    }
                    catch (Exception ex)
                    {
                        VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "FncRegister()--1", "ctlDialer.xaml.cs");
                    }
                }
                else
                {
                    //SNChannel = (IService)bhcSuperNode.OpenClient<IService>("http://210.211.254.132:80/SNService");
                    //string strSIPNumber = "2118";
                    ///string strSIPServerIP = "210.211.254.132";

                    string strSIPNumber = "";
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                    {
                        VMuktiService.BasicHttpClient bhcSuperNode = new VMuktiService.BasicHttpClient();
                        SNChannel = (IService)bhcSuperNode.OpenClient<IService>("http://" + VMuktiAPI.VMuktiInfo.CurrentPeer.SuperNodeIP + ":80/SNService");
                        strSIPServer = VMuktiInfo.CurrentPeer.SuperNodeIP;
                        strSIPNumber = SNChannel.svcAddSIPUser();
                    }
                    else
                    {
                        strSIPNumber = FncAddSIPUser();
                        strSIPServer = VMuktiAPI.VMuktiInfo.CurrentPeer.CurrentMachineIP.ToString();
                    }

                    if (blIsVista)
                    {
                        ClientNetP2PRTCVistaChannel.svcRegisterSIPPhone(strSIPNumber, strSIPNumber, strSIPServer);
                    }
                    else
                    {
                        RClient = new RTCClient(strSIPNumber, strSIPNumber, strSIPServer);
                        RClient.entstatus += new RTCClient.delStatus(RClient_entstatus);
                        RClient.NonHumanDetected += OnNonHumanDetected;
                    }
                    lblUserNumber.Content = strSIPNumber + "@" + strSIPServer;
                }
             
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "FncRegister()--2", "ctlDialer.xaml.cs");
            }
        }
예제 #2
0
        public void FncRegisterfromEvent(object sender, VMuktiEventArgs e)
        {
            try
            {
                if (blIsVista)
                {
                    ClientNetP2PRTCVistaChannel.svcRegisterSIPPhone(e._args[0].ToString(), e._args[1].ToString(), e._args[2].ToString());
                }
                else
                {
                    RClient = new RTCClient(e._args[0].ToString(), e._args[1].ToString(), e._args[2].ToString());
                    RClient.entstatus += new RTCClient.delStatus(RClient_entstatus);
                }
                lblUserNumber.Content = e._args[0].ToString() + "@" + e._args[2].ToString();

                //RClient = new RTCClient("3000", "3000", "59.165.20.15");
                //lblUserName.Content=@"[email protected]";
				RClient.NonHumanDetected += OnNonHumanDetected;
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "FncRegisterfromEvent()", "ctlDialer.xaml.cs");
            }
        }