Exemple #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();
            }
        }
        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();
            }
        }
Exemple #3
0
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                VMuktiService.NetPeerClient npcDummyChat = new VMuktiService.NetPeerClient();
                objNetTcpAudio = new clsNetTcpAudio();
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PJoin            += new clsNetTcpAudio.DelsvcP2PJoin(AudioDummy_EntsvcP2PJoin);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PStartConference += new clsNetTcpAudio.DelsvcP2PStartConference(AudioDummy_EntsvcP2PStartConference);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcGetUserList        += new clsNetTcpAudio.DelsvcGetUserList(AudioDummy_EntsvcP2PGetUserList);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcSetUserList        += new clsNetTcpAudio.DelsvcSetUserList(AudioDummy_EntsvcP2PSetUserList);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PUnJoin          += new clsNetTcpAudio.DelsvcP2PUnJoin(AudioDummy_EntsvcP2PUnJoin);
                NetTcpAudioChannel = (INetTcpAudioChannel)npcDummyChat.OpenClient <INetTcpAudioChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpAudio);

                while (tempcounter < 20)
                {
                    try
                    {
                        NetTcpAudioChannel.svcP2PJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient()", "AudioDummy.cs");
            }
        }
Exemple #4
0
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                VMuktiService.NetPeerClient npcDummyChat = new VMuktiService.NetPeerClient();
                objNetTcpAudio = new clsNetTcpAudio();
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PJoin            += new clsNetTcpAudio.DelsvcP2PJoin(AudioDummy_EntsvcP2PJoin);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PStartConference += new clsNetTcpAudio.DelsvcP2PStartConference(AudioDummy_EntsvcP2PStartConference);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PUnJoin          += new clsNetTcpAudio.DelsvcP2PUnJoin(AudioDummy_EntsvcP2PUnJoin);
                NetTcpAudioChannel = (INetTcpAudioChannel)npcDummyChat.OpenClient <INetTcpAudioChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpAudio);

                while (tempcounter < 20)
                {
                    try
                    {
                        NetTcpAudioChannel.svcP2PJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "VMukti--:--VmuktiModules--:--Call Center--:--AutoProgressiveSoftPhone--:--AutoProgressivePhone.Presentation--:--AudioDummy.cs--:--RegNetP2PClient()--");
                ClsException.LogError(ex);
                ClsException.WriteToErrorLogFile(ex);
                throw ex;
            }
        }
        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");
            }
        }	   
        void FncOpenClinet(object lstParameters)
        {
            try
            {
                System.Collections.Generic.List<object> lstTempObj = (System.Collections.Generic.List<object>)lstParameters;
                strUri = lstTempObj[1].ToString();

                if ((VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.NodeWithNetP2P || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.BootStrap || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.SuperNode)
                {
                    VMuktiService.NetPeerClient ncpAudio = new VMuktiService.NetPeerClient();
                    ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PJoin += new Audio.Business.Service.NetP2P.clsNetTcpAudio.DelsvcP2PJoin(ctlDialer_EntsvcP2PJoin);
                    ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PStartConference += new Audio.Business.Service.NetP2P.clsNetTcpAudio.DelsvcP2PStartConference(ctlDialer_EntsvcP2PStartConference);
                    ((clsNetTcpAudio)objNetTcpAudio).EntsvcGetUserList += new clsNetTcpAudio.DelsvcGetUserList(ctlDialer_EntsvcGetUserList);
                    ((clsNetTcpAudio)objNetTcpAudio).EntsvcSetUserList += new clsNetTcpAudio.DelsvcSetUserList(ctlDialer_EntsvcSetUserList);
                    ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PUnJoin += new Audio.Business.Service.NetP2P.clsNetTcpAudio.DelsvcP2PUnJoin(ctlDialer_EntsvcP2PUnJoin);
                    NetP2PChannel = (INetTcpAudioChannel)ncpAudio.OpenClient<INetTcpAudioChannel>(strUri, strUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpAudio);

                    while (temp < 20)
                    {
                        try
                        {
                            ClsException.WriteToLogFile("Going to call svcJoin");
                            NetP2PChannel.svcP2PJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                            ClsException.WriteToLogFile("svcJoin has been called.");
                            temp = 20;
                            this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, objDelStartIntitialConfrence);

                            if (strMyRole == "Host")
                            {
                                NetP2PChannel.svcGetUserList(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, strDefaultConfNumber);
                            }
                            else
                            {
                                NetP2PChannel.svcGetUserList(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, "");
                            }
                        }
                        catch
                        {
                            temp++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                }
                else
                {
                    VMuktiService.BasicHttpClient bhcAudio = new VMuktiService.BasicHttpClient();
                    Httpchannel = (IHttpAudio)bhcAudio.OpenClient<IHttpAudio>(strUri);
                    while (tempcounter < 20)
                    {
                        try
                        {
                            Httpchannel.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                            tempcounter = 20;
                            this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, objDelStartIntitialConfrence);

                            if (strMyRole == "Host")
                            {

                                Httpchannel.svcGetUserList(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, strDefaultConfNumber);
                            }
                            else
                            {
                                Httpchannel.svcGetUserList(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, "");
                            }
                        }
                        catch
                        {
                            tempcounter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }

                    dtGetConference.Interval = TimeSpan.FromSeconds(2);
                    dtGetConference.Tick += new EventHandler(dtGetConference_Tick);
                    dtGetConference.Start();

                }

                ClsException.WriteToLogFile("Opening client Completed successfully");
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "FncOpenClient()", "Audio\\ctlDialer.xaml.cs");
            }
        }
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                VMuktiService.NetPeerClient npcDummyChat = new VMuktiService.NetPeerClient();
                objNetTcpAudio = new clsNetTcpAudio();
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PJoin += new clsNetTcpAudio.DelsvcP2PJoin(AudioDummy_EntsvcP2PJoin);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PStartConference += new clsNetTcpAudio.DelsvcP2PStartConference(AudioDummy_EntsvcP2PStartConference);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcGetUserList += new clsNetTcpAudio.DelsvcGetUserList(AudioDummy_EntsvcP2PGetUserList);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcSetUserList += new clsNetTcpAudio.DelsvcSetUserList(AudioDummy_EntsvcP2PSetUserList);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PUnJoin += new clsNetTcpAudio.DelsvcP2PUnJoin(AudioDummy_EntsvcP2PUnJoin);
                NetTcpAudioChannel = (INetTcpAudioChannel)npcDummyChat.OpenClient<INetTcpAudioChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpAudio);

                while (tempcounter < 20)
                {
                    try
                    {
                        NetTcpAudioChannel.svcP2PJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient()", "AudioDummy.cs");
            }
        }
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                VMuktiService.NetPeerClient npcDummyChat = new VMuktiService.NetPeerClient();
                objNetTcpAudio = new clsNetTcpAudio();
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PJoin += new clsNetTcpAudio.DelsvcP2PJoin(AudioDummy_EntsvcP2PJoin);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PStartConference += new clsNetTcpAudio.DelsvcP2PStartConference(AudioDummy_EntsvcP2PStartConference);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PUnJoin += new clsNetTcpAudio.DelsvcP2PUnJoin(AudioDummy_EntsvcP2PUnJoin);
                NetTcpAudioChannel = (INetTcpAudioChannel)npcDummyChat.OpenClient<INetTcpAudioChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpAudio);

                while (tempcounter < 20)
                {
                    try
                    {
                        NetTcpAudioChannel.svcP2PJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "VMukti--:--VmuktiModules--:--Call Center--:--AutoProgressiveSoftPhone--:--AutoProgressivePhone.Presentation--:--AudioDummy.cs--:--RegNetP2PClient()--");
                ClsException.LogError(ex);
                ClsException.WriteToErrorLogFile(ex);
                throw ex;
            }
        }