示例#1
0
        public Window1()
        {
            InitializeComponent();
            try
            {
                el            = new System.Diagnostics.EventLog("Application", Environment.MachineName, "Audio_Vista");
                this.Closing += new System.ComponentModel.CancelEventHandler(Window1_Closing);

                npsVistaAudio = new VMuktiService.NetPeerServer("net.tcp://localhost:6060/NetP2PRTCVista");
                npsVistaAudio.AddEndPoint("net.tcp://localhost:6060/NetP2PRTCVista");
                npsVistaAudio.OpenServer();

                npcRTCVistaClient = new VMuktiService.NetPeerClient();
                objNetP2PRTCVista = new clsNetTcpRTCVistaService();
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcJoin             += new clsNetTcpRTCVistaService.DelsvcJoin(Window1_entsvcJoin);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcCreateRTCClient  += new clsNetTcpRTCVistaService.DelsvcCreateRTCClient(Window1_entsvcCreateRTCClient);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcRegisterSIPPhone += new clsNetTcpRTCVistaService.DelsvcRegisterSIPPhone(Window1_entsvcRegisterSIPPhone);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcAnswer           += new clsNetTcpRTCVistaService.DelsvcAnswer(Window1_entsvcAnswer);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcDial             += new clsNetTcpRTCVistaService.DelsvcDial(Window1_entsvcDial);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcHangup           += new clsNetTcpRTCVistaService.DelsvcHangup(Window1_entsvcHangup);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcHold             += new clsNetTcpRTCVistaService.DelsvcHold(Window1_entsvcHold);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcSendDTMF         += new clsNetTcpRTCVistaService.DelsvcSendDTMF(Window1_entsvcSendDTMF);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcTransfer         += new clsNetTcpRTCVistaService.DelsvcTransfer(Window1_entsvcTransfer);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcRTCEvent         += new clsNetTcpRTCVistaService.DelsvcRTCEvent(Window1_entsvcRTCEvent);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcUnJoin           += new clsNetTcpRTCVistaService.DelsvcUnJoin(Window1_entsvcUnJoin);
                ClientNetP2PRTCVistaChannel = (INetTcpRTCVistaServiceChannel)npcRTCVistaClient.OpenClient <INetTcpRTCVistaServiceChannel>("net.tcp://localhost:6060/NetP2PRTCVista", "NetP2PRTCVistaMesh", ref objNetP2PRTCVista);
                ClientNetP2PRTCVistaChannel.svcJoin();
            }
            catch (Exception ex)
            {
                el.WriteEntry("Window1:" + ex.Message);
                el.Close();
            }
        }
示例#2
0
        public Window1()
        {
            InitializeComponent();
            try
            {
                el = new System.Diagnostics.EventLog("Application", Environment.MachineName, "Audio_Vista");
                this.Closing += new System.ComponentModel.CancelEventHandler(Window1_Closing);

                npsVistaAudio = new VMuktiService.NetPeerServer("net.tcp://localhost:6060/NetP2PRTCVista");
                npsVistaAudio.AddEndPoint("net.tcp://localhost:6060/NetP2PRTCVista");
                npsVistaAudio.OpenServer();

                npcRTCVistaClient = new VMuktiService.NetPeerClient();
                objNetP2PRTCVista = new clsNetTcpRTCVistaService();
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcJoin += new clsNetTcpRTCVistaService.DelsvcJoin(Window1_entsvcJoin);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcCreateRTCClient += new clsNetTcpRTCVistaService.DelsvcCreateRTCClient(Window1_entsvcCreateRTCClient);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcRegisterSIPPhone += new clsNetTcpRTCVistaService.DelsvcRegisterSIPPhone(Window1_entsvcRegisterSIPPhone);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcAnswer += new clsNetTcpRTCVistaService.DelsvcAnswer(Window1_entsvcAnswer);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcDial += new clsNetTcpRTCVistaService.DelsvcDial(Window1_entsvcDial);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcHangup += new clsNetTcpRTCVistaService.DelsvcHangup(Window1_entsvcHangup);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcHold += new clsNetTcpRTCVistaService.DelsvcHold(Window1_entsvcHold);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcSendDTMF += new clsNetTcpRTCVistaService.DelsvcSendDTMF(Window1_entsvcSendDTMF);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcTransfer += new clsNetTcpRTCVistaService.DelsvcTransfer(Window1_entsvcTransfer);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcRTCEvent += new clsNetTcpRTCVistaService.DelsvcRTCEvent(Window1_entsvcRTCEvent);
                ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcUnJoin += new clsNetTcpRTCVistaService.DelsvcUnJoin(Window1_entsvcUnJoin);
                ClientNetP2PRTCVistaChannel = (INetTcpRTCVistaServiceChannel)npcRTCVistaClient.OpenClient<INetTcpRTCVistaServiceChannel>("net.tcp://localhost:6060/NetP2PRTCVista", "NetP2PRTCVistaMesh", ref objNetP2PRTCVista);
                ClientNetP2PRTCVistaChannel.svcJoin();

            }
            catch (Exception ex)
            {
                el.WriteEntry("Window1:" + ex.Message);
                el.Close();
            }
        }
示例#3
0
 void Window1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     try
     {
         npsVistaAudio.CloseServer();
         npcRTCVistaClient.CloseClient <INetTcpRTCVistaServiceChannel>();
         ClientNetP2PRTCVistaChannel = null;
         objNetP2PRTCVista           = null;
     }
     catch (Exception ex)
     {
         el.WriteEntry("Window1_Closing: " + ex.Message);
         el.Close();
     }
 }
        public void ClosePod()
        {
            try
            {
                for (int i = 0; i < btnChannels.Length; i++)
                {
                    if (btnChannels[i].Tag.ToString() == "Running" || btnChannels[i].Tag.ToString() == "Hold" || btnChannels[i].Tag.ToString() == "Conference" || btnChannels[i].Tag.ToString() == "ConfHold")
                    {
                        btnChannels[i].Tag = "Free";
                        btnChannels[i].Background = Brushes.Transparent;
                        if (blIsVista)
                        {
                            ClientNetP2PRTCVistaChannel.svcHangup(i + 1);
                        }
                        else
                        {
                            RClient.HangUp(i + 1);
                        }
                    }
                }



                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithNetP2P || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.SuperNode || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.BootStrap)
                {
                    if (NetP2PChannel != null)
                    {
                        NetP2PChannel.svcP2PUnJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                    }
                }
                else
                {
                    if (Httpchannel != null)
                    {
                        Httpchannel.svcUnJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                    }
                }


                if (NetP2PChannel != null)
                {
                    NetP2PChannel.Close();
                    NetP2PChannel.Dispose();
                    NetP2PChannel = null;
                }
                if (Httpchannel != null)
                {
                    Httpchannel = null;
                }
                if (ClientNetP2PRTCVistaChannel != null)
                {
                    if (p != null)
                    {
                        p.Kill();
                        p.CloseMainWindow();
                        p.Close();
                        p.Dispose();
                        p = null;
                    }
                    ClientNetP2PRTCVistaChannel.svcUnJoin();
                    npcRTCVistaClient.CloseClient<INetTcpRTCVistaServiceChannel>();
                }
                if (ClientNetP2PRTCVistaChannel != null)
                {
                    ClientNetP2PRTCVistaChannel.Close();
                    ClientNetP2PRTCVistaChannel.Dispose();
                    ClientNetP2PRTCVistaChannel = null;
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ClosePOD()", "Audio\\ctlDialer.xaml.cs");
            }
        }
        public ctlDialer(VMuktiAPI.PeerType bindingtype, string uri, ModulePermissions[] MyPermissions, string Role)
        {
            try
            {
                InitializeComponent();
                ClsException.WriteToLogFile("Audio module Constructor has been Started");
                lstGlobalBuddyList = new List<string>();
                System.OperatingSystem osInfo = System.Environment.OSVersion;
                if (osInfo.Version.Major.ToString() == "6")
                {
                    blIsVista = true;
                    p = new System.Diagnostics.Process();
                    p.StartInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory.ToString() + @"\VistaAudio";
                    p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                    p.StartInfo.FileName = AppDomain.CurrentDomain.BaseDirectory.ToString() + @"\VistaAudio\VMuktiAudio.VistaService.exe";
                    p.Start();
                }
                else
                {
                    blIsVista = false;
                }


                _MyPermissions = MyPermissions;
                //FncPermissionsReview();            
                strMyRole = Role;
                btnTransfer.IsEnabled = false;
                btnDTMF.IsEnabled = false;
                btnHangup.IsEnabled = false;
                btnHold.IsEnabled = false;
                btnAccept.IsEnabled = false;
                btnReject.IsEnabled = false;
                btnCall.IsEnabled = true;
                btnConference.IsEnabled = true;
                btnPad.Click += new RoutedEventHandler(btnPad_Click);
                btnReject.Click += new RoutedEventHandler(btnReject_Click);
                btnAccept.Click += new RoutedEventHandler(btnAccept_Click);
                btnCancel.Click += new RoutedEventHandler(btnCancel_Click);
                btnTransfer.Click += new RoutedEventHandler(btnTransfer_Click);
                btnDTMF.Click += new RoutedEventHandler(btnDTMF_Click);
                btnCall.Click += new RoutedEventHandler(btnCall_Click);
                btnHangup.Click += new RoutedEventHandler(btnHangup_Click);
                btnHold.Click += new RoutedEventHandler(btnHold_Click);
                btnConference.Click += new RoutedEventHandler(btnConference_Click);
                objDelStartconference = new DelStartconference(FncStartConference);
                objDelSetConferenceUsers = new DelSetConferenceUsers(FncSetConferenceUsers);
                objDelStartIntitialConfrence = new DelStartInitialConference(FbcStartInitialConference);
                btnChannels = new Button[6];
                int btnLeft = 5;
                int btnTop = 47;
                for (int i = 0; i < 6; i++)
                {
                    (btnChannels[i]) = new Button();
                    btnChannels[i].Height = 20;
                    btnChannels[i].Width = 34;
                    btnChannels[i].Content = (i + 1).ToString();
                    btnChannels[i].Name = "btnCh" + (i + 1).ToString();
                    btnChannels[i].FontSize = 11;
                    btnChannels[i].BorderThickness = new Thickness(0, 0, 0, 0);
                    btnChannels[i].Margin = new Thickness(btnLeft, btnTop, 0, 0);
                    btnLeft = btnLeft + 39;
                    btnChannels[i].Click += new RoutedEventHandler(ChClick);
                    btnChannels[i].Tag = "Free";
                    btnChannels[i].IsEnabled = true;
                    CnvPhoneProperty.Children.Add(btnChannels[i]);
                    
                }
                t1 = new System.Timers.Timer(1000);
                t1.Elapsed += new System.Timers.ElapsedEventHandler(t1_Elapsed);
                UcPredictiveSoftPhone.AllowDrop = true;
                this.PreviewKeyDown += new System.Windows.Input.KeyEventHandler(ctlDialer_PreviewKeyDown);
                Application.Current.Exit += new ExitEventHandler(Current_Exit);

                if (blIsVista)
                {
                    System.Threading.Thread.Sleep(30000);
                    npcRTCVistaClient = new VMuktiService.NetPeerClient();
                    objNetP2PRTCVista = new clsNetTcpRTCVistaService();
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcJoin += new clsNetTcpRTCVistaService.DelsvcJoin(ctlDialer_entsvcJoin);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcCreateRTCClient += new clsNetTcpRTCVistaService.DelsvcCreateRTCClient(ctlDialer_entsvcCreateRTCClient);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcRegisterSIPPhone += new clsNetTcpRTCVistaService.DelsvcRegisterSIPPhone(ctlDialer_entsvcRegisterSIPPhone);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcAnswer += new clsNetTcpRTCVistaService.DelsvcAnswer(ctlDialer_entsvcAnswer);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcDial += new clsNetTcpRTCVistaService.DelsvcDial(ctlDialer_entsvcDial);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcHangup += new clsNetTcpRTCVistaService.DelsvcHangup(ctlDialer_entsvcHangup);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcHold += new clsNetTcpRTCVistaService.DelsvcHold(ctlDialer_entsvcHold);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcSendDTMF += new clsNetTcpRTCVistaService.DelsvcSendDTMF(ctlDialer_entsvcSendDTMF);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcTransfer += new clsNetTcpRTCVistaService.DelsvcTransfer(ctlDialer_entsvcTransfer);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcRTCEvent += new clsNetTcpRTCVistaService.DelsvcRTCEvent(ctlDialer_entsvcRTCEvent);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcUnJoin += new clsNetTcpRTCVistaService.DelsvcUnJoin(ctlDialer_entsvcUnJoin);
                    ClientNetP2PRTCVistaChannel = (INetTcpRTCVistaServiceChannel)npcRTCVistaClient.OpenClient<INetTcpRTCVistaServiceChannel>("net.tcp://localhost:6060/NetP2PRTCVista", "NetP2PRTCVistaMesh", ref objNetP2PRTCVista);
                    ClientNetP2PRTCVistaChannel.svcJoin();
                }

                bwRegisterSIPUser = new System.ComponentModel.BackgroundWorker();
                bwRegisterSIPUser.DoWork += new System.ComponentModel.DoWorkEventHandler(bwRegisterSIPUser_DoWork);
                bwRegisterSIPUser.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(bwRegisterSIPUser_RunWorkerCompleted);

                FncRegister(null, null);
                ClsException.WriteToLogFile("Going to start thread.");
                ThOpenClinet = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(FncOpenClinet));
                System.Collections.Generic.List<object> lstParameters = new System.Collections.Generic.List<object>();
                lstParameters.Add(bindingtype);
                lstParameters.Add(uri);
                ThOpenClinet.Start(lstParameters);

                //VMukti.Global.VMuktiGlobal.strBootStrapIPs[0] = "210.211.254.132";
                //VMukti.Global.VMuktiGlobal.strSuperNodeIP = "210.211.254.132";
                //VMukti.Global.VMuktiGlobal.strUserName = Environment.MachineName;
                
                ClsException.WriteToLogFile("Registering Singout event");
                VMuktiAPI.VMuktiHelper.RegisterEvent("SignOut").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_SignOut_VMuktiEvent);                
                objDelAsyncGetMessage = new DelAsyncGetMessage(delAsyncGetMessage);
                this.Loaded += new RoutedEventHandler(ctlDialer_Loaded);

                ///Object Creation to keep call information.
                objCallInfo = new ClsCallInfo();
                dtCallStartDate = new DateTime();
                TenMinTimer = new System.Windows.Threading.DispatcherTimer();
                TenMinTimer.Tick += new EventHandler(TenMinTimer_Tick);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ctlDialer", "Audio\\ctlDialer.xaml.cs");
            }
        }	   
示例#6
0
 void Window1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     try
     {
         npsVistaAudio.CloseServer();
         npcRTCVistaClient.CloseClient<INetTcpRTCVistaServiceChannel>();
         ClientNetP2PRTCVistaChannel = null;
         objNetP2PRTCVista = null;
     }
     catch (Exception ex)
     {
         el.WriteEntry("Window1_Closing: " + ex.Message);
         el.Close();
     }
 }
 public void ClosePod()
 {
     try
     {
         VMuktiHelper.UnRegisterEvent("RegisterAgent");
         VMuktiHelper.UnRegisterEvent("Dial");
         VMuktiHelper.UnRegisterEvent("HangUp");
         VMuktiHelper.UnRegisterEvent("StartManualDialing");
         VMuktiHelper.UnRegisterEvent("SetSoftPhoneEnable");
         VMuktiHelper.UnRegisterEvent("CallHangUPFromRender");
     
         if (channelNetTcp != null)
         {
             channelNetTcp.svcUnJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
             channelNetTcp.Close();
             channelNetTcp = null;
         }
         if (ClientNetP2PRTCVistaChannel != null)
         {
             if (ProcStartAudioVistaExe != null)
             {
                 ProcStartAudioVistaExe.Kill();
                 ProcStartAudioVistaExe.CloseMainWindow();
                 ProcStartAudioVistaExe.Close();
                 ProcStartAudioVistaExe.Dispose();
                 ProcStartAudioVistaExe = null;
             }
             ClientNetP2PRTCVistaChannel.svcUnJoin();
             npcRTCVistaClient.CloseClient<INetTcpRTCVistaServiceChannel>();
         }
         if (ClientNetP2PRTCVistaChannel != null)
         {
             ClientNetP2PRTCVistaChannel.Close();
             ClientNetP2PRTCVistaChannel.Dispose();
             ClientNetP2PRTCVistaChannel = null;
         }
         if (!blIsVista)
         {
             try
             {
                 RClient.StopSniffing();
             }
             catch { }
         }
     }
     catch (Exception ex)
     {
         VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ClosePod()", "ctlDialer.xaml.cs");
     }
 }
        public ctlDialer(VMuktiAPI.PeerType objLocalPeerType, string uri, ModulePermissions[] MyPermissions,string Role)
        {
            InitializeComponent();
             System.OperatingSystem osInfo = System.Environment.OSVersion;
             if (osInfo.Version.Major.ToString() == "6")
             {
                 blIsVista = true;
                 ProcStartAudioVistaExe = new System.Diagnostics.Process();
                 ProcStartAudioVistaExe.StartInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory.ToString() + @"\VistaAudio";
                 ProcStartAudioVistaExe.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                 ProcStartAudioVistaExe.StartInfo.FileName = AppDomain.CurrentDomain.BaseDirectory.ToString() + @"\VistaAudio\VMuktiAudio.VistaService.exe";
                 ProcStartAudioVistaExe.Start();
             }
             else
             {
                 blIsVista = false;
             }
            objPeerType = objLocalPeerType;
            _MyPermissions = MyPermissions;
            FncPermissionsReview();
            try
            {
                btnPad.Click += new RoutedEventHandler(btnPad_Click);
                btnReject.Click += new RoutedEventHandler(btnReject_Click);
                btnAccept.Click += new RoutedEventHandler(btnAccept_Click);
                btnCancel.Click += new RoutedEventHandler(btnCancel_Click);
                btnTransfer.Click += new RoutedEventHandler(btnTransfer_Click);
                btnDTMF.Click += new RoutedEventHandler(btnDTMF_Click);
                btnCall.Click += new RoutedEventHandler(btnCall_Click);
                btnHangup.Click += new RoutedEventHandler(btnHangup_Click);
                btnHold.Click += new RoutedEventHandler(btnHold_Click);
                btnConference.Click += new RoutedEventHandler(btnConference_Click);
                btnChannels = new Button[6];

                int btnLeft = 10;
                int btnTop = 60;
                for (int i = 0; i < 6; i++)
                {
                    (btnChannels[i]) = new Button();
                    btnChannels[i].Height = 20;
                    btnChannels[i].Width = 34;
                    btnChannels[i].Content = (i + 1).ToString();
                    btnChannels[i].Name = "btnCh" + (i + 1).ToString();
                    btnChannels[i].FontSize = 11;
                    btnChannels[i].BorderThickness = new Thickness(0, 0, 0, 0);
                    btnChannels[i].Margin = new Thickness(btnLeft, btnTop, 0, 0);
                    btnLeft = btnLeft + 39;
                    btnChannels[i].Click += new RoutedEventHandler(ChClick);
                    btnChannels[i].Tag = "Free";
                    btnChannels[i].IsEnabled = false;
                    CnvPhoneProperty.Children.Add(btnChannels[i]);
                    TimeCounterCollection.Add(i, "0:00:00");
                }
                VMuktiHelper.RegisterEvent("RegisterAgent").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(FncRegister);
                VMuktiHelper.RegisterEvent("Dial").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEventDial);
                VMuktiHelper.RegisterEvent("HangUp").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEventHangUp);
                VMuktiHelper.RegisterEvent("StartManualDialing").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEventStartManualDialing);
                VMuktiHelper.RegisterEvent("SetSoftPhoneEnable").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEvent_SetSoftPhoneEnable);
                VMuktiHelper.RegisterEvent("CallHangUPFromRender").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEvent);
                VMuktiAPI.VMuktiHelper.RegisterEvent("SignOut").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEventSignOut);
                t1 = new System.Timers.Timer(1000);
                t1.Elapsed += new System.Timers.ElapsedEventHandler(t1_Elapsed);
                btnHold.IsEnabled = false;
                btnTransfer.IsEnabled = false;
                objDelDisplayName = new DelDisplayName(DisplayName);
                objHangupAdmin = new DelHangupAdmin(HangupAdmin);
                objBargeRequest = new DelBargeReqest(BargeRequest);

                Application.Current.Exit += new ExitEventHandler(Current_Exit);
                //FncRegister(null, null);

                if (blIsVista)
                {
                    System.Threading.Thread.Sleep(30000);
                    npcRTCVistaClient = new VMuktiService.NetPeerClient();
                    objNetP2PRTCVista = new clsNetTcpRTCVistaService();
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcJoin += new clsNetTcpRTCVistaService.DelsvcJoin(ctlDialer_entsvcJoin);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcCreateRTCClient += new clsNetTcpRTCVistaService.DelsvcCreateRTCClient(ctlDialer_entsvcCreateRTCClient);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcRegisterSIPPhone += new clsNetTcpRTCVistaService.DelsvcRegisterSIPPhone(ctlDialer_entsvcRegisterSIPPhone);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcAnswer += new clsNetTcpRTCVistaService.DelsvcAnswer(ctlDialer_entsvcAnswer);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcDial += new clsNetTcpRTCVistaService.DelsvcDial(ctlDialer_entsvcDial);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcHangup += new clsNetTcpRTCVistaService.DelsvcHangup(ctlDialer_entsvcHangup);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcHold += new clsNetTcpRTCVistaService.DelsvcHold(ctlDialer_entsvcHold);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcTransfer += new clsNetTcpRTCVistaService.DelsvcTransfer(ctlDialer_entsvcTransfer);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcRTCEvent += new clsNetTcpRTCVistaService.DelsvcRTCEvent(ctlDialer_entsvcRTCEvent);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcUnJoin += new clsNetTcpRTCVistaService.DelsvcUnJoin(ctlDialer_entsvcUnJoin);
                    ClientNetP2PRTCVistaChannel = (INetTcpRTCVistaServiceChannel)npcRTCVistaClient.OpenClient<INetTcpRTCVistaServiceChannel>("net.tcp://localhost:6060/NetP2PRTCVista", "NetP2PRTCVistaMesh", ref objNetP2PRTCVista);
                    ClientNetP2PRTCVistaChannel.svcJoin();
                }


                ThOpenClinet = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(FncOpenClinet));
                System.Collections.Generic.List<object> lstParameters = new System.Collections.Generic.List<object>();
                lstParameters.Add(objLocalPeerType);
                lstParameters.Add(uri);
                ThOpenClinet.Start(lstParameters);

                thostActiveAgent = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(hostActiveAgentService));
                List<object> lstParams = new List<object>();
                lstParams.Add("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapActiveAgentReport");
                lstParams.Add("P2PActiveAgentMesh");
                thostActiveAgent.Start(lstParams);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ctlDialer()", "ctlDialer.xaml.cs");
            }
        }