Exemple #1
0
 void RegWhiteBoardp2pClient(string P2PUri)
 {
     try
     {
         NetPeerClient npcDummyWhiteBoardp = new NetPeerClient();
         objNetTcpWhiteBoardp = new clsNetTcpWhiteboard();
         ((clsNetTcpWhiteboard)objNetTcpWhiteBoardp).EJoin        += new clsNetTcpWhiteboard.UserJoin(P2PWhiteBoardClient_EJoin);
         ((clsNetTcpWhiteboard)objNetTcpWhiteBoardp).ESignOutChat += new clsNetTcpWhiteboard.SignOutChat(P2PWhiteBoardClient_ESignOutChat);
         channelNettcpWhiteBoard = (INetTcpWhiteboardChannel)npcDummyWhiteBoardp.OpenClient <INetTcpWhiteboardChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpWhiteBoardp);
         VMuktiAPI.ClsException.WriteToLogFile("P2PUri: " + P2PUri + " P2PUri.ToString().Split(':')[2].Split('/')[2] " + P2PUri.ToString().Split(':')[2].Split('/')[2].ToString());
         while (tempcounter < 20)
         {
             try
             {
                 channelNettcpWhiteBoard.svcJoin(UserName);
                 tempcounter = 20;
             }
             catch
             {
                 tempcounter++;
                 System.Threading.Thread.Sleep(1000);
             }
         }
     }
     catch (Exception ex)
     {
         VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegWhiteBoardP2pClient()", "p2pWhiteBoardClient.cs");
     }
 }
Exemple #2
0
        void RegFileSearchp2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyFileSearch = new NetPeerClient();
                objNetTcpFileSearch = new clsNetTcpFileSearch();
                ((clsNetTcpFileSearch)objNetTcpFileSearch).EntsvcJoin   += new clsNetTcpFileSearch.delsvcJoin(P2PFileSearchClient_EntsvcJoin);
                ((clsNetTcpFileSearch)objNetTcpFileSearch).EntsvcUnJoin += new clsNetTcpFileSearch.delsvcUnJoin(P2PFileSearchClient_EntsvcUnJoin);
                channelNettcpFileTransfer = (IFileTransferChannel)npcDummyFileSearch.OpenClient <IFileTransferChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpFileSearch);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpFileTransfer.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception exp)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "RegFileSearchp2pClient", "P2PFileSearchClient.cs");
            }
        }
        void RegAudiop2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyAudio = new NetPeerClient();
                objNetTcpAudio = new clsNetTcpAudio();
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PJoin += new clsNetTcpAudio.DelsvcP2PJoin(P2PAudioClient_EntsvcP2PJoin);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PUnJoin += new clsNetTcpAudio.DelsvcP2PUnJoin(P2PAudioClient_EntsvcP2PUnJoin);
                channelNettcpAudio = (INetTcpAudioChannel)npcDummyAudio.OpenClient<INetTcpAudioChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpAudio);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpAudio.svcP2PJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "RegAudiop2pClient()", "Audio\\P2PAudioClient.cs");
            }
        }
Exemple #4
0
        void RegChatp2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyChat = new NetPeerClient();
                objNetTcpChat = new clsNetTcpChat();
                ((clsNetTcpChat)objNetTcpChat).EntsvcJoin += new clsNetTcpChat.delsvcJoin(DummyClient_EntsvcJoin);
                //((clsNetTcpChat)objNetTcpChat).EntsvcSendMessage += new clsNetTcpChat.delsvcSendMessage(DummyClient_EntsvcSendMessage);
                //((clsNetTcpChat)objNetTcpChat).EntsvcGetUserList += new clsNetTcpChat.delsvcGetUserList(DummyClient_EntsvcGetUserList);
                //((clsNetTcpChat)objNetTcpChat).EntsvcSetUserList += new clsNetTcpChat.delsvcSetUserList(DummyClient_EntsvcSetUserList);
                //((clsNetTcpChat)objNetTcpChat).EntsvcSignOutChat += new clsNetTcpChat.delsvcSignOutChat(DummyClient_EntsvcSignOutChat);
                ((clsNetTcpChat)objNetTcpChat).EntsvcUnJoin += new clsNetTcpChat.delsvcUnJoin(DummyClient_EntsvcUnJoin);
                channelNettcpChat = (INetTcpChatChannel)npcDummyChat.OpenClient <INetTcpChatChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpChat);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpChat.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "P2PChatp2pClient", "P2PChatClient.cs");
            }
        }
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyImageSharing = new NetPeerClient();
                objNetTcpImageSharing = new clsNetTcpImageSharing();

                ((clsNetTcpImageSharing)objNetTcpImageSharing).EntsvcJoin      += new clsNetTcpImageSharing.delsvcJoin(ImageSharingDummy_EntsvcJoin);
                ((clsNetTcpImageSharing)objNetTcpImageSharing).EntsvcSendIamge += new clsNetTcpImageSharing.delsvcSendIamge(ImageSharingDummy_EntsvcSendIamge);
                ((clsNetTcpImageSharing)objNetTcpImageSharing).EntsvcUnJoin    += new clsNetTcpImageSharing.delsvcUnJoin(ImageSharingDummy_EntsvcUnJoin);

                channelNettcpImageSharing = (INetTcpImageShareChannel)npcDummyImageSharing.OpenClient <INetTcpImageShareChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpImageSharing);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpImageSharing.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient", "ImageSharingDummy.xaml.cs");
            }
        }
        void RegCoAuthp2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyCoAuth = new NetPeerClient();
                objNetTcpCoAuth = new NetP2PCoAuthService();

                ((NetP2PCoAuthService)objNetTcpCoAuth).EntSvcJoin += new NetP2PCoAuthService.DelSvcJoin(P2PCoAuthClient_EntSvcJoin);
                ((NetP2PCoAuthService)objNetTcpCoAuth).EntsvcUnJoin += new NetP2PCoAuthService.DelsvcUnJoin(P2PCoAuthClient_EntsvcUnJoin);
                channelNettcpCoAuth = (INetP2PICoAuthServiceChannel)npcDummyCoAuth.OpenClient<INetP2PICoAuthServiceChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpCoAuth);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpCoAuth.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception exp)
            {
                VMuktiHelper.ExceptionHandler(exp, "RegCoAuthp2pClient", "P2PCoAuthClient.cs");
            }
        }
Exemple #7
0
        public void hostActiveAgentService(object lstparam)
        {
            try
            {
                List <object> lstTempObj = (List <object>)lstparam;
                strUri = lstTempObj[0].ToString();

                NetPeerClient npcActiveAgent = new NetPeerClient();
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcJoin           += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcJoin(ctlrptActiveAgent_EntsvcJoin);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcGetAgentInfo   += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcGetAgentInfo(ctlrptActiveAgent_EntsvcGetAgentInfo);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcSetAgentInfo   += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcSetAgentInfo(ctlrptActiveAgent_EntsvcSetAgentInfo);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcSetAgentStatus += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcSetAgentStatus(ctlrptActiveAgent_EntsvcSetAgentStatus);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcBargeRequest   += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcBargeRequest(ctlrptActiveAgent_EntsvcBargeRequest);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcBargeReply     += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcBargeReply(ctlrptActiveAgent_EntsvcBargeReply);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcHangUp         += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcHangUp(ctlrptActiveAgent_EntsvcHangUp);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcUnJoin         += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcUnJoin(ctlrptActiveAgent_EntsvcUnJoin);

                channelNetTcp = (INetP2PBootStrapActiveAgentReportChannel)npcActiveAgent.OpenClient <INetP2PBootStrapActiveAgentReportChannel>(strUri, lstTempObj[1].ToString(), ref objNetTcpActiveAgent);
                channelNetTcp.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, VMuktiAPI.VMuktiInfo.CurrentPeer.CampaignID.ToString());

                channelNetTcp.svcGetAgentInfo(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "hostActiveAgentService()", "ctlrptActiveAgent.xaml.cs");
                if (ex.InnerException != null && ex.InnerException.Message != "")
                {
                    VMuktiAPI.VMuktiHelper.ExceptionHandler(ex.InnerException, "hostActiveAgentService()--Inner", "ctlrptActiveAgent.xaml.cs");
                }
            }
        }
Exemple #8
0
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyFileSearch = new NetPeerClient();
                objNetFileSearch = new clsNetTcpFileSearch();
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcJoin          += new clsNetTcpFileSearch.delsvcJoin(FileSearchDummy_EntsvcJoin);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcRequestFile   += new clsNetTcpFileSearch.delsvcRequestFile(FileSearchDummy_EntsvcRequestFile);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcSearchQuery   += new clsNetTcpFileSearch.delsvcSearchQuery(FileSearchDummy_EntsvcSearchQuery);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcSearchResult  += new clsNetTcpFileSearch.delsvcSearchResult(FileSearchDummy_EntsvcSearchResult);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcSendFileBlock += new clsNetTcpFileSearch.delsvcSendFileBlock(FileSearchDummy_EntsvcSendFileBlock);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcGetUserList   += new clsNetTcpFileSearch.delsvcGetUserList(FileSearchDummy_EntsvcGetUserList);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcSetUserList   += new clsNetTcpFileSearch.delsvcSetUserList(FileSearchDummy_EntsvcSetUserList);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcUnJoin        += new clsNetTcpFileSearch.delsvcUnJoin(FileSearchDummy_EntsvcUnJoin);
                NetP2PChannel = (IFileTransferChannel)npcDummyFileSearch.OpenClient <IFileTransferChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetFileSearch);

                while (tempcounter < 20)
                {
                    try
                    {
                        NetP2PChannel.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient", "FileSearchDummy.cs");
            }
        }
Exemple #9
0
        void RegCoAuthp2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyCoAuth = new NetPeerClient();
                objNetTcpCoAuth = new NetP2PCoAuthService();

                ((NetP2PCoAuthService)objNetTcpCoAuth).EntSvcJoin   += new NetP2PCoAuthService.DelSvcJoin(P2PCoAuthClient_EntSvcJoin);
                ((NetP2PCoAuthService)objNetTcpCoAuth).EntsvcUnJoin += new NetP2PCoAuthService.DelsvcUnJoin(P2PCoAuthClient_EntsvcUnJoin);
                channelNettcpCoAuth = (INetP2PICoAuthServiceChannel)npcDummyCoAuth.OpenClient <INetP2PICoAuthServiceChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpCoAuth);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpCoAuth.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception exp)
            {
                VMuktiHelper.ExceptionHandler(exp, "RegCoAuthp2pClient", "P2PCoAuthClient.cs");
            }
        }
Exemple #10
0
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyQA = new NetPeerClient();
                objNetTcpQA = new clsNetTcpQA();
                ((clsNetTcpQA)objNetTcpQA).EntsvcP2PJoin          += new clsNetTcpQA.DelsvcP2Pjoin(QADummy_EntsvcP2PJoin);
                ((clsNetTcpQA)objNetTcpQA).entsvcP2PReplyQuestion += new clsNetTcpQA.DelsvcP2PReplyQuestion(QADummy_entsvcP2PReplyQuestion);
                ((clsNetTcpQA)objNetTcpQA).EntsvcP2PAskQuestion   += new clsNetTcpQA.DelsvcP2PAskQuestion(QADummy_EntsvcP2PAskQuestion);
                NetP2PChannel = (INetTcpQAChannel)npcDummyQA.OpenClient <INetTcpQAChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[1], ref objNetTcpQA);

                while (tempcounter < 20)
                {
                    try
                    {
                        NetP2PChannel.svcP2PJoin(UserName);
                        tempcounter = 20;
                    }
                    catch (Exception ex)
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show("RegNetP2PClient" + ex.Message);
            }
        }
        void RegChatp2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyChat = new NetPeerClient();
                objNetTcpChat = new clsNetTcpChat();
                ((clsNetTcpChat)objNetTcpChat).EntsvcJoin += new clsNetTcpChat.delsvcJoin(DummyClient_EntsvcJoin);
                //((clsNetTcpChat)objNetTcpChat).EntsvcSendMessage += new clsNetTcpChat.delsvcSendMessage(DummyClient_EntsvcSendMessage);
                //((clsNetTcpChat)objNetTcpChat).EntsvcGetUserList += new clsNetTcpChat.delsvcGetUserList(DummyClient_EntsvcGetUserList);
                //((clsNetTcpChat)objNetTcpChat).EntsvcSetUserList += new clsNetTcpChat.delsvcSetUserList(DummyClient_EntsvcSetUserList);
                //((clsNetTcpChat)objNetTcpChat).EntsvcSignOutChat += new clsNetTcpChat.delsvcSignOutChat(DummyClient_EntsvcSignOutChat);
                ((clsNetTcpChat)objNetTcpChat).EntsvcUnJoin += new clsNetTcpChat.delsvcUnJoin(DummyClient_EntsvcUnJoin);
                channelNettcpChat = (INetTcpChatChannel)npcDummyChat.OpenClient<INetTcpChatChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpChat);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpChat.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "P2PChatp2pClient", "P2PChatClient.cs");
            }
        }
        void RegImageSharingp2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyImageSharing = new NetPeerClient();
                objNetTcpImageSharing = new clsNetTcpImageSharing();

                ((clsNetTcpImageSharing)objNetTcpImageSharing).EntsvcJoin   += new clsNetTcpImageSharing.delsvcJoin(P2PImageSharingClient_EntsvcJoin);
                ((clsNetTcpImageSharing)objNetTcpImageSharing).EntsvcUnJoin += new clsNetTcpImageSharing.delsvcUnJoin(P2PImageSharingClient_EntsvcUnJoin);

                channelNettcpImageSharing = (INetTcpImageShareChannel)npcDummyImageSharing.OpenClient <INetTcpImageShareChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpImageSharing);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpImageSharing.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception exp)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "RegImageSharingp2pClient", "P2PImageSharingClient.cs");
            }
        }
Exemple #13
0
        public ctlrptActiveCall()
        {
            try
            {
                InitializeComponent();

                ConnectionString = VMuktiAPI.VMuktiInfo.MainConnectionString;
                if (System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory.ToString() + "rptActiveCall.sdf"))
                {
                    System.IO.File.Delete(AppDomain.CurrentDomain.BaseDirectory.ToString() + "rptActiveCall.sdf");
                }
                SqlCeEngine clientEngine = new SqlCeEngine(ClientConnectionString);
                clientEngine.CreateDatabase();
                LocalSQLConn = new SqlCeConnection();
                LocalSQLConn.ConnectionString = ClientConnectionString;
                LocalSQLConn.Open();
                fncActiveCallTable();
                LocalSQLConn.Close();

                objRefreshReport = new delRefreshReport(fncRefreshReport);
                NetPeerClient npcActiveCall = new NetPeerClient();
                ((NetP2PBootStrapActiveCallReportDelegates)objActiveCall).EntsvcJoinCall    += new NetP2PBootStrapActiveCallReportDelegates.DelsvcJoinCall(ctlrptActiveCall_EntsvcJoinCall);
                ((NetP2PBootStrapActiveCallReportDelegates)objActiveCall).EntsvcGetCallInfo += new NetP2PBootStrapActiveCallReportDelegates.DelsvcGetCallInfo(ctlrptActiveCall_EntsvcGetCallInfo);
                ((NetP2PBootStrapActiveCallReportDelegates)objActiveCall).EntsvcActiveCalls += new NetP2PBootStrapActiveCallReportDelegates.DelsvcActiveCalls(ctlrptActiveCall_EntsvcActiveCalls);
                ((NetP2PBootStrapActiveCallReportDelegates)objActiveCall).EntsvcSetDuration += new NetP2PBootStrapActiveCallReportDelegates.DelsvcSetDuration(ctlrptActiveCall_EntsvcSetDuration);
                ((NetP2PBootStrapActiveCallReportDelegates)objActiveCall).EntsvcUnJoinCall  += new NetP2PBootStrapActiveCallReportDelegates.DelsvcUnJoinCall(ctlrptActiveCall_EntsvcUnJoinCall);
                channelNetTcpActiveCall = (INetP2PBootStrapReportChannel)npcActiveCall.OpenClient <INetP2PBootStrapReportChannel>("net.tcp://" + VMuktiAPI.VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapActiveCallReport", "ActiveCallMesh", ref objActiveCall);
                channelNetTcpActiveCall.svcJoinCall(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ctlrptActiveCall", "ctlrptActiveCall.xaml.cs");
            }
        }
Exemple #14
0
        void RegAudiop2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyAudio = new NetPeerClient();
                objNetTcpAudio = new clsNetTcpAudio();
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PJoin   += new clsNetTcpAudio.DelsvcP2PJoin(P2PAudioClient_EntsvcP2PJoin);
                ((clsNetTcpAudio)objNetTcpAudio).EntsvcP2PUnJoin += new clsNetTcpAudio.DelsvcP2PUnJoin(P2PAudioClient_EntsvcP2PUnJoin);
                channelNettcpAudio = (INetTcpAudioChannel)npcDummyAudio.OpenClient <INetTcpAudioChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpAudio);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpAudio.svcP2PJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "RegAudiop2pClient()", "Audio\\P2PAudioClient.cs");
            }
        }
        void RegPresentationp2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyPresentation = new NetPeerClient();
                objNetTcpPresentation = new clsNetTcpPresentation();
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcJoin += new clsNetTcpPresentation.delsvcJoin(P2PPresentationClient_EntsvcJoin);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcUnJoin += new clsNetTcpPresentation.delsvcUnJoin(P2PPresentationClient_EntsvcUnJoin);
                channelNettcpPresentation = (INetTcpPresentationChannel)npcDummyPresentation.OpenClient<INetTcpPresentationChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpPresentation);

                while (tempcounter < 20)
                {
                    try
                    {
                        clsMessageContract objContract = new clsMessageContract();
                        objContract.strFrom = UserName;
                        objContract.strMsg = "";
                        channelNettcpPresentation.svcJoin(objContract); 
                        
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegPresentationp2pClient()", "P2PPresentationClient.cs");
            }
        }
        void RegWhiteBoardp2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyWhiteBoardp = new NetPeerClient();
                objNetTcpWhiteBoardp = new clsNetTcpWhiteboard();
                ((clsNetTcpWhiteboard)objNetTcpWhiteBoardp).EJoin += new clsNetTcpWhiteboard.UserJoin(P2PWhiteBoardClient_EJoin);
                ((clsNetTcpWhiteboard)objNetTcpWhiteBoardp).ESignOutChat += new clsNetTcpWhiteboard.SignOutChat(P2PWhiteBoardClient_ESignOutChat);
                channelNettcpWhiteBoard = (INetTcpWhiteboardChannel)npcDummyWhiteBoardp.OpenClient<INetTcpWhiteboardChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpWhiteBoardp);
                VMuktiAPI.ClsException.WriteToLogFile("P2PUri: " + P2PUri + " P2PUri.ToString().Split(':')[2].Split('/')[2] " + P2PUri.ToString().Split(':')[2].Split('/')[2].ToString());
                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpWhiteBoard.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {

                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegWhiteBoardP2pClient()", "p2pWhiteBoardClient.cs");


            }
        }
        public ctlrptActiveCall()
        {
            try
            {
                InitializeComponent();

                ConnectionString = VMuktiAPI.VMuktiInfo.MainConnectionString;
                if (System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory.ToString() + "rptActiveCall.sdf"))
                {
                    System.IO.File.Delete(AppDomain.CurrentDomain.BaseDirectory.ToString() + "rptActiveCall.sdf");
                }
                SqlCeEngine clientEngine = new SqlCeEngine(ClientConnectionString);
                clientEngine.CreateDatabase();
                LocalSQLConn = new SqlCeConnection();
                LocalSQLConn.ConnectionString = ClientConnectionString;
                LocalSQLConn.Open();
                fncActiveCallTable();
                LocalSQLConn.Close();

                objRefreshReport = new delRefreshReport(fncRefreshReport);
                NetPeerClient npcActiveCall = new NetPeerClient();
                ((NetP2PBootStrapActiveCallReportDelegates)objActiveCall).EntsvcJoinCall += new NetP2PBootStrapActiveCallReportDelegates.DelsvcJoinCall(ctlrptActiveCall_EntsvcJoinCall);
                ((NetP2PBootStrapActiveCallReportDelegates)objActiveCall).EntsvcGetCallInfo += new NetP2PBootStrapActiveCallReportDelegates.DelsvcGetCallInfo(ctlrptActiveCall_EntsvcGetCallInfo);
                ((NetP2PBootStrapActiveCallReportDelegates)objActiveCall).EntsvcActiveCalls += new NetP2PBootStrapActiveCallReportDelegates.DelsvcActiveCalls(ctlrptActiveCall_EntsvcActiveCalls);
                ((NetP2PBootStrapActiveCallReportDelegates)objActiveCall).EntsvcSetDuration += new NetP2PBootStrapActiveCallReportDelegates.DelsvcSetDuration(ctlrptActiveCall_EntsvcSetDuration);
                ((NetP2PBootStrapActiveCallReportDelegates)objActiveCall).EntsvcUnJoinCall += new NetP2PBootStrapActiveCallReportDelegates.DelsvcUnJoinCall(ctlrptActiveCall_EntsvcUnJoinCall);
                channelNetTcpActiveCall = (INetP2PBootStrapReportChannel)npcActiveCall.OpenClient<INetP2PBootStrapReportChannel>("net.tcp://" + VMuktiAPI.VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapActiveCallReport", "ActiveCallMesh", ref objActiveCall);
                channelNetTcpActiveCall.svcJoinCall(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);

            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ctlrptActiveCall", "ctlrptActiveCall.xaml.cs");
            }
        }
        void RegPresentationp2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyPresentation = new NetPeerClient();
                objNetTcpPresentation = new clsNetTcpPresentation();
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcJoin   += new clsNetTcpPresentation.delsvcJoin(P2PPresentationClient_EntsvcJoin);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcUnJoin += new clsNetTcpPresentation.delsvcUnJoin(P2PPresentationClient_EntsvcUnJoin);
                channelNettcpPresentation = (INetTcpPresentationChannel)npcDummyPresentation.OpenClient <INetTcpPresentationChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpPresentation);

                while (tempcounter < 20)
                {
                    try
                    {
                        clsMessageContract objContract = new clsMessageContract();
                        objContract.strFrom = UserName;
                        objContract.strMsg  = "";
                        channelNettcpPresentation.svcJoin(objContract);

                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegPresentationp2pClient()", "P2PPresentationClient.cs");
            }
        }
Exemple #19
0
        void hostMainVideoService(object lstParams)
        {
            try
            {
                List <object> lstTempObj = (List <object>)lstParams;
                strUri = lstTempObj[1].ToString();

                if ((VMuktiAPI.PeerType)lstTempObj[0] == PeerType.BootStrap || (VMuktiAPI.PeerType)lstTempObj[0] == PeerType.SuperNode || (VMuktiAPI.PeerType)lstTempObj[0] == PeerType.NodeWithNetP2P)
                {
                    NetPeerClient npcNetP2P = new NetPeerClient();
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcJoin        += new ClsNetP2PMainVideo.delsvcJoin(ctlVideo_EntsvcJoin);
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcGetUserList += new ClsNetP2PMainVideo.delsvcGetUserList(ctlVideo_EntsvcGetUserList);
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcSetUserList += new ClsNetP2PMainVideo.delsvcSetUserList(ctlVideo_EntsvcSetUserList);
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcClose       += new ClsNetP2PMainVideo.delsvcClose(ctlVideo_EntsvcClose);
                    ((ClsNetP2PMainVideo)objNetP2PMainVideo).EntsvcUnJoin      += new ClsNetP2PMainVideo.delsvcUnJoin(ctlVideo_EntsvcUnJoin);
                    channelNetP2P = (INetP2PMainVideoChannel)npcNetP2P.OpenClient <INetP2PMainVideoChannel>(strUri, strUri.ToString().Split(':')[2].Split('/')[2], ref objNetP2PMainVideo);

                    while (tempcounter < 20)
                    {
                        try
                        {
                            channelNetP2P.svcJoin(VMuktiInfo.CurrentPeer.DisplayName);
                            tempcounter = 20;
                            channelNetP2P.svcGetUserList(VMuktiInfo.CurrentPeer.DisplayName, strLocalCameraUri);
                        }
                        catch
                        {
                            tempcounter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                }
                else
                {
                    //BasicHttpClient httpClient = new BasicHttpClient();
                    //channelHttp = (IHttpMainVideo)httpClient.OpenClient<IHttpMainVideo>(strUri);

                    //while (tempcounter < 20)
                    //{
                    //    try
                    //    {
                    //        channelHttp.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                    //        tempcounter = 20;
                    //    }
                    //    catch
                    //    {
                    //        tempcounter++;
                    //        System.Threading.Thread.Sleep(1000);
                    //    }
                    //}
                    //dispTimer.Interval = TimeSpan.FromSeconds(5);
                    //dispTimer.Tick += new EventHandler(dispTimer_Tick);
                    //dispTimer.Start();
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "hostMainVideoService", "ctlVideo.xaml.cs");
            }
        }
Exemple #20
0
        void RegClient(object videoURI)
        {
            lock (this)
            {
                try
                {
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.BootStrap || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.SuperNode || VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithNetP2P)
                    {
                        ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcJoin       += new ClsNetP2PUserVideo.delsvcJoin(ctlUserVideo_EntsvcJoin);
                        ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(ctlUserVideo_EntsvcSendStream);
                        ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcUnJoin     += new ClsNetP2PUserVideo.delsvcUnJoin(ctlUserVideo_EntsvcUnJoin);

                        npcDirectXVideo           = new NetPeerClient();
                        netp2pDirectXVideoChannel = (INetP2PUserVideoChannel)npcDirectXVideo.OpenClient <INetP2PUserVideoChannel>(videoURI.ToString(), videoURI.ToString().Split(':')[2].Split('/')[2], ref objDirectXVideo);
                        netp2pDirectXVideoChannel.svcJoin(MyUserName);
                    }
                    else
                    {
                        int count = 0;
                        while (count < 90)
                        {
                            try
                            {
                                bhcDirectXVideo         = new BasicHttpClient();
                                httpDirectXVideoChannel = (IHttpUserVideo)bhcDirectXVideo.OpenClient <IHttpUserVideo>(videoURI.ToString());
                                httpDirectXVideoChannel.svcJoin(MyUserName);

                                count = 90;

                                if (MyVidType != "Me")
                                {
                                    disptGetImages.Start();
                                }
                            }
                            catch
                            {
                                System.Threading.Thread.Sleep(TimeSpan.FromSeconds(1));
                                count++;
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegClient", "ctlUserVideo.xaml.cs");
                }
            }
        }
        void RegDesktopp2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyDesktop = new NetPeerClient();
                objNetTcpDesktop = new clsNetTcpDesktop();
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcJoin += new clsNetTcpDesktop.delsvcJoin(P2PDesktopClient_EntsvcJoin);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcUnJoin += new clsNetTcpDesktop.delsvcUnJoin(P2PDesktopClient_EntsvcUnJoin);

                channelNettcpDesktop = (INetTcpDesktopChannel)npcDummyDesktop.OpenClient<INetTcpDesktopChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpDesktop);

                while (tempcounter < 20)
                {
                    try
                    {
                        //Stream mmsUName = fncStringToStream(UserName);

                        //channelNettcpDesktop.svcJoin(mmsUName);
                        #region msgContract
                        clsMessageContract objContract = new clsMessageContract();
                        objContract.blControl = false;
                        objContract.blView = false;
                        objContract.key = 0;
                        objContract.mouseButton = 0;
                        objContract.stremImage = new MemoryStream();
                        objContract.strFrom = UserName;
                        objContract.strTo = "";
                        objContract.strType = "";
                        objContract.x = 0.0;
                        objContract.y = 0.0;
                        #endregion msgContract

                        channelNettcpDesktop.svcJoin(objContract);

                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch
            {

            }
        }
Exemple #22
0
        void RegDesktopp2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyDesktop = new NetPeerClient();
                objNetTcpDesktop = new clsNetTcpDesktop();
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcJoin   += new clsNetTcpDesktop.delsvcJoin(P2PDesktopClient_EntsvcJoin);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcUnJoin += new clsNetTcpDesktop.delsvcUnJoin(P2PDesktopClient_EntsvcUnJoin);

                channelNettcpDesktop = (INetTcpDesktopChannel)npcDummyDesktop.OpenClient <INetTcpDesktopChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpDesktop);

                while (tempcounter < 20)
                {
                    try
                    {
                        //Stream mmsUName = fncStringToStream(UserName);

                        //channelNettcpDesktop.svcJoin(mmsUName);
                        #region msgContract
                        clsMessageContract objContract = new clsMessageContract();
                        objContract.blControl   = false;
                        objContract.blView      = false;
                        objContract.key         = 0;
                        objContract.mouseButton = 0;
                        objContract.stremImage  = new MemoryStream();
                        objContract.strFrom     = UserName;
                        objContract.strTo       = "";
                        objContract.strType     = "";
                        objContract.x           = 0.0;
                        objContract.y           = 0.0;
                        #endregion msgContract

                        channelNettcpDesktop.svcJoin(objContract);

                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch
            {
            }
        }
Exemple #23
0
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyWhiteboard = new NetPeerClient();
                objNetTcpWhiteboard = new clsNetTcpWhiteboard();

                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EJoin        += new clsNetTcpWhiteboard.UserJoin(NetP2PWhiteboard_EJoin);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EClear       += new clsNetTcpWhiteboard.ClearCnv(NetP2PWhiteboard_EClear);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EColor       += new clsNetTcpWhiteboard.ChangeColor(NetP2PWhiteboard_EColor);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EEllipse     += new clsNetTcpWhiteboard.DrawEllipse(NetP2PWhiteboard_EEllipse);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).ELine        += new clsNetTcpWhiteboard.DrawLine(NetP2PWhiteboard_ELine);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).ERect        += new clsNetTcpWhiteboard.DrawRect(NetP2PWhiteboard_ERect);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EStamper     += new clsNetTcpWhiteboard.DrawStamper(NetP2PWhiteboard_EStamper);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EStrokes     += new clsNetTcpWhiteboard.DrawStrokes(NetP2PWhiteboard_EStrokes);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EText        += new clsNetTcpWhiteboard.ChangeText(NetP2PWhiteboard_EText);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EThickness   += new clsNetTcpWhiteboard.ChangeThickness(NetP2PWhiteboard_EThickness);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).ETTool       += new clsNetTcpWhiteboard.DrawTextTool(NetP2PWhiteboard_ETTool);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EGetUserList += new clsNetTcpWhiteboard.GetUserList(NetP2PWhiteboard_GetUserList);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).ESetUserList += new clsNetTcpWhiteboard.SetUserList(NetP2PWhiteboard_SetUserList);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).ESignOutChat += new clsNetTcpWhiteboard.SignOutChat(NetP2PWhiteboard_ESignOutChat);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EUnjoin      += new clsNetTcpWhiteboard.Unjoin(NetP2PWhiteboard_EUnjoin);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EFontSize    += new clsNetTcpWhiteboard.ChangeFontSize(NetP2PWhiteboard_EFontSize);
                VMuktiAPI.ClsException.WriteToLogFile("Opening P2pClient on URI: " + netP2pUri + "With mesh: " + netP2pUri.ToString().Split(':')[2].Split('/')[2].ToString());
                channelNettcpWhiteboard = (INetTcpWhiteboardChannel)npcDummyWhiteboard.OpenClient <INetTcpWhiteboardChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpWhiteboard);
                VMuktiAPI.ClsException.WriteToLogFile("Client opened Successfully");

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpWhiteboard.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient()", "WhiteBoardDummy.cs");
            }
        }
Exemple #24
0
        public void RegNetP2pClient(object NetP2pUri)
        {
            try
            {
                NetPeerClient npcDummyClient = new NetPeerClient();
                objClsNetP2PMainVideo = new ClsNetP2PMainVideo();
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcJoin        += new ClsNetP2PMainVideo.delsvcJoin(MainVideoDummies_NetP2P_EntsvcJoin);
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcGetUserList += new ClsNetP2PMainVideo.delsvcGetUserList(MainVideoDummies_NetP2P_EntsvcGetUserList);
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcSetUserList += new ClsNetP2PMainVideo.delsvcSetUserList(MainVideoDummies_NetP2P_EntsvcSetUserList);
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcUnJoin      += new ClsNetP2PMainVideo.delsvcUnJoin(MainVideoDummies_NetP2P_EntsvcUnJoin);

                objINetP2PChannel = (INetP2PMainVideoChannel)npcDummyClient.OpenClient <INetP2PMainVideoChannel>(NetP2pUri.ToString(), NetP2pUri.ToString().Split(':')[2].Split('/')[2], ref objClsNetP2PMainVideo);

                while (tempcounter < 20)
                {
                    try
                    {
                        objINetP2PChannel.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "--RegNetP2pClient()---VMukti--:--VmuktiModules--:--Collaborative--:--Video.Presentation--:--MainVideoDummies.cs--:");
                //ClsException.LogError(ex);
                //ClsException.WriteToErrorLogFile(ex);
                System.Text.StringBuilder sb = new StringBuilder();
                sb.AppendLine(ex.Message);
                sb.AppendLine();
                sb.AppendLine("StackTrace : " + ex.StackTrace);
                sb.AppendLine();
                sb.AppendLine("Location : " + ex.Data["My Key"].ToString());
                sb.AppendLine();
                sb1 = CreateTressInfo();
                sb.Append(sb1.ToString());
                VMuktiAPI.ClsLogging.WriteToTresslog(sb);
            }
        }
Exemple #25
0
        public void RegNetP2pClient(object videoURI)
        {
            try
            {
                object objDirectXVideo = new ClsNetP2PUserVideo();
                ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcJoin       += new ClsNetP2PUserVideo.delsvcJoin(ctlUserVideo_EntsvcJoin);
                ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(ctlUserVideo_EntsvcSendStream);
                ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcUnJoin     += new ClsNetP2PUserVideo.delsvcUnJoin(ctlUserVideo_EntsvcUnJoin);

                NetPeerClient npcDirectXVideo = new NetPeerClient();
                netp2pDirectXVideoChannel = (INetP2PUserVideoChannel)npcDirectXVideo.OpenClient <INetP2PUserVideoChannel>(videoURI.ToString(), videoURI.ToString().Split(':')[2].Split('/')[2], ref objDirectXVideo);
                netp2pDirectXVideoChannel.svcJoin("");
            }

            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient", "clsVideoSNode.cs");
            }
        }
Exemple #26
0
        void RegVideop2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyVideo = new NetPeerClient();
                objNetTcpVideo = new ClsNetP2PMainVideo();
                ((ClsNetP2PMainVideo)objNetTcpVideo).EntsvcJoin        += new ClsNetP2PMainVideo.delsvcJoin(P2PVideoClient_EntsvcJoin);
                ((ClsNetP2PMainVideo)objNetTcpVideo).EntsvcGetUserList += new ClsNetP2PMainVideo.delsvcGetUserList(P2PVideoClient_EntsvcGetUserList);
                ((ClsNetP2PMainVideo)objNetTcpVideo).EntsvcSetUserList += new ClsNetP2PMainVideo.delsvcSetUserList(P2PVideoClient_EntsvcSetUserList);
                ((ClsNetP2PMainVideo)objNetTcpVideo).EntsvcUnJoin      += new ClsNetP2PMainVideo.delsvcUnJoin(P2PVideoClient_EntsvcUnJoin);
                channelNettcpVideo = (INetP2PMainVideoChannel)npcDummyVideo.OpenClient <INetP2PMainVideoChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpVideo);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpVideo.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception exp)
            {
                exp.Data.Add("My Key", "RegVideop2pClient()--:--P2PVideoClient.cs--:--" + exp.Message + " :--:--");
                //ClsException.LogError(exp);
                //ClsException.WriteToErrorLogFile(exp);
                System.Text.StringBuilder sb = new StringBuilder();
                sb.AppendLine(exp.Message);
                sb.AppendLine();
                sb.AppendLine("StackTrace : " + exp.StackTrace);
                sb.AppendLine();
                sb.AppendLine("Location : " + exp.Data["My Key"].ToString());
                sb.AppendLine();
                sb1 = CreateTressInfo();
                sb.Append(sb1.ToString());
                VMuktiAPI.ClsLogging.WriteToTresslog(sb);
            }
        }
Exemple #27
0
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyPresentation = new NetPeerClient();
                objNetTcpPresentation = new clsNetTcpPresentation();
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcJoin         += new clsNetTcpPresentation.delsvcJoin(P2PPresentationDummy_EntsvcJoin);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcSetSlide     += new clsNetTcpPresentation.delsvcSetSlide(P2PPresentationDummy_EntsvcSetSlide);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcUnJoin       += new clsNetTcpPresentation.delsvcUnJoin(P2PPresentationDummy_EntsvcUnJoin);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcSetSlideList += new clsNetTcpPresentation.delsvcSetSlideList(P2PPresentationDummy_EntsvcSetSlideList);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcSignOutPPT   += new clsNetTcpPresentation.delsvcSignOutPPT(P2PPresentationDummy_EntsvcSignOutPPT);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcGetUserList  += new clsNetTcpPresentation.delsvcGetUserList(P2PPresentationDummy_EntsvcGetUserList);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcSetUserList  += new clsNetTcpPresentation.delsvcSetUserList(P2PPresentationDummy_EntsvcSetUserList);

                channelNettcpPresentation = (INetTcpPresentationChannel)npcDummyPresentation.OpenClient <INetTcpPresentationChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpPresentation);

                while (tempcounter < 20)
                {
                    try
                    {
                        clsMessageContract objContract = new clsMessageContract();
                        objContract.strFrom     = UserName;
                        objContract.strMsg      = "";
                        objContract.lstTo       = new List <string>();
                        objContract.slideArr    = new string[0];
                        objContract.SlideID     = 0;
                        objContract.SlideStream = new MemoryStream();
                        channelNettcpPresentation.svcJoin(objContract);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient()", "PresentationDummy.cs");
            }
        }
        public void HostDashBoard(object lstparam)
        {
            try
            {
                List <object> lstTempObj = (List <object>)lstparam;
                strUri = lstTempObj[0].ToString();

                NetPeerClient npcDashBoard = new NetPeerClient();
                ((NetP2PBootStrapDashBoardDelegate)objDashBoard).EntsvcUnJoin      += new NetP2PBootStrapDashBoardDelegate.delsvcUnJoin(PredictiveDialer_EntsvcUnJoin);
                ((NetP2PBootStrapDashBoardDelegate)objDashBoard).EntsvcJoin        += new NetP2PBootStrapDashBoardDelegate.delsvcJoin(PredictiveDialer_EntsvcJoin);
                ((NetP2PBootStrapDashBoardDelegate)objDashBoard).EntsvcGetCallInfo += new NetP2PBootStrapDashBoardDelegate.DelsvcGetCallInfo(PredictiveDialer_EntsvcGetCallInfo);

                channelP2PDashBoard = (INetP2PBootStrapdashBoardChannel)npcDashBoard.OpenClient <INetP2PBootStrapdashBoardChannel>(strUri, lstTempObj[1].ToString(), ref objDashBoard);
                channelP2PDashBoard.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "HostDialerServices()", "MyDialer.xaml.cs");
            }
        }
Exemple #29
0
        public void RegNetP2pClient(object NetP2pUri)
        {
            try
            {
                NetPeerClient npcDummyClient = new NetPeerClient();
                objClsNetP2PUserVideo = new ClsNetP2PUserVideo();
                ((ClsNetP2PUserVideo)objClsNetP2PUserVideo).EntsvcJoin       += new ClsNetP2PUserVideo.delsvcJoin(UserVideoDummies_NetP2P_EntsvcJoin);
                ((ClsNetP2PUserVideo)objClsNetP2PUserVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(UserVideoDummies_NetP2P_EntsvcSendStream);
                ((ClsNetP2PUserVideo)objClsNetP2PUserVideo).EntsvcUnJoin     += new ClsNetP2PUserVideo.delsvcUnJoin(UserVideoDummies_NetP2P_EntsvcUnJoin);

                //((ClsNetP2PMainVideo)objClsNetP2PUserVideo).EntsvcJoin += new ClsNetP2PUserVideo.delsvcJoin(UserVideoDummies_NetP2P_EntsvcJoin);
                //((ClsNetP2PMainVideo)objClsNetP2PUserVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(UserVideoDummies_NetP2P_EntsvcSendStream);
                //((ClsNetP2PMainVideo)objClsNetP2PUserVideo).EntsvcUnJoin += new ClsNetP2PUserVideo.delsvcUnJoin(UserVideoDummies_NetP2P_EntsvcUnJoin);



                objINetP2PChannel = (INetP2PUserVideoChannel)npcDummyClient.OpenClient <INetP2PUserVideoChannel>(NetP2pUri.ToString(), NetP2pUri.ToString().Split(':')[2].Split('/')[2], ref objClsNetP2PUserVideo);

                while (tempcounter < 20)
                {
                    try
                    {
                        objINetP2PChannel.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }

            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient", "UserVideoDummies.cs");
            }
        }
Exemple #30
0
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyChat = new NetPeerClient();
                objNetP2PCoAuthService = new NetP2PCoAuthService();

                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntSvcJoin           += new NetP2PCoAuthService.DelSvcJoin(NetP2PCoAuthService_EntSvcJoin);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSaveDoc        += new NetP2PCoAuthService.DelsvcSaveDoc(NetP2PCoAuthService_EntsvcSaveDoc);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSetCompBytes   += new NetP2PCoAuthService.DelsvcSetCompBytes(NetP2PCoAuthService_EntsvcSetCompBytes);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSetLength      += new NetP2PCoAuthService.DelsvcSetLength(NetP2PCoAuthService_EntsvcSetLength);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcUnJoin         += new NetP2PCoAuthService.DelsvcUnJoin(NetP2PCoAuthService_EntsvcUnJoin);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcReplySetLength += new NetP2PCoAuthService.DelsvcReplySetLength(NetP2PCoAuthService_EntsvcReplySetLength);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcGetUserList    += new NetP2PCoAuthService.DelsvcGetUserList(NetP2PCoAuthService_EntsvcGetUserList);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSetUserList    += new NetP2PCoAuthService.DelsvcSetUserList(NetP2PCoAuthService_EntsvcSetUserList);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSignOutCoAuth  += new NetP2PCoAuthService.delsvcSignOutCoAuth(NetP2PCoAuthService_EntsvcSignOutCoAuth);

                channelNettcpCoAuth = (INetP2PICoAuthServiceChannel)npcDummyChat.OpenClient <INetP2PICoAuthServiceChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetP2PCoAuthService);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpCoAuth.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception exp)
            {
                VMuktiHelper.ExceptionHandler(exp, "RegNetP2PClient", "CoAuthDummy.cs");
            }
        }
        public BootstrapServiceDomain()
        {
            try
            {

                #region Initialize global variables

                ClientConnectionString = @"Data Source=" + AppDomain.CurrentDomain.BaseDirectory + "AllocateConferenceNumber.sdf";
                strLocalDBPath = AppDomain.CurrentDomain.BaseDirectory + "AllocateConferenceNumber.sdf";
                lstsSuperNodeInfo = new List<string>();
                localSuperNodeInfo = new List<string>();
                dictFlashUrl = new Dictionary<int, string>();
                arr = new byte[5000];
                #endregion


                if (!System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory.ToString() + "sqlceme35.dll"))
                {
                    new WebClient().DownloadFile(VMuktiAPI.VMuktiInfo.ZipFileDownloadLink + "sqlceme35.dll.zip", AppDomain.CurrentDomain.BaseDirectory.ToString() + "sqlceme35.dll");
                    new WebClient().DownloadFile(VMuktiAPI.VMuktiInfo.ZipFileDownloadLink + "sqlceqp35.dll.zip", AppDomain.CurrentDomain.BaseDirectory.ToString() + "sqlceqp35.dll");
                    new WebClient().DownloadFile(VMuktiAPI.VMuktiInfo.ZipFileDownloadLink + "sqlcese35.dll.zip", AppDomain.CurrentDomain.BaseDirectory.ToString() + "sqlcese35.dll");
                }

                if (!System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory.ToString() + "AllocateConferenceNumber.sdf"))
                {
                    SqlCeEngine clientEngine = new SqlCeEngine(ClientConnectionString);
                    clientEngine.CreateDatabase();

                    LocalSQLConn = new SqlCeConnection();
                    LocalSQLConn.ConnectionString = ClientConnectionString;
                    LocalSQLConn.Open();

                    fncCreateSNNodeInfoTable();
                    fncCreateBuddyStatusTable();
                    fncCreateUserBuddyListTable();
                    fncCreateUserSuperNode_NodeInfoTable();
                    fncCreateUserSuperNodeInfoTable();
                    GetBuddyInfoFromServer();
                }
                else
                {
                    LocalSQLConn = new SqlCeConnection();
                    LocalSQLConn.ConnectionString = ClientConnectionString;
                    LocalSQLConn.Open();

                    fncSNInsertBuddy(VMuktiAPI.VMuktiInfo.BootStrapIPs[0], "Online");

                }
                awClientConnectionString = @"Data Source=" + AppDomain.CurrentDomain.BaseDirectory + "AllocateConferenceNumber.sdf";
                strCurrentMachineIP = VMuktiAPI.VMuktiInfo.CurrentPeer.CurrentMachineIP;


                #region HttpServerHoster 4 Performance

                BootStrapDelegates objBSDel = new BootStrapDelegates();

                objBSDel.EntHttpAddBuddy += new BootStrapDelegates.DelsvcHttpAddBuddy(BootstrapServiceDomain_EntHttpAddBuddy);
                objBSDel.EntHttpRemoveBuddy += new BootStrapDelegates.DelsvcRemoveAddBuddy(BootstrapServiceDomain_EntHttpRemoveBuddy);
                objBSDel.EntHttpBsGetSuperNodeIP += new BootStrapDelegates.DelsvcHttpBsGetSuperNodeIP(BootstrapServiceDomain_EntHttpBsGetSuperNodeIP);
                objBSDel.EntHttpBSJoin += new BootStrapDelegates.DelHttpBSJoin(BootstrapServiceDomain_EntHttpBSJoin);
                objBSDel.EntHttpBSUnJoin += new BootStrapDelegates.DelsvcHttpBSUnJoin(BootstrapServiceDomain_EntHttpBSUnJoin);
                objBSDel.EntHttpGetSuperNodeBuddyList += new BootStrapDelegates.DelsvcHttpGetSuperNodeBuddyList(BootstrapServiceDomain_EntHttpGetSuperNodeBuddyList);
                objBSDel.EntHttpBSAuthorizedUser += new BootStrapDelegates.DelsvcHttpBSAuthorizedUser(BootstrapServiceDomain_EntHttpBSAuthorizedUser);

                objBSDel.EntsvcGetNodeNameByIP += new BootStrapDelegates.DelsvcGetNodeNameByIP(BootstrapServiceDomain_EntsvcGetNodeNameByIP);
                objBSDel.EntHTTPGetOfflineNodeName += new BootStrapDelegates.DelsvcGetOfflineNodeName(BootstrapServiceDomain_EntHTTPGetOfflineNodeName);
                objBSDel.EntsvcGetAllBuddies += new BootStrapDelegates.DelsvcGetAllBuddies(BootstrapServiceDomain_EntsvcGetAllBuddies);
                objBSDel.EntsvcUpdateVMuktiVersion += new BootStrapDelegates.DelsvcUpdateVMuktiVersion(objBSDel_EntsvcUpdateVMuktiVersion);
                objHttpBootStrap = objBSDel;

                BasicHttpServer bhsHttpBootStrap = new BasicHttpServer(ref objHttpBootStrap, "http://" + VMuktiInfo.BootStrapIPs[0] + ":80/HttpBootStrap");
                bhsHttpBootStrap.AddEndPoint<IHTTPBootStrapService>("http://" + VMuktiInfo.BootStrapIPs[0] + ":80/HttpBootStrap");
                bhsHttpBootStrap.OpenServer();

                #endregion

                #region HttpDataBase Server

                try
                {
                    BootStrapDataBaseDelegates objBSDBDel = new BootStrapDataBaseDelegates();
                    objBSDBDel.EntHttpsvcjoin += new BootStrapDataBaseDelegates.DelHttpsvcJoin(objBSDBDel_EntHttpsvcjoin);
                    objBSDBDel.EntHttpExecuteDataSet += new BootStrapDataBaseDelegates.DelHttpExecuteDataSet(objBSDBDel_EntHttpExecuteDataSet);
                    objBSDBDel.EntHttpExecuteStoredProcedure += new BootStrapDataBaseDelegates.DelHttpExecuteStoredProcedure(objBSDBDel_EntHttpExecuteStoredProcedure);
                    objBSDBDel.EntHttpExecuteNonQuery += new BootStrapDataBaseDelegates.DelHttpExecuteNonQuery(objBSDBDel_EntHttpExecuteNonQuery);
                    objBSDBDel.EntHttpExecuteReturnNonQuery += new BootStrapDataBaseDelegates.DelHttpExecuteReturnNonQuery(objBSDBDel_EntHttpExecuteReturnNonQuery);

                    objHttpDatabaseBootStrap = objBSDBDel;

                    bhsHttpDataBase = new BasicHttpServer(ref objHttpDatabaseBootStrap, "http://" + VMuktiInfo.BootStrapIPs[0] + ":80/HttpDataBase");
                    bhsHttpDataBase.AddEndPoint<IHttpBootStrapDataBaseService>("http://" + VMuktiInfo.BootStrapIPs[0] + ":80/HttpDataBase");
                    bhsHttpDataBase.OpenServer();
                }
                catch (Exception ex)
                {
                    VMuktiHelper.ExceptionHandler(ex, "SuperNoeServiceDomain()--HttpDataBase Server()", "Domains\\SuperNodeServiceDomain.cs");
                }

                #endregion


                #region HTTP Server For File Transfer Service 4 Performance

                HTTPFileTransferDelegates objFileTransferDel = new HTTPFileTransferDelegates();
                objFileTransferDel.EntsvcHTTPFileTransferServiceJoin += new HTTPFileTransferDelegates.DelsvcHTTPFileTransferServiceJoin(BootstrapServiceDomain_EntsvcHTTPFileTransferServiceJoin);
                objFileTransferDel.EntsvcHTTPFileTransferServiceUploadFile += new HTTPFileTransferDelegates.DelsvcHTTPFileTransferServiceUploadFile(BootstrapServiceDomain_EntsvcHTTPFileTransferServiceUploadFile);
                objFileTransferDel.EntsvcHTTPFileTransferServiceUploadFileToInstallationDirectory += new HTTPFileTransferDelegates.DelsvcHTTPFileTransferServiceUploadFileToInstallationDirectory(BootstrapServiceDomain_EntsvcHTTPFileTransferServiceUploadFileToInstallationDirectory);
                objFileTransferDel.EntsvcHTTPFileTransferServiceDownloadFile += new HTTPFileTransferDelegates.DelsvcHTTPFileTransferServiceDownloadFile(BootstrapServiceDomain_EntsvcHTTPFileTransferServiceDownloadFile);

                object objHTTPFileTransfer = objFileTransferDel;

                bhsFileTransferServer = new BasicHttpServer(ref objHTTPFileTransfer, "http://" + VMuktiInfo.BootStrapIPs[0] + ":80/VMukti/HttpFileTransferService");
                bhsFileTransferServer.AddEndPoint<IHTTPFileTransferService>("http://" + VMuktiInfo.BootStrapIPs[0] + ":80/VMukti/HttpFileTransferService");
                bhsFileTransferServer.OpenServer();

                #endregion

                #region Http Server For Flash Video

                HttpFlashVideoDelegates objFlashVideoDel = new HttpFlashVideoDelegates();
                objFlashVideoDel.EntsvcHttpBSFVUnJoin += new HttpFlashVideoDelegates.DelsvcHttpBSFVUnJoin(objFlashVideo_EntsvcHttpBSFVUnJoin);
                objFlashVideoDel.EntsvcHttpBSFVJoin += new HttpFlashVideoDelegates.DelsvcHttpBSFVJoin(objFlashVideo_EntsvcHttpBSFVJoin);
                objFlashVideoDel.EntsvcHttpBSFVGetUrl += new HttpFlashVideoDelegates.DelsvcHttpBSFVGetUrl(objFlashVideo_EntsvcHttpBSFVGetUrl);
                objFlashVideoDel.EntsvcHttpBSFVCreateFolder += new HttpFlashVideoDelegates.DelsvcHttpBSFVCreateFolder(objFlashVideo_EntsvcHttpBSFVCreateFolder);

                object objFlashVideo = objFlashVideoDel;

                bhsFlashVideo = new BasicHttpServer(ref objFlashVideo, "http://" + VMuktiInfo.BootStrapIPs[0] + ":80/VMukti/HttpFlashVideo");
                bhsFlashVideo.AddEndPoint<IHttpBootStrapFlashVideo>("http://" + VMuktiInfo.BootStrapIPs[0] + ":80/VMukti/HttpFlashVideo");
                bhsFlashVideo.OpenServer();

                #endregion

                #region NetP2PServerHoster
                npsBootStrapServer = new NetPeerServer("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrap");
                npsBootStrapServer.AddEndPoint("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrap");
                npsBootStrapServer.OpenServer();



                //MessageBox.Show("netp2p server hosted");
                #endregion

                #region NetP2PConsoleServerHoster

                npsConsoleServer = new NetPeerServer("net.tcp://" + VMuktiAPI.VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PConsole");
                npsConsoleServer.AddEndPoint("net.tcp://" + VMuktiAPI.VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PConsole");
                npsConsoleServer.OpenServer();


                #endregion

                #region CallCenter Services
                if (VMuktiAPI.VMuktiInfo.VMuktiVersion.ToString() == "1.1")
                {
                    #region NetP2PPrictiveServerHoster
                    npsBootStrapPredictviveServer = new NetPeerServer("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapPredictive");
                    npsBootStrapPredictviveServer.AddEndPoint("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapPredictive");
                    npsBootStrapPredictviveServer.OpenServer();
                    #endregion

                    #region Hosting DashBoard Server
                    npsBootStrapDashBoardService = new NetPeerServer("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapDashBoard");
                    npsBootStrapDashBoardService.AddEndPoint("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapDashBoard");
                    npsBootStrapDashBoardService.OpenServer();
                    #endregion

                    # region Hosting Active Agent Server
                    npsBootStrapActiveAgentReportService = new NetPeerServer("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapActiveAgentReport");
                    npsBootStrapActiveAgentReportService.AddEndPoint("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapActiveAgentReport");
                    npsBootStrapActiveAgentReportService.OpenServer();
                    #endregion


                    #region Server For Uploading Recorded Calls


                    npsRecordingServer = new NetPeerServer("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapRecordedFiles");
                    npsRecordingServer.AddEndPoint("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapRecordedFiles");
                    npsRecordingServer.OpenServer();

                    #endregion

                    #region Client For Uploading Recorded Calls 4 Performance

                    NetPeerClient npcRecordingClient = new NetPeerClient();
                    object objP2PRecording = new NetP2PBootStrapRecordedFileDelegate();

                    ((NetP2PBootStrapRecordedFileDelegate)objP2PRecording).EntsvcRecordedFileJoin += new NetP2PBootStrapRecordedFileDelegate.delsvcRecordedFileJoin(objP2PRecording_EntsvcRecordedFileJoin);
                    ((NetP2PBootStrapRecordedFileDelegate)objP2PRecording).EntsvcSendRecordedFiles += new NetP2PBootStrapRecordedFileDelegate.delsvcSendRecordedFiles(objP2PRecording_EntsvcSendRecordedFiles);
                    ((NetP2PBootStrapRecordedFileDelegate)objP2PRecording).EntsvcRecordedFileUnJoin += new NetP2PBootStrapRecordedFileDelegate.delsvcRecordedFileUnJoin(objP2PRecording_EntsvcRecordedFileUnJoin);
                    //objNetP2PRecording = objP2PRecording;
                    clientNetP2pChannelRecording = (INetP2PBootStrapRecordedFileChannel)npcRecordingClient.OpenClient<INetP2PBootStrapRecordedFileChannel>("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapRecordedFiles", "P2PRecordedFiles", ref objP2PRecording);

                    VMukti.Business.CommonMessageContract.clsMessageContract objContract = new VMukti.Business.CommonMessageContract.clsMessageContract();
                    objContract.uname = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;
                    objContract.fName = "";
                    objContract.fExtension = "";
                    objContract.fLength = 0;
                    objContract.fStream = new MemoryStream();

                    clientNetP2pChannelRecording.svcRecordedFileJoin(objContract);
                    #endregion
                }
                #endregion

                #region Disaster Recovery

                //fncMakeAllBuddyOffline();

                #endregion

            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "BootstrapServiceDomain()", "Domains\\BootstrapServiceDomain.cs");                               
            }
        }
        public PredictiveDialer(ModulePermissions[] MyPermissions)// done
        {
            InitializeComponent();

            try
            {
                Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.LocalMachine;
                Microsoft.Win32.RegistryKey sk1 = rk.OpenSubKey("SOFTWARE\\Orkaudio");
                if (sk1 != null)
                {
                    StrOrkaInstallDirectory = (string)sk1.GetValue("Install_Dir");
                }
                else
                {
                    StrOrkaInstallDirectory = "";
                    VMuktiAPI.ClsException.WriteToLogFile("Oreka is not Installed");
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "MyDialer()", "MyDialer.xaml.cs");
            } 

            try
            {
                objChannelManager = new ClsChannelManager();

                btnManualDial.Click += new RoutedEventHandler(btnManualDial_Click);
                btnPredictiveDial.Click += new RoutedEventHandler(btnPredictiveDial_Click);
                //this.Unloaded += new RoutedEventHandler(PredictiveDialer_Unloaded);
                Application.Current.MainWindow.Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);
                Application.Current.Exit += new ExitEventHandler(Current_Exit);

                VMuktiHelper.RegisterEvent("SetDispositionForPredictive").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(SetDispositionForPredictive_VMuktiEvent);
                VMuktiHelper.RegisterEvent("SetChannelStatusForPredictive").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(SetChannelStatusForPredictive_VMuktiEvent);
                VMuktiHelper.RegisterEvent("AllModulesLoadedForPredictive").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(AllCtlLoaded_VMuktiEvent);
                VMuktiHelper.RegisterEvent("SetPredictiveDialerEnable").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(SetPredictivePhoneDEnable_VMuktiEvent);
                VMuktiHelper.RegisterEvent("SetAgentNumber").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(SetAgentNumber_VMuktiEvent);

                try
                {
                    if (VMuktiAPI.VMuktiInfo.strExternalPBX == "true")
                    {
                        if (!objChannelManager.RegisterSIPUser())
                        {
                            SIPUserAvailable = false;
                        }
                        else
                        {
                            SIPUserAvailable = true;
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                

                ((svcCallInfo)objCallInfo).EntsvcJoin += new svcCallInfo.DelsvcJoin(PredictiveDialer_EntsvcJoin);
                ((svcCallInfo)objCallInfo).EntAddExtraCall += new svcCallInfo.DelsvcAddExtraCall(PredictiveDialer_EntAddExtraCall);
                ((svcCallInfo)objCallInfo).EntRequestExtraCall += new svcCallInfo.DelsvcRequestExtraCall(PredictiveDialer_EntRequestExtraCall);
                ((svcCallInfo)objCallInfo).EntSendExtraCall += new svcCallInfo.DelsvcSendExtraCall(PredictiveDialer_EntSendExtraCall);
                ((svcCallInfo)objCallInfo).EntRemoveExtraCall += new svcCallInfo.DelsvcRemoveExtraCall(PredictiveDialer_EntRemoveExtraCall);
                ((svcCallInfo)objCallInfo).EntRequestFunctionToExecute += new svcCallInfo.DelsvcRequestFunctionToExecute(PredictiveDialer_EntRequestFunctionToExecute);
                ((svcCallInfo)objCallInfo).EntReplyFunctionExecuted += new svcCallInfo.DelsvcReplyFunctionExecuted(PredictiveDialer_EntReplyFunctionExecuted);
                ((svcCallInfo)objCallInfo).EntHangUpCall += new svcCallInfo.DelsvcHangUpCall(PredictiveDialer_EntHangUpCall);
                ((svcCallInfo)objCallInfo).EntUnJoin += new svcCallInfo.DelsvcUnJoin(PredictiveDialer_EntUnJoin);

                if (CallInfoChannel != null && CallInfoChannel.State == CommunicationState.Opened)
                {
                    CallInfoChannel.Close();
                    CallInfoChannel = null;
                }
                CallInfoClient = new VMuktiService.NetPeerClient();
                CallInfoChannel = (INetP2PBootStrapPredictiveServiceChannel)CallInfoClient.OpenClient<INetP2PBootStrapPredictiveServiceChannel>("net.tcp://" + VMuktiAPI.VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapPredictive", "P2PBootStrapPredictiveMesh", ref objCallInfo);
                CallInfoChannel.svcJoin(objChannelManager.AgentNumber.ToString(), objChannelManager.CurrentCampaingID.ToString());
                
                #region Starting Thread for DashBoard and uploading recorded files.

                thHostDashBoard = new Thread(new ParameterizedThreadStart(HostDashBoard));
                List<object> lstParams = new List<object>();
                lstParams.Add("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapDashBoard");
                lstParams.Add("P2PDashBoardMesh");
                thHostDashBoard.Start(lstParams);

                //File Recoreding
                tHostRecordedFiles = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(HostRecordedFiles));
                List<object> lstParams1 = new List<object>();
                lstParams1.Add("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapRecordedFiles");
                lstParams1.Add("P2PRecordedFiles");
                tHostRecordedFiles.Start(lstParams1);

                #endregion

            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "PredictiveDialer(Outer)", "PredictiveDialer.xaml.cs");
            }
        }
        public void HostDashBoard(object lstparam)
        {
            try
            {
                List<object> lstTempObj = (List<object>)lstparam;
                strUri = lstTempObj[0].ToString();

                NetPeerClient npcDashBoard = new NetPeerClient();
                ((NetP2PBootStrapDashBoardDelegate)objDashBoard).EntsvcUnJoin += new NetP2PBootStrapDashBoardDelegate.delsvcUnJoin(PredictiveDialer_EntsvcUnJoin);
                ((NetP2PBootStrapDashBoardDelegate)objDashBoard).EntsvcJoin += new NetP2PBootStrapDashBoardDelegate.delsvcJoin(PredictiveDialer_EntsvcJoin);
                ((NetP2PBootStrapDashBoardDelegate)objDashBoard).EntsvcGetCallInfo += new NetP2PBootStrapDashBoardDelegate.DelsvcGetCallInfo(PredictiveDialer_EntsvcGetCallInfo);

                channelP2PDashBoard = (INetP2PBootStrapdashBoardChannel)npcDashBoard.OpenClient<INetP2PBootStrapdashBoardChannel>(strUri, lstTempObj[1].ToString(), ref objDashBoard);
                channelP2PDashBoard.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "HostDialerServices()", "MyDialer.xaml.cs");
            }
        }
        void RegClient(object videoURI)
        {
            lock (this)
            {
                try
                {
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.BootStrap || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.SuperNode || VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithNetP2P)
                    {
                        ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcJoin += new ClsNetP2PUserVideo.delsvcJoin(ctlUserVideo_EntsvcJoin);
                        ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(ctlUserVideo_EntsvcSendStream);
                        ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcUnJoin += new ClsNetP2PUserVideo.delsvcUnJoin(ctlUserVideo_EntsvcUnJoin);

                        npcDirectXVideo = new NetPeerClient();
                        netp2pDirectXVideoChannel = (INetP2PUserVideoChannel)npcDirectXVideo.OpenClient<INetP2PUserVideoChannel>(videoURI.ToString(), videoURI.ToString().Split(':')[2].Split('/')[2], ref objDirectXVideo);
                        netp2pDirectXVideoChannel.svcJoin(MyUserName);
                    }
                    else
                    {
                        int count = 0;
                        while (count < 90)
                        {
                            try
                            {
                                bhcDirectXVideo = new BasicHttpClient();
                                httpDirectXVideoChannel = (IHttpUserVideo)bhcDirectXVideo.OpenClient<IHttpUserVideo>(videoURI.ToString());
                                httpDirectXVideoChannel.svcJoin(MyUserName);

                                count = 90;

                                if (MyVidType != "Me")
                                {
                                    disptGetImages.Start();
                                }
                            }
                            catch
                            {
                                System.Threading.Thread.Sleep(TimeSpan.FromSeconds(1));
                                count++;
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegClient", "ctlUserVideo.xaml.cs");             
                }
            }
        }
Exemple #35
0
        void bgHostService_DoWork(object sender, DoWorkEventArgs e)
        {
            List <object> lstTempObj = (List <object>)e.Argument;

            strUri = lstTempObj[1].ToString();

            try
            {
                if ((VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.NodeWithNetP2P || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.BootStrap || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.SuperNode)
                {
                    NetPeerClient npcImageShare = new NetPeerClient();

                    ((clsNetTcpImageSharing)objNetTcpImageShare).EntsvcJoin      += new clsNetTcpImageSharing.delsvcJoin(ctlImageSharing_EntsvcJoin);
                    ((clsNetTcpImageSharing)objNetTcpImageShare).EntsvcSendIamge += new clsNetTcpImageSharing.delsvcSendIamge(ctlImageSharing_EntsvcSendIamge);
                    ((clsNetTcpImageSharing)objNetTcpImageShare).EntsvcUnJoin    += new clsNetTcpImageSharing.delsvcUnJoin(ctlImageSharing_EntsvcUnJoin);


                    channelNetTcp = (INetTcpImageShareChannel)npcImageShare.OpenClient <INetTcpImageShareChannel>(strUri, strUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpImageShare);

                    while (temp < 20)
                    {
                        try
                        {
                            channelNetTcp.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);

                            temp = 20;
                        }
                        catch
                        {
                            temp++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                }

                else
                {
                    BasicHttpClient bhcImageSharing = new BasicHttpClient();
                    bhcImageSharing.NewBasicHttpBinding().TransferMode = TransferMode.Streamed;

                    channelHttp = (IHttpImageSharing)bhcImageSharing.OpenClient <IHttpImageSharing>(strUri);

                    while (tempcounter < 20)
                    {
                        try
                        {
                            MemoryStream mmsFinal = new MemoryStream();
                            char         del      = '#';
                            Stream       mmsUName = fncStringToStream(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                            mmsUName.Position = 0;
                            byte[] byteName = fncStreamToByteArry(mmsUName);

                            mmsFinal.Write(byteName, 0, byteName.Length);
                            mmsFinal.WriteByte((byte)del);
                            mmsFinal.WriteByte((byte)del);
                            mmsFinal.WriteByte((byte)del);
                            mmsFinal.Position = 0;

                            channelHttp.svcJoin(mmsFinal);
                            tempcounter = 20;
                        }
                        catch
                        {
                            tempcounter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }

                    dispHttpTimer.Interval = TimeSpan.FromSeconds(2);
                    dispHttpTimer.Tick    += new EventHandler(dispHttpTimer_Tick);
                    dispHttpTimer.Start();
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "HostImageService", "ctlImageSharing.xaml.cs");
            }
        }
        void OpenSuperNodeClient()
        {
            try
            {
                //MessageBox.Show("callin supernode client");

                npcP2PSuperNode = new NetPeerClient();

                NetP2PSuperNodeDelegates objAppSNDel = new NetP2PSuperNodeDelegates();

                objAppSNDel.EntsvcJoin += new NetP2PSuperNodeDelegates.DelsvcJoin(pgHome_EntsvcJoin);
                objAppSNDel.EntsvcSetSpecialMsg += new NetP2PSuperNodeDelegates.DelsvcSetSpecialMsg(pgHome_EntsvcSetSpecialMsg);

                objAppSNDel.EntsvcPageSetSpecialMsg += new NetP2PSuperNodeDelegates.DelsvcPageSetSpecialMsg(pgHome_EntsvcPageSetSpecialMsg);
                objAppSNDel.EntsvcPageBuddyRetSetSpecialMsg += new NetP2PSuperNodeDelegates.DelsvcPageBuddyRetSetSpecialMsg(pgHome_EntsvcPageBuddyRetSetSpecialMsg);
                objAppSNDel.EntsvcSetSpecialMsg4MultipleBuddies += new NetP2PSuperNodeDelegates.DelsvcSetSpecialMsg4MultipleBuddies(pgHome_EntsvcSetSpecialMsg4MultipleBuddies);
                objAppSNDel.EntsvcSetSpecialMsgBuddiesClick += new NetP2PSuperNodeDelegates.DelsvcSetSpecialMsgBuddiesClick(pgHome_EntsvcSetSpecialMsgBuddiesClick);
                objAppSNDel.EntsvcAddDraggedBuddy += new NetP2PSuperNodeDelegates.DelsvcAddDraggedBuddy(pgHome_EntsvcAddDraggedBuddy);
                objAppSNDel.EntsvcAddPageDraggedBuddy += new NetP2PSuperNodeDelegates.DelsvcAddPageDraggedBuddy(pgHome_EntsvcAddPageDraggedBuddy);
                objAppSNDel.EntsvcSetRemoveDraggedBuddy += new NetP2PSuperNodeDelegates.DelsvcSetRemoveDraggedBuddy(pgHome_EntsvcSetRemoveDraggedBuddy);
                objAppSNDel.EntsvcJoinConf += new NetP2PSuperNodeDelegates.DelsvcJoinConf(objAppSNDel_EntsvcJoinConf);
                objAppSNDel.EntsvcSendConfInfo += new NetP2PSuperNodeDelegates.DelsvcSendConfInfo(objAppSNDel_EntsvcSendConfInfo);
                objAppSNDel.EntsvcUnJoinConf += new NetP2PSuperNodeDelegates.DelsvcUnJoinConf(objAppSNDel_EntsvcUnJoinConf);
                objAppSNDel.EntsvcAddConfBuddy += new NetP2PSuperNodeDelegates.DelsvcAddConfBuddy(objAppSNDel_EntsvcAddConfBuddy);
                objAppSNDel.EntsvcRemoveConf += new NetP2PSuperNodeDelegates.DelsvcRemoveConf(objAppSNDel_EntsvcRemoveConf);
                objAppSNDel.EntsvcEnterConf += new NetP2PSuperNodeDelegates.DelsvcEnterConf(objAppSNDel_EntsvcEnterConf);
                objAppSNDel.EntsvcPodNavigation += new NetP2PSuperNodeDelegates.DelsvcPodNavigation(objAppSNDel_EntsvcPodNavigation);
                objAppSNDel.EntsvcUnJoin += new NetP2PSuperNodeDelegates.DelsvcUnJoin(pgHome_EntsvcUnJoin);

                App.objNetP2PSuperNode = objAppSNDel;

                //MessageBox.Show("pghome:-" + VMuktiInfo.CurrentPeer.SuperNodeIP);

                App.chNetP2PSuperNodeChannel = (INetP2PSuperNodeChannel)npcP2PSuperNode.OpenClient<INetP2PSuperNodeChannel>("net.tcp://" + VMuktiInfo.CurrentPeer.SuperNodeIP + ":4000/NetP2PSuperNode", "P2PSuperNodeMesh", ref App.objNetP2PSuperNode);
                App.chNetP2PSuperNodeChannel.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                //ClsException.WriteToLogFile("opened p2p sn channel with join");

            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "OpenSuperNodeClient()", "pgHome.xaml.cs");
            }
        }
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyChat = new NetPeerClient();
                objNetP2PCoAuthService = new NetP2PCoAuthService();

                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntSvcJoin += new NetP2PCoAuthService.DelSvcJoin(NetP2PCoAuthService_EntSvcJoin);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSaveDoc += new NetP2PCoAuthService.DelsvcSaveDoc(NetP2PCoAuthService_EntsvcSaveDoc);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSetCompBytes += new NetP2PCoAuthService.DelsvcSetCompBytes(NetP2PCoAuthService_EntsvcSetCompBytes);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSetLength += new NetP2PCoAuthService.DelsvcSetLength(NetP2PCoAuthService_EntsvcSetLength);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcUnJoin += new NetP2PCoAuthService.DelsvcUnJoin(NetP2PCoAuthService_EntsvcUnJoin);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcReplySetLength += new NetP2PCoAuthService.DelsvcReplySetLength(NetP2PCoAuthService_EntsvcReplySetLength);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcGetUserList += new NetP2PCoAuthService.DelsvcGetUserList(NetP2PCoAuthService_EntsvcGetUserList);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSetUserList += new NetP2PCoAuthService.DelsvcSetUserList(NetP2PCoAuthService_EntsvcSetUserList);
                ((NetP2PCoAuthService)objNetP2PCoAuthService).EntsvcSignOutCoAuth += new NetP2PCoAuthService.delsvcSignOutCoAuth(NetP2PCoAuthService_EntsvcSignOutCoAuth);

                channelNettcpCoAuth = (INetP2PICoAuthServiceChannel)npcDummyChat.OpenClient<INetP2PICoAuthServiceChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetP2PCoAuthService);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpCoAuth.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception exp)
            {
                VMuktiHelper.ExceptionHandler(exp, "RegNetP2PClient", "CoAuthDummy.cs");

            }
        }
        public void RegNetP2pClient(object videoURI)
        {
            try
            {
                object objDirectXVideo = new ClsNetP2PUserVideo();
                ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcJoin += new ClsNetP2PUserVideo.delsvcJoin(ctlUserVideo_EntsvcJoin);
                ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcSendStream += new ClsNetP2PUserVideo.delsvcSendStream(ctlUserVideo_EntsvcSendStream);
                ((ClsNetP2PUserVideo)objDirectXVideo).EntsvcUnJoin += new ClsNetP2PUserVideo.delsvcUnJoin(ctlUserVideo_EntsvcUnJoin);

                NetPeerClient npcDirectXVideo = new NetPeerClient();
                netp2pDirectXVideoChannel = (INetP2PUserVideoChannel)npcDirectXVideo.OpenClient<INetP2PUserVideoChannel>(videoURI.ToString(), videoURI.ToString().Split(':')[2].Split('/')[2], ref objDirectXVideo);
                netp2pDirectXVideoChannel.svcJoin("");
            }

            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient", "clsVideoSNode.cs");             
            }
        }
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyFileSearch = new NetPeerClient();
                objNetFileSearch = new clsNetTcpFileSearch();
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcJoin += new clsNetTcpFileSearch.delsvcJoin(FileSearchDummy_EntsvcJoin);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcRequestFile += new clsNetTcpFileSearch.delsvcRequestFile(FileSearchDummy_EntsvcRequestFile);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcSearchQuery += new clsNetTcpFileSearch.delsvcSearchQuery(FileSearchDummy_EntsvcSearchQuery);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcSearchResult += new clsNetTcpFileSearch.delsvcSearchResult(FileSearchDummy_EntsvcSearchResult);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcSendFileBlock += new clsNetTcpFileSearch.delsvcSendFileBlock(FileSearchDummy_EntsvcSendFileBlock);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcGetUserList += new clsNetTcpFileSearch.delsvcGetUserList(FileSearchDummy_EntsvcGetUserList);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcSetUserList += new clsNetTcpFileSearch.delsvcSetUserList(FileSearchDummy_EntsvcSetUserList);
                ((clsNetTcpFileSearch)objNetFileSearch).EntsvcUnJoin += new clsNetTcpFileSearch.delsvcUnJoin(FileSearchDummy_EntsvcUnJoin);
                NetP2PChannel = (IFileTransferChannel)npcDummyFileSearch.OpenClient<IFileTransferChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetFileSearch);

                while (tempcounter < 20)
                {
                    try
                    {
                        NetP2PChannel.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient", "FileSearchDummy.cs");               
            }
        }
        public void HostDesktopService(object lstParams)
        {
            try
            {
                List<object> lstTempObj = (List<object>)lstParams;
                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)
                {
                    NetPeerClient npcDesktop = new NetPeerClient();
                    ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcJoin += new clsNetTcpDesktop.delsvcJoin(ctlDesktop_Sharing_EntsvcJoin);
                    ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSendMessage += new clsNetTcpDesktop.delsvcSendMessage(ctlDesktop_Sharing_EntsvcSendMessage);
                    ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcGetUserList += new clsNetTcpDesktop.delsvcGetUserList(ctlDesktop_Sharing_EntsvcGetUserList);
                    ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSetUserList += new clsNetTcpDesktop.delsvcSetUserList(ctlDesktop_Sharing_EntsvcSetUserList);
                    ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSelectedDesktop += new clsNetTcpDesktop.delsvcSelectedDesktop(ctlDesktop_Sharing_EntsvcSelectedDesktop);
                    ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcStopControl += new clsNetTcpDesktop.delsvcStopControl(ctlDesktop_Sharing_EntsvcStopControl);
                    ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSendXY += new clsNetTcpDesktop.delsvcSendXY(ctlDesktop_Sharing_EntsvcSendXY);
                    ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcBtnDown += new clsNetTcpDesktop.delsvcBtnDown(ctlDesktop_Sharing_EntsvcBtnDown);
                    ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcBtnUp += new clsNetTcpDesktop.delsvcBtnUp(ctlDesktop_Sharing_EntsvcBtnUp);
                    ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSendKey += new clsNetTcpDesktop.delsvcSendKey(ctlDesktop_Sharing_EntsvcSendKey);
                    ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcAllowView += new clsNetTcpDesktop.delsvcAllowView(ctlDesktop_Sharing_EntsvcAllowView);
                    ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcAllowControl += new clsNetTcpDesktop.delsvcAllowControl(ctlDesktop_Sharing_EntsvcAllowControl);
                    ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcUnJoin += new clsNetTcpDesktop.delsvcUnJoin(ctlDesktop_Sharing_EntsvcUnJoin);

                    channelNetTcp = (INetTcpDesktopChannel)npcDesktop.OpenClient<INetTcpDesktopChannel>(strUri, strUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpDesktop);

                    while (temp < 20)
                    {
                        try
                        {
                            #region MsgContract
                            clsMessageContract objMsgContract = new clsMessageContract();
                            objMsgContract.strFrom = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;
                            objMsgContract.stremImage = new MemoryStream();
                            #endregion MsgContract
                            channelNetTcp.svcJoin(objMsgContract);
                            temp = 20;
                            #region MsgContract
                            clsMessageContract objContractGetUserList = new clsMessageContract();
                            objContractGetUserList.stremImage = new MemoryStream();
                            objContractGetUserList.strFrom = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;
                            objContractGetUserList.strType = "Get";
                            channelNetTcp.svcGetUserList(objContractGetUserList);
                            #endregion MsgContract
                            fncStartSendingImage();
                        }
                        catch
                        {
                            temp++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                }
                else
                {
                    BasicHttpClient bhcDesktop = new BasicHttpClient();
                    bhcDesktop.NewBasicHttpBinding().TransferMode = TransferMode.Streamed;
                    channelHttp = (IHttpDesktop)bhcDesktop.OpenClient<IHttpDesktop>(strUri);
                    while (tempcounter < 20)
                    {
                        try
                        {
                             #region MsgContract
                            clsMessageContract objMsgContract = new clsMessageContract();
                            objMsgContract.strFrom = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;
                            objMsgContract.stremImage = new MemoryStream();
                            #endregion MsgContract
                            channelHttp.svcJoin(objMsgContract);
                            tempcounter = 20;
                            #region MsgContract
                            clsMessageContract objContractGetUserList = new clsMessageContract();
                            objContractGetUserList.stremImage = new MemoryStream();
                            objContractGetUserList.strFrom = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;
                            objContractGetUserList.strType = "Get";
                            #endregion MsgContract                           
                            channelHttp.svcGetUserList(objContractGetUserList);
                            fncStartSendingImage();
                        }
                        catch
                        {
                            tempcounter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }

                    dispTimer.Interval = TimeSpan.FromSeconds(2);
                    dispTimer.Tick += new EventHandler(dispTimer_Tick);
                    dispTimer.Start();
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "HostDesktopService", "ctlDesktop_Sharing.xaml.cs");
            }
        }
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyWhiteboard = new NetPeerClient();
                objNetTcpWhiteboard = new clsNetTcpWhiteboard();

                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EJoin += new clsNetTcpWhiteboard.UserJoin(NetP2PWhiteboard_EJoin);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EClear += new clsNetTcpWhiteboard.ClearCnv(NetP2PWhiteboard_EClear);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EColor += new clsNetTcpWhiteboard.ChangeColor(NetP2PWhiteboard_EColor);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EEllipse += new clsNetTcpWhiteboard.DrawEllipse(NetP2PWhiteboard_EEllipse);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).ELine += new clsNetTcpWhiteboard.DrawLine(NetP2PWhiteboard_ELine);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).ERect += new clsNetTcpWhiteboard.DrawRect(NetP2PWhiteboard_ERect);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EStamper += new clsNetTcpWhiteboard.DrawStamper(NetP2PWhiteboard_EStamper);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EStrokes += new clsNetTcpWhiteboard.DrawStrokes(NetP2PWhiteboard_EStrokes);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EText += new clsNetTcpWhiteboard.ChangeText(NetP2PWhiteboard_EText);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EThickness += new clsNetTcpWhiteboard.ChangeThickness(NetP2PWhiteboard_EThickness);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).ETTool += new clsNetTcpWhiteboard.DrawTextTool(NetP2PWhiteboard_ETTool);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EGetUserList += new clsNetTcpWhiteboard.GetUserList(NetP2PWhiteboard_GetUserList);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).ESetUserList += new clsNetTcpWhiteboard.SetUserList(NetP2PWhiteboard_SetUserList);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).ESignOutChat += new clsNetTcpWhiteboard.SignOutChat(NetP2PWhiteboard_ESignOutChat);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EUnjoin += new clsNetTcpWhiteboard.Unjoin(NetP2PWhiteboard_EUnjoin);
                ((clsNetTcpWhiteboard)objNetTcpWhiteboard).EFontSize += new clsNetTcpWhiteboard.ChangeFontSize(NetP2PWhiteboard_EFontSize);                
                VMuktiAPI.ClsException.WriteToLogFile("Opening P2pClient on URI: " + netP2pUri + "With mesh: " + netP2pUri.ToString().Split(':')[2].Split('/')[2].ToString());
                channelNettcpWhiteboard = (INetTcpWhiteboardChannel)npcDummyWhiteboard.OpenClient<INetTcpWhiteboardChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpWhiteboard);
                VMuktiAPI.ClsException.WriteToLogFile("Client opened Successfully");

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpWhiteboard.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient()", "WhiteBoardDummy.cs");
            }
        }       
        public void hostchatservice(object lstParams)
        {
            List<object> lstTempObj = (List<object>)lstParams;
            strUri = lstTempObj[1].ToString();
            try
            {
                if ((VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.NodeWithNetP2P || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.BootStrap || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.SuperNode)
                {
                    NetPeerClient npcChat = new NetPeerClient();
                    ((clsNetTcpChat)objNetTcpChat).EntsvcJoin += new clsNetTcpChat.delsvcJoin(wndChat_EntsvcJoin);
                    ((clsNetTcpChat)objNetTcpChat).EntsvcSendMessage += new clsNetTcpChat.delsvcSendMessage(wndChat_EntsvcSendMessage);
                    ((clsNetTcpChat)objNetTcpChat).EntsvcGetUserList += new clsNetTcpChat.delsvcGetUserList(ctlChat_EntsvcGetUserList);
                    ((clsNetTcpChat)objNetTcpChat).EntsvcSetUserList += new clsNetTcpChat.delsvcSetUserList(ctlChat_EntsvcSetUserList);
                    ((clsNetTcpChat)objNetTcpChat).EntsvcSignOutChat += new clsNetTcpChat.delsvcSignOutChat(ctlChat_EntsvcSignOutChat);
                    ((clsNetTcpChat)objNetTcpChat).EntsvcUnJoin += new clsNetTcpChat.delsvcUnJoin(wndChat_EntsvcUnJoin);
                    ((clsNetTcpChat)objNetTcpChat).EntsvcShowStatus += new clsNetTcpChat.delsvcShowStatus(ctlChat_EntsvcShowStatus);

                    channelNetTcp = (INetTcpChatChannel)npcChat.OpenClient<INetTcpChatChannel>(strUri, strUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpChat);
                   
                    while (temp < 20)
                    {
                        try
                        {
                            channelNetTcp.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                           
                            temp = 20;
                           
                            channelNetTcp.svcGetUserList(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                        }
                        catch
                        {
                            temp++;
                            System.Threading.Thread.Sleep(1000);
                        }

                    }

                    //ClsException.WriteToLogFile("Chat Module:Opened Chat P2P Client");
                    //ClsException.WriteToLogFile("Uri for opening the client is : " + strUri);
                    //ClsException.WriteToLogFile("MeshId for opening the client is : " + strUri.ToString().Split(':')[2].Split('/')[1]); 
                }
                else
                {
                   
                    BasicHttpClient bhcChat = new BasicHttpClient();
                    channelHttp = (IHttpChat)bhcChat.OpenClient<IHttpChat>(strUri);

                    while (tempcounter < 20)
                    {
                        try
                        {
                            channelHttp.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                            tempcounter = 20;
                            
                            channelHttp.svcGetUserList(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                            
                            txtChat.IsEnabled = true;
                        }
                        catch
                        {
                            tempcounter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }

                    dispTimer.Interval = TimeSpan.FromSeconds(2);
                    dispTimer.Tick += new EventHandler(dispTimer_Tick);
                    dispTimer.Start();

                    //ClsException.WriteToLogFile("chat module: Opened Http Chat Client with Timers");
                    //ClsException.WriteToLogFile("Uri for opening the client is : " + strUri);
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "hostchatservice()", "ctlChat.xaml.cs");
            }
        }
Exemple #43
0
        private void fncHostQAService(object lstParams)
        {
            try
            {
                List <object> lstTempObj = (List <object>)lstParams;
                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)
                {
                    NetPeerClient npcQA = new NetPeerClient();
                    ((clsNetTcpQA)objNetTcpQA).EntsvcP2PJoin          += new clsNetTcpQA.DelsvcP2Pjoin(ctlQA_EntsvcP2PJoin);
                    ((clsNetTcpQA)objNetTcpQA).EntsvcP2PAskQuestion   += new clsNetTcpQA.DelsvcP2PAskQuestion(ctlQA_EntsvcP2PAskQuestion);
                    ((clsNetTcpQA)objNetTcpQA).entsvcP2PReplyQuestion += new clsNetTcpQA.DelsvcP2PReplyQuestion(ctlQA_entsvcP2PReplyQuestion);
                    NetP2PChannel = (INetTcpQAChannel)npcQA.OpenClient <INetTcpQAChannel>(strUri, strUri.ToString().Split(':')[2].Split('/')[1], ref objNetTcpQA);
                    while (Counter < 20)
                    {
                        try
                        {
                            NetP2PChannel.svcP2PJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                            Counter = 20;
                        }
                        catch
                        {
                            Counter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                }
                else
                {
                    //DummyClient dc = new DummyClient();
                    //string httpuri = dc.QAClient(idCounter, strUri, VMukti.Global.VMuktiGlobal.strSuperNodeIP);

                    BasicHttpClient BasicQAClient = new BasicHttpClient();
                    HttpChannel = (IHttpQA)BasicQAClient.OpenClient <IHttpQA>(strUri);

                    while (tempcounter < 20)
                    {
                        try
                        {
                            HttpChannel.svcHttpJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);;
                            tempcounter = 20;
                        }
                        catch
                        {
                            tempcounter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                    dt.Interval = TimeSpan.FromSeconds(2);
                    dt.Tick    += new EventHandler(dt_Tick);
                    dt.Start();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("hostQAservice " + ex.Message);
                if (ex.InnerException != null)
                {
                    MessageBox.Show("hostQAservice" + ex.InnerException.Message);
                }
            }
        }
        private void OpenConsoleClient()
        {
            try
            {
                npc = new NetPeerClient();

                ClsNetP2PConsoleDelegates objP2PConsoleDel = new ClsNetP2PConsoleDelegates();

                objP2PConsoleDel.EntsvcNetP2PConsoleJoin += new ClsNetP2PConsoleDelegates.DelsvcNetP2PConsoleJoin(pgHome_EntsvcNetP2PConsoleJoin);
                objP2PConsoleDel.EntsvcNetP2PConsoleSendMsg += new ClsNetP2PConsoleDelegates.DelsvcNetP2PConsoleSendMsg(pgHome_EntsvcNetP2PConsoleSendMsg);
                objP2PConsoleDel.EntsvcNetP2PConsoleGetLog += new ClsNetP2PConsoleDelegates.DelsvcNetP2PConsoleGetLog(pgHome_EntsvcNetP2PConsoleGetLog);
                objP2PConsoleDel.EntsvcNetP2PConsoleSendLog += new ClsNetP2PConsoleDelegates.DelsvcNetP2pConsoleSendLog(pgHome_EntsvcNetP2PConsoleSendLog);
                objP2PConsoleDel.EntsvcNetP2PConsoleUnJoin += new ClsNetP2PConsoleDelegates.DelsvcNetP2PConsoleUnJoin(pgHome_EntsvcNetP2PConsoleUnJoin);

                objNetTcpConsole = objP2PConsoleDel;

                objChannel = (INetP2PConsoleChannel)npc.OpenClient<INetP2PConsoleChannel>("net.tcp://" + VMuktiAPI.VMuktiInfo.BootStrapIPs[0] + ":8080/NetP2PConsole", "ConsoleMesh", ref objNetTcpConsole);
                objChannel.svcNetP2ConsoleJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "openConsoleClient()", "pgHome.xaml.cs");
            }

        }
        public void HostRecordedFiles(object lstparam)
        {
            try
            {
                List <object> lstTempObj = (List <object>)lstparam;
                strUri = lstTempObj[0].ToString();

                NetPeerClient npcRecordedFiles = new NetPeerClient();
                ((NetP2PBootStrapRecordedFileDelegate)objRecordedFiles).EntsvcRecordedFileJoin   += new NetP2PBootStrapRecordedFileDelegate.delsvcRecordedFileJoin(PredictiveDialer_EntsvcRecordedFileJoin);
                ((NetP2PBootStrapRecordedFileDelegate)objRecordedFiles).EntsvcSendRecordedFiles  += new NetP2PBootStrapRecordedFileDelegate.delsvcSendRecordedFiles(PredictiveDialer_EntsvcSendRecordedFiles);
                ((NetP2PBootStrapRecordedFileDelegate)objRecordedFiles).EntsvcRecordedFileUnJoin += new NetP2PBootStrapRecordedFileDelegate.delsvcRecordedFileUnJoin(PredictiveDialer_EntsvcRecordedFileUnJoin);


                channelNetTcpUploadRecorededFiles = (INetP2PBootStrapRecordedFileChannel)npcRecordedFiles.OpenClient <INetP2PBootStrapRecordedFileChannel>(strUri, lstTempObj[1].ToString(), ref objRecordedFiles);

                clsMessageContract objContract = new clsMessageContract();
                objContract.uname      = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;
                objContract.fName      = "";
                objContract.fExtension = "";
                objContract.fLength    = 0;
                objContract.fStream    = new MemoryStream();

                channelNetTcpUploadRecorededFiles.svcRecordedFileJoin(objContract);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "HostRecordedFiles()", "MyDialer.xaml.cs");
            }
        }
        void bgHostService_DoWork(object sender, DoWorkEventArgs e)
        {
            List<object> lstTempObj = (List<object>)e.Argument;
            strUri = lstTempObj[1].ToString();
            try
            {
                if ((VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.NodeWithNetP2P || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.BootStrap || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.SuperNode)
                {
                    NetPeerClient npcPresentation = new NetPeerClient();
                    ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcJoin += new clsNetTcpPresentation.delsvcJoin(UserControl1_EntsvcJoin);
                    ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcSetSlide += new clsNetTcpPresentation.delsvcSetSlide(UserControl1_EntsvcSetSlide);
                    ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcSetSlideList += new clsNetTcpPresentation.delsvcSetSlideList(UserControl1_EntsvcSetSlideList);
                    ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcGetUserList += new clsNetTcpPresentation.delsvcGetUserList(UserControl1_EntsvcGetUserList);
                    ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcSetUserList += new clsNetTcpPresentation.delsvcSetUserList(UserControl1_EntsvcSetUserList);
                    ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcSignOutPPT += new clsNetTcpPresentation.delsvcSignOutPPT(UserControl1_EntsvcSignOutPPT);
                    ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcUnJoin += new clsNetTcpPresentation.delsvcUnJoin(UserControl1_EntsvcUnJoin);

                    channelNetTcp = (INetTcpPresentationChannel)npcPresentation.OpenClient<INetTcpPresentationChannel>(strUri, strUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpPresentation);

                    while (temp < 20)
                    {
                        try
                        {
                            clsMessageContract objContract = new clsMessageContract();
                            objContract.strFrom = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;
                            objContract.strMsg = "";
                            objContract.lstTo = new List<string>();
                            objContract.slideArr = new string[0];
                            objContract.SlideID = 0;
                            objContract.SlideStream = new MemoryStream();
                            channelNetTcp.svcJoin(objContract);

                            temp = 20;

                            clsMessageContract objContract1 = new clsMessageContract();
                            objContract1.strFrom = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;
                            objContract1.strMsg = "get";
                            objContract1.lstTo = new List<string>();
                            objContract1.slideArr = new string[0];
                            objContract1.SlideID = 0;
                            objContract1.SlideStream = new MemoryStream();
                            channelNetTcp.svcGetUserList(objContract1);
                        }
                        catch
                        {
                            temp++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }

                    ClsException.WriteToLogFile("Presentation module:");
                    ClsException.WriteToLogFile("Opened presenation P2P Client");
                    ClsException.WriteToLogFile("Uri for opening the client is : " + strUri);
                    ClsException.WriteToLogFile("MeshId for opening the client is : " + strUri.ToString().Split(':')[2].Split('/')[1]);
                }
                else
                {
                    BasicHttpClient bhcPresentation = new BasicHttpClient();
                    channelHttp = (IHttpPresentation)bhcPresentation.OpenClient<IHttpPresentation>(strUri);

                    while (tempcounter < 20)
                    {
                        try
                        {
                            clsMessageContract objContract = new clsMessageContract();
                            objContract.strFrom = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;
                            objContract.strMsg = "";
                            objContract.lstTo = new List<string>();
                            objContract.slideArr = new string[0];
                            objContract.SlideID = 0;
                            objContract.SlideStream = new MemoryStream();
                            channelHttp.svcJoin(objContract);

                            tempcounter = 20;

                            clsMessageContract objContract1 = new clsMessageContract();
                            objContract1.strFrom = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;
                            objContract1.strMsg = "get";
                            objContract1.lstTo = new List<string>();
                            objContract1.slideArr = new string[0];
                            objContract1.SlideID = 0;
                            objContract1.SlideStream = new MemoryStream();
                            channelHttp.svcGetUserList(objContract1);
                        }
                        catch
                        {
                            tempcounter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }

                    dispTimerControl.Interval = TimeSpan.FromSeconds(2);
                    dispTimerControl.Tick += new EventHandler(dispTimerControl_Tick);
                    dispTimerControl.Start();

                    ClsException.WriteToLogFile("Presentation module:");
                    ClsException.WriteToLogFile("Opened Http Presentation Client with Timers");
                    ClsException.WriteToLogFile("Uri for opening the client is : " + strUri);
                    ClsException.WriteToLogFile("MeshId for opening the client is : " + strUri.ToString().Split(':')[2].Split('/')[1]);
                }


            }
            catch (System.Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "bgHostService_DoWork()", "UserControl1.xaml.cs");
            }
        }
        public PredictiveDialer(ModulePermissions[] MyPermissions)// done
        {
            InitializeComponent();

            try
            {
                Microsoft.Win32.RegistryKey rk  = Microsoft.Win32.Registry.LocalMachine;
                Microsoft.Win32.RegistryKey sk1 = rk.OpenSubKey("SOFTWARE\\Orkaudio");
                if (sk1 != null)
                {
                    StrOrkaInstallDirectory = (string)sk1.GetValue("Install_Dir");
                }
                else
                {
                    StrOrkaInstallDirectory = "";
                    VMuktiAPI.ClsException.WriteToLogFile("Oreka is not Installed");
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "MyDialer()", "MyDialer.xaml.cs");
            }

            try
            {
                objChannelManager = new ClsChannelManager();

                btnManualDial.Click     += new RoutedEventHandler(btnManualDial_Click);
                btnPredictiveDial.Click += new RoutedEventHandler(btnPredictiveDial_Click);
                //this.Unloaded += new RoutedEventHandler(PredictiveDialer_Unloaded);
                Application.Current.MainWindow.Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);
                Application.Current.Exit += new ExitEventHandler(Current_Exit);

                VMuktiHelper.RegisterEvent("SetDispositionForPredictive").VMuktiEvent   += new VMuktiEvents.VMuktiEventHandler(SetDispositionForPredictive_VMuktiEvent);
                VMuktiHelper.RegisterEvent("SetChannelStatusForPredictive").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(SetChannelStatusForPredictive_VMuktiEvent);
                VMuktiHelper.RegisterEvent("AllModulesLoadedForPredictive").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(AllCtlLoaded_VMuktiEvent);
                VMuktiHelper.RegisterEvent("SetPredictiveDialerEnable").VMuktiEvent     += new VMuktiEvents.VMuktiEventHandler(SetPredictivePhoneDEnable_VMuktiEvent);
                VMuktiHelper.RegisterEvent("SetAgentNumber").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(SetAgentNumber_VMuktiEvent);

                try
                {
                    if (VMuktiAPI.VMuktiInfo.strExternalPBX == "true")
                    {
                        if (!objChannelManager.RegisterSIPUser())
                        {
                            SIPUserAvailable = false;
                        }
                        else
                        {
                            SIPUserAvailable = true;
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }


                ((svcCallInfo)objCallInfo).EntsvcJoin                  += new svcCallInfo.DelsvcJoin(PredictiveDialer_EntsvcJoin);
                ((svcCallInfo)objCallInfo).EntAddExtraCall             += new svcCallInfo.DelsvcAddExtraCall(PredictiveDialer_EntAddExtraCall);
                ((svcCallInfo)objCallInfo).EntRequestExtraCall         += new svcCallInfo.DelsvcRequestExtraCall(PredictiveDialer_EntRequestExtraCall);
                ((svcCallInfo)objCallInfo).EntSendExtraCall            += new svcCallInfo.DelsvcSendExtraCall(PredictiveDialer_EntSendExtraCall);
                ((svcCallInfo)objCallInfo).EntRemoveExtraCall          += new svcCallInfo.DelsvcRemoveExtraCall(PredictiveDialer_EntRemoveExtraCall);
                ((svcCallInfo)objCallInfo).EntRequestFunctionToExecute += new svcCallInfo.DelsvcRequestFunctionToExecute(PredictiveDialer_EntRequestFunctionToExecute);
                ((svcCallInfo)objCallInfo).EntReplyFunctionExecuted    += new svcCallInfo.DelsvcReplyFunctionExecuted(PredictiveDialer_EntReplyFunctionExecuted);
                ((svcCallInfo)objCallInfo).EntHangUpCall               += new svcCallInfo.DelsvcHangUpCall(PredictiveDialer_EntHangUpCall);
                ((svcCallInfo)objCallInfo).EntUnJoin += new svcCallInfo.DelsvcUnJoin(PredictiveDialer_EntUnJoin);

                if (CallInfoChannel != null && CallInfoChannel.State == CommunicationState.Opened)
                {
                    CallInfoChannel.Close();
                    CallInfoChannel = null;
                }
                CallInfoClient  = new VMuktiService.NetPeerClient();
                CallInfoChannel = (INetP2PBootStrapPredictiveServiceChannel)CallInfoClient.OpenClient <INetP2PBootStrapPredictiveServiceChannel>("net.tcp://" + VMuktiAPI.VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapPredictive", "P2PBootStrapPredictiveMesh", ref objCallInfo);
                CallInfoChannel.svcJoin(objChannelManager.AgentNumber.ToString(), objChannelManager.CurrentCampaingID.ToString());

                #region Starting Thread for DashBoard and uploading recorded files.

                thHostDashBoard = new Thread(new ParameterizedThreadStart(HostDashBoard));
                List <object> lstParams = new List <object>();
                lstParams.Add("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapDashBoard");
                lstParams.Add("P2PDashBoardMesh");
                thHostDashBoard.Start(lstParams);

                //File Recoreding
                tHostRecordedFiles = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(HostRecordedFiles));
                List <object> lstParams1 = new List <object>();
                lstParams1.Add("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapRecordedFiles");
                lstParams1.Add("P2PRecordedFiles");
                tHostRecordedFiles.Start(lstParams1);

                #endregion
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "PredictiveDialer(Outer)", "PredictiveDialer.xaml.cs");
            }
        }
        void RegFileSearchp2pClient(string P2PUri)
        {
            try
            {
                NetPeerClient npcDummyFileSearch = new NetPeerClient();
                objNetTcpFileSearch = new clsNetTcpFileSearch();
                ((clsNetTcpFileSearch)objNetTcpFileSearch).EntsvcJoin += new clsNetTcpFileSearch.delsvcJoin(P2PFileSearchClient_EntsvcJoin);
                ((clsNetTcpFileSearch)objNetTcpFileSearch).EntsvcUnJoin += new clsNetTcpFileSearch.delsvcUnJoin(P2PFileSearchClient_EntsvcUnJoin);
                channelNettcpFileTransfer = (IFileTransferChannel)npcDummyFileSearch.OpenClient<IFileTransferChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpFileSearch);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpFileTransfer.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception exp)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "RegFileSearchp2pClient", "P2PFileSearchClient.cs");               
            }
        }
        void bgHostService_DoWork(object sender, DoWorkEventArgs e)
        {

            List<object> lstTempObj = (List<object>)e.Argument;
            strUri = lstTempObj[1].ToString();

            try
            {
                if ((VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.NodeWithNetP2P || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.BootStrap || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.SuperNode)
                {
                    NetPeerClient npcImageShare = new NetPeerClient();

                    ((clsNetTcpImageSharing)objNetTcpImageShare).EntsvcJoin += new clsNetTcpImageSharing.delsvcJoin(ctlImageSharing_EntsvcJoin);
                    ((clsNetTcpImageSharing)objNetTcpImageShare).EntsvcSendIamge += new clsNetTcpImageSharing.delsvcSendIamge(ctlImageSharing_EntsvcSendIamge);
                    ((clsNetTcpImageSharing)objNetTcpImageShare).EntsvcUnJoin += new clsNetTcpImageSharing.delsvcUnJoin(ctlImageSharing_EntsvcUnJoin);


                    channelNetTcp = (INetTcpImageShareChannel)npcImageShare.OpenClient<INetTcpImageShareChannel>(strUri, strUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpImageShare);

                    while (temp < 20)
                    {
                        try
                        {
                            channelNetTcp.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);

                            temp = 20;
                        }
                        catch
                        {
                            temp++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                }

                else
                {
                    BasicHttpClient bhcImageSharing = new BasicHttpClient();
                    bhcImageSharing.NewBasicHttpBinding().TransferMode = TransferMode.Streamed;
                    
                    channelHttp = (IHttpImageSharing)bhcImageSharing.OpenClient<IHttpImageSharing>(strUri);

                    while (tempcounter < 20)
                    {
                        try
                        {

                            MemoryStream mmsFinal = new MemoryStream();
                            char del = '#';
                            Stream mmsUName = fncStringToStream(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                            mmsUName.Position = 0;
                            byte[] byteName = fncStreamToByteArry(mmsUName);

                            mmsFinal.Write(byteName, 0, byteName.Length);
                            mmsFinal.WriteByte((byte)del);
                            mmsFinal.WriteByte((byte)del);
                            mmsFinal.WriteByte((byte)del);
                            mmsFinal.Position = 0;

                            channelHttp.svcJoin(mmsFinal);
                            tempcounter = 20;
                        }
                        catch
                        {
                            tempcounter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                    
                    dispHttpTimer.Interval = TimeSpan.FromSeconds(2);
                    dispHttpTimer.Tick += new EventHandler(dispHttpTimer_Tick);
                    dispHttpTimer.Start();

                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "HostImageService", "ctlImageSharing.xaml.cs");
            }
        }
        private void FncHostFileSearchService(object lstParams)
        {
            try
            {
                List<object> lstTempObj = (List<object>)lstParams;
                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)
                {
                    NetPeerClient npcFileSearch = new NetPeerClient();
                    ((clsNetTcpFileSearch)objNetTcpFileSearch).EntsvcJoin+=new clsNetTcpFileSearch.delsvcJoin(FileSearch_EntsvcJoin);
                    ((clsNetTcpFileSearch)objNetTcpFileSearch).EntsvcRequestFile+=new clsNetTcpFileSearch.delsvcRequestFile(FileSearch_EntsvcRequestFile);
                    ((clsNetTcpFileSearch)objNetTcpFileSearch).EntsvcSearchQuery+=new clsNetTcpFileSearch.delsvcSearchQuery(FileSearch_EntsvcSearchQuery);
                    ((clsNetTcpFileSearch)objNetTcpFileSearch).EntsvcSearchResult+=new clsNetTcpFileSearch.delsvcSearchResult(FileSearch_EntsvcSearchResult);
                    ((clsNetTcpFileSearch)objNetTcpFileSearch).EntsvcSendFileBlock+=new clsNetTcpFileSearch.delsvcSendFileBlock(FileSearch_EntsvcSendFileBlock);
                    ((clsNetTcpFileSearch)objNetTcpFileSearch).EntsvcGetUserList += new clsNetTcpFileSearch.delsvcGetUserList(FileSearch_EntsvcGetUserList);
                    ((clsNetTcpFileSearch)objNetTcpFileSearch).EntsvcSetUserList += new clsNetTcpFileSearch.delsvcSetUserList(FileSearch_EntsvcSetUserList);
                    ((clsNetTcpFileSearch)objNetTcpFileSearch).EntsvcUnJoin+=new clsNetTcpFileSearch.delsvcUnJoin(FileSearch_EntsvcUnJoin);
                    NetP2PChannel = (IFileTransferChannel)npcFileSearch.OpenClient<IFileTransferChannel>(strUri, strUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpFileSearch);
                    //**Opening NetP2p Client for FileSearch.

                    while (Counter < 20)
                    {
                        try
                        {
                            NetP2PChannel.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                            Counter = 20;
                            NetP2PChannel.svcGetUserList(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                        }
                        catch
                        {
                            Counter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                }
                else
                {
                    BasicHttpClient BasicFileSearchClient = new BasicHttpClient();
                    HttpChannel = (IHttpFileSearchChannel)BasicFileSearchClient.OpenClient<IHttpFileSearchChannel>(strUri);
                    //**opening Http client for FileSearch module

                    while (tempcounter < 20)
                    {
                        try
                        {
                            HttpChannel.svcHttpJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                            tempcounter = 20;
                        }
                        catch
                        {
                            tempcounter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                    dt.Interval = TimeSpan.FromSeconds(5);
                    dt.Tick += new EventHandler(dt_Tick);
                    dt.Start();

                    dtGetFileList.Interval = TimeSpan.FromSeconds(10);
                    dtGetFileList.Tick += new EventHandler(dtGetFileList_Tick);
                    dtGetFileList.Start();
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "FncHostFileSearchService", "FileSearch.xaml.cs");
                if (ex.InnerException != null)
                {
                    VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "FncHostFileSearchService", "FileSearch.xaml.cs");

                }
            }
        }
        public void hostActiveAgentService(object lstparam)
        {
            try
            {
                List<object> lstTempObj = (List<object>)lstparam;
                strUriforActiveagent = lstTempObj[0].ToString();

                NetPeerClient npcActiveAgent = new NetPeerClient();
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcJoin += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcJoin(ctlrptActiveAgent_EntsvcJoin);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcGetAgentInfo += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcGetAgentInfo(ctlrptActiveAgent_EntsvcGetAgentInfo);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcSetAgentInfo += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcSetAgentInfo(ctlrptActiveAgent_EntsvcSetAgentInfo);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcSetAgentStatus += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcSetAgentStatus(ctlDialer_EntsvcSetAgentStatus);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcBargeRequest += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcBargeRequest(ctlDialer_EntsvcBargeRequest);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcBargeReply += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcBargeReply(ctlDialer_EntsvcBargeReply);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcHangUp += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcHangUp(ctlDialer_EntsvcHangUp);
                ((NetP2PBootStrapActiveAgentReportDelegates)objNetTcpActiveAgent).EntsvcUnJoin += new NetP2PBootStrapActiveAgentReportDelegates.DelsvcUnJoin(ctlrptActiveAgent_EntsvcUnJoin);

                channelNetTcp = (INetP2PBootStrapActiveAgentReportChannel)npcActiveAgent.OpenClient<INetP2PBootStrapActiveAgentReportChannel>(strUriforActiveagent, lstTempObj[1].ToString(), ref objNetTcpActiveAgent);
                channelNetTcp.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, VMuktiAPI.VMuktiInfo.CurrentPeer.CampaignID.ToString());

            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "hostActiveAgentService()", "ctlDialer.xaml.cs");
            }
        }
        private void RegNetP2PClient(string netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyDesktop = new NetPeerClient();
                objNetTcpDesktop = new clsNetTcpDesktop();
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcJoin += new clsNetTcpDesktop.delsvcJoin(DesktopDummy_EntsvcJoin);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSendMessage += new clsNetTcpDesktop.delsvcSendMessage(DesktopDummy_EntsvcSendMessage);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcGetUserList += new clsNetTcpDesktop.delsvcGetUserList(DesktopDummy_EntsvcGetUserList);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSetUserList += new clsNetTcpDesktop.delsvcSetUserList(DesktopDummy_EntsvcSetUserList);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSelectedDesktop += new clsNetTcpDesktop.delsvcSelectedDesktop(DesktopDummy_EntsvcSelectedDesktop);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcStopControl += new clsNetTcpDesktop.delsvcStopControl(DesktopDummy_EntsvcStopControl);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcBtnUp += new clsNetTcpDesktop.delsvcBtnUp(DesktopDummy_EntsvcBtnUp);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcBtnDown += new clsNetTcpDesktop.delsvcBtnDown(DesktopDummy_EntsvcBtnDown);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSendKey += new clsNetTcpDesktop.delsvcSendKey(DesktopDummy_EntsvcSendKey);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcSendXY += new clsNetTcpDesktop.delsvcSendXY(DesktopDummy_EntsvcSendXY);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcAllowView += new clsNetTcpDesktop.delsvcAllowView(DesktopDummy_EntsvcAllowView);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcAllowControl += new clsNetTcpDesktop.delsvcAllowControl(DesktopDummy_EntsvcAllowControl);
                ((clsNetTcpDesktop)objNetTcpDesktop).EntsvcUnJoin += new clsNetTcpDesktop.delsvcUnJoin(DesktopDummy_EntsvcUnJoin);

                channelNettcpDesktop = (INetTcpDesktopChannel)npcDummyDesktop.OpenClient<INetTcpDesktopChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpDesktop);

                while (tempcounter < 20)
                {
                    try
                    {
                        #region MsgContract
                        clsMessageContract objContract = new clsMessageContract();
                        objContract.blControl = false;
                        objContract.blView = false;
                        objContract.key = 0;
                        objContract.mouseButton = 0;
                        objContract.stremImage = new MemoryStream();
                        objContract.strFrom = UserName;
                        objContract.strTo = "";
                        objContract.strType = "";
                        objContract.x = 0;
                        objContract.y = 0;
                        #endregion MsgContract
                        channelNettcpDesktop.svcJoin(objContract);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch(Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient", "DesktopDummy.cs");
            }
        }
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyImageSharing = new NetPeerClient();
                objNetTcpImageSharing = new clsNetTcpImageSharing();

                ((clsNetTcpImageSharing)objNetTcpImageSharing).EntsvcJoin += new clsNetTcpImageSharing.delsvcJoin(ImageSharingDummy_EntsvcJoin);
                ((clsNetTcpImageSharing)objNetTcpImageSharing).EntsvcSendIamge += new clsNetTcpImageSharing.delsvcSendIamge(ImageSharingDummy_EntsvcSendIamge);
                ((clsNetTcpImageSharing)objNetTcpImageSharing).EntsvcUnJoin += new clsNetTcpImageSharing.delsvcUnJoin(ImageSharingDummy_EntsvcUnJoin);

                channelNettcpImageSharing = (INetTcpImageShareChannel)npcDummyImageSharing.OpenClient<INetTcpImageShareChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpImageSharing);

                while (tempcounter < 20)
                {
                    try
                    {
                        channelNettcpImageSharing.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient", "ImageSharingDummy.xaml.cs");

            }
        }
        public void HostRecordedFiles(object lstparam)
        {
            try
            {
                List<object> lstTempObj = (List<object>)lstparam;
                strUri = lstTempObj[0].ToString();

                NetPeerClient npcRecordedFiles = new NetPeerClient();
                ((NetP2PBootStrapRecordedFileDelegate)objRecordedFiles).EntsvcRecordedFileJoin += new NetP2PBootStrapRecordedFileDelegate.delsvcRecordedFileJoin(PredictiveDialer_EntsvcRecordedFileJoin);
                ((NetP2PBootStrapRecordedFileDelegate)objRecordedFiles).EntsvcSendRecordedFiles += new NetP2PBootStrapRecordedFileDelegate.delsvcSendRecordedFiles(PredictiveDialer_EntsvcSendRecordedFiles);
                ((NetP2PBootStrapRecordedFileDelegate)objRecordedFiles).EntsvcRecordedFileUnJoin += new NetP2PBootStrapRecordedFileDelegate.delsvcRecordedFileUnJoin(PredictiveDialer_EntsvcRecordedFileUnJoin);


                channelNetTcpUploadRecorededFiles = (INetP2PBootStrapRecordedFileChannel)npcRecordedFiles.OpenClient<INetP2PBootStrapRecordedFileChannel>(strUri, lstTempObj[1].ToString(), ref objRecordedFiles);

                clsMessageContract objContract = new clsMessageContract();
                objContract.uname = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;
                objContract.fName = "";
                objContract.fExtension = "";
                objContract.fLength = 0;
                objContract.fStream = new MemoryStream();

                channelNetTcpUploadRecorededFiles.svcRecordedFileJoin(objContract);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "HostRecordedFiles()", "MyDialer.xaml.cs");
            }
        }
        void RegNetP2PClient(object netP2pUri)
        {
            try
            {
                NetPeerClient npcDummyPresentation = new NetPeerClient();
                objNetTcpPresentation = new clsNetTcpPresentation();
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcJoin += new clsNetTcpPresentation.delsvcJoin(P2PPresentationDummy_EntsvcJoin);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcSetSlide += new clsNetTcpPresentation.delsvcSetSlide(P2PPresentationDummy_EntsvcSetSlide);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcUnJoin += new clsNetTcpPresentation.delsvcUnJoin(P2PPresentationDummy_EntsvcUnJoin);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcSetSlideList += new clsNetTcpPresentation.delsvcSetSlideList(P2PPresentationDummy_EntsvcSetSlideList);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcSignOutPPT += new clsNetTcpPresentation.delsvcSignOutPPT(P2PPresentationDummy_EntsvcSignOutPPT);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcGetUserList += new clsNetTcpPresentation.delsvcGetUserList(P2PPresentationDummy_EntsvcGetUserList);
                ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcSetUserList += new clsNetTcpPresentation.delsvcSetUserList(P2PPresentationDummy_EntsvcSetUserList);

                channelNettcpPresentation = (INetTcpPresentationChannel)npcDummyPresentation.OpenClient<INetTcpPresentationChannel>(netP2pUri.ToString(), netP2pUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpPresentation);

                while (tempcounter < 20)
                {
                    try
                    {
                        clsMessageContract objContract = new clsMessageContract();
                        objContract.strFrom = UserName;
                        objContract.strMsg = "";
                        objContract.lstTo = new List<string>();
                        objContract.slideArr = new string[0];
                        objContract.SlideID = 0;
                        objContract.SlideStream = new MemoryStream();
                        channelNettcpPresentation.svcJoin(objContract);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegNetP2PClient()", "PresentationDummy.cs");
            }
        }
        public void RegNetP2pClient(object NetP2pUri)
        {
            try
            {
                NetPeerClient npcDummyClient = new NetPeerClient();
                objClsNetP2PMainVideo = new ClsNetP2PMainVideo();
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcJoin += new ClsNetP2PMainVideo.delsvcJoin(MainVideoDummies_NetP2P_EntsvcJoin);
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcGetUserList += new ClsNetP2PMainVideo.delsvcGetUserList(MainVideoDummies_NetP2P_EntsvcGetUserList);
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcSetUserList += new ClsNetP2PMainVideo.delsvcSetUserList(MainVideoDummies_NetP2P_EntsvcSetUserList);
                ((ClsNetP2PMainVideo)objClsNetP2PMainVideo).EntsvcUnJoin += new ClsNetP2PMainVideo.delsvcUnJoin(MainVideoDummies_NetP2P_EntsvcUnJoin);

                objINetP2PChannel = (INetP2PMainVideoChannel)npcDummyClient.OpenClient<INetP2PMainVideoChannel>(NetP2pUri.ToString(), NetP2pUri.ToString().Split(':')[2].Split('/')[2], ref objClsNetP2PMainVideo);

                while (tempcounter < 20)
                {
                    try
                    {
                        objINetP2PChannel.svcJoin(UserName);
                        tempcounter = 20;
                    }
                    catch
                    {
                        tempcounter++;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "--RegNetP2pClient()---VMukti--:--VmuktiModules--:--Collaborative--:--Video.Presentation--:--MainVideoDummies.cs--:");
                //ClsException.LogError(ex);
                //ClsException.WriteToErrorLogFile(ex);
                System.Text.StringBuilder sb = new StringBuilder();
                sb.AppendLine(ex.Message);
                sb.AppendLine();
                sb.AppendLine("StackTrace : " + ex.StackTrace);
                sb.AppendLine();
                sb.AppendLine("Location : " + ex.Data["My Key"].ToString());
                sb.AppendLine();
                sb1 = CreateTressInfo();
                sb.Append(sb1.ToString());
                VMuktiAPI.ClsLogging.WriteToTresslog(sb);
            }
        }
        void bgHostService_DoWork(object sender, DoWorkEventArgs e)
        {
            List<object> lstTempObj = (List<object>)e.Argument;
            strUri = lstTempObj[1].ToString();
            try
            {
                if ((VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.NodeWithNetP2P || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.BootStrap || (VMuktiAPI.PeerType)lstTempObj[0] == VMuktiAPI.PeerType.SuperNode)
                {
                    NetPeerClient npcChat = new NetPeerClient();
                    ((clsNetTcpChat)objNetTcpChat).EntsvcJoin += new clsNetTcpChat.delsvcJoin(wndChat_EntsvcJoin);
                    ((clsNetTcpChat)objNetTcpChat).EntsvcSendMessage += new clsNetTcpChat.delsvcSendMessage(wndChat_EntsvcSendMessage);
                    ((clsNetTcpChat)objNetTcpChat).EntsvcGetUserList += new clsNetTcpChat.delsvcGetUserList(ctlChat_EntsvcGetUserList);
                    ((clsNetTcpChat)objNetTcpChat).EntsvcSetUserList += new clsNetTcpChat.delsvcSetUserList(ctlChat_EntsvcSetUserList);
                    ((clsNetTcpChat)objNetTcpChat).EntsvcSignOutChat += new clsNetTcpChat.delsvcSignOutChat(ctlChat_EntsvcSignOutChat);
                    ((clsNetTcpChat)objNetTcpChat).EntsvcUnJoin += new clsNetTcpChat.delsvcUnJoin(wndChat_EntsvcUnJoin);
                    ((clsNetTcpChat)objNetTcpChat).EntsvcShowStatus += new clsNetTcpChat.delsvcShowStatus(ctlChat_EntsvcShowStatus);

                    channelNetTcp = (INetTcpChatChannel)npcChat.OpenClient<INetTcpChatChannel>(strUri, strUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpChat);

                    while (temp < 20)
                    {
                        try
                        {
                            channelNetTcp.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);

                            temp = 20;

                            channelNetTcp.svcGetUserList(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                        }
                        catch
                        {
                            temp++;
                            System.Threading.Thread.Sleep(1000);
                        }

                    }
                }
                else
                {

                    BasicHttpClient bhcChat = new BasicHttpClient();
                    channelHttp = (IHttpChat)bhcChat.OpenClient<IHttpChat>(strUri);

                    while (tempcounter < 20)
                    {
                        try
                        {
                            channelHttp.svcJoin(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                            tempcounter = 20;

                            channelHttp.svcGetUserList(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);

                            txtChat.IsEnabled = true;
                        }
                        catch
                        {
                            tempcounter++;
                            System.Threading.Thread.Sleep(1000);
                        }
                    }


                    dispTimer.Interval = TimeSpan.FromSeconds(2);
                    dispTimer.Tick += new EventHandler(dispTimer_Tick);
                    dispTimer.Start();
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "hostchatservice()", "ctlChat.xaml.cs");
            }
        }