Esempio n. 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");
            }
        }
Esempio n. 2
0
        void bwRegisterSIPUser_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            try
            {
                TimeCounterCollection = new Hashtable();
                for (int i = 0; i < 6; i++)
                {
                    TimeCounterCollection.Add(i, "0:00:00");
                }
                VMuktiService.BasicHttpClient bhcSuperNode = new VMuktiService.BasicHttpClient();
                SNChannel = (IService)bhcSuperNode.OpenClient<IService>("http://" + VMuktiAPI.VMuktiInfo.CurrentPeer.SuperNodeIP + ":80/SNService");
                //**creating Supernode channel for SIP Numbers and SIP Conferencees
                string strSIPServerIP = VMuktiInfo.CurrentPeer.SuperNodeIP;
                string strSIPNumber = SNChannel.svcAddSIPUser();

                strSoftPhoneSIPNumber = strSIPNumber;
                strSoftPhoneSIPPassword = strSIPNumber;
                strSoftPhoneSIPServer = strSIPServerIP;

                
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "FncRegister()", "Audio\\ctlDialer.xaml.cs");
            }
        }
 public void FncRegister(object sender, VMuktiEventArgs e)
 {
     try
     {
         if (VMuktiAPI.VMuktiInfo.strExternalPBX == "true")
         {
             try
             {
                 RClient = new RTCClient(e._args[0].ToString(), e._args[1].ToString(), e._args[2].ToString());
                 lblUserNumber.Content = e._args[0].ToString() + "@" + e._args[2].ToString();
                 RClient.entstatus += new RTCClient.delStatus(RClient_entstatus);
                 RClient.NonHumanDetected += OnNonHumanDetected;
             }
             catch (Exception ex)
             {
                 VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "FncRegister()--1", "ctlDialer.xaml.cs");
             }
         }
         else
         {
             string strSIPNumber = "";
             if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
             {
                 VMuktiService.BasicHttpClient bhcSuperNode = new VMuktiService.BasicHttpClient();
                 SNChannelPredictive = (IService)bhcSuperNode.OpenClient<IService>("http://" + VMuktiAPI.VMuktiInfo.CurrentPeer.SuperNodeIP + ":80/SNServicePredictive");
                 strSIPServerIP = VMuktiInfo.CurrentPeer.SuperNodeIP;
                 strSIPNumber = SNChannelPredictive.svcAddSIPUser();
             }
             else
             {
                 strSIPNumber = FncAddSIPUser();
                 strSIPServerIP = VMuktiAPI.VMuktiInfo.CurrentPeer.CurrentMachineIP.ToString();
             }
             VMuktiHelper.CallEvent("SetAgentNumber", this, new VMuktiEventArgs(strSIPNumber, strSIPNumber, strSIPServerIP));
             RClient = new RTCClient(strSIPNumber, strSIPNumber, strSIPServerIP);
             lblUserNumber.Content = strSIPNumber + "@" + strSIPServerIP;
             RClient.entstatus += new RTCClient.delStatus(RClient_entstatus);
             RClient.NonHumanDetected += OnNonHumanDetected;
         }
     }
     catch (Exception ex)
     {
         VMuktiHelper.ExceptionHandler(ex, "FncRegister()", "ctlPredictivePhone.xaml.cs");
     }
 }