예제 #1
0
        public ctlImageSharing(VMuktiAPI.PeerType PeerType, string uri, ModulePermissions[] MyPermissions, string Role)
        {
            try
            {
                InitializeComponent();

                thGlobalVariable = new System.Threading.Thread(new System.Threading.ThreadStart(GlobalVariable));
                thGlobalVariable.Start();

                bgHostService = new BackgroundWorker();

                lstImageTrack = new List <ImageTrack>();

                VMuktiAPI.VMuktiHelper.RegisterEvent("SignOut").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlImageSharing_VMuktiEvent);

                Application.Current.Exit += new ExitEventHandler(Current_Exit);

                btnPrev.IsEnabled  = false;
                btnPrev.Click     += new RoutedEventHandler(btnPrev_Click);
                btnPlay.Click     += new RoutedEventHandler(btnPlay_Click);
                btnPlay.Tag        = "play";
                btnNext.Click     += new RoutedEventHandler(btnNext_Click);
                btnAddImage.Click += new RoutedEventHandler(btnAddImage_Click);
                btnSave.Click     += new RoutedEventHandler(btnSave_Click);
                btnDesktop.Click  += new RoutedEventHandler(btnDesktop_Click);
                btnDesktop.ToolTip = "Set Image As Your Desktop Background";

                //objSetImage = new DelSetImage(delSetImage);
                //objImageBlock = new DelImageBlock(delImageBlock);
                //objDelGetMsg = new DelGetMessage(delGetMessage);
                //objDelAddImage = new DelAddIamge(delAddImage);

                strRole = Role;

                bgHostService.DoWork += new DoWorkEventHandler(bgHostService_DoWork);

                //tHostImageSharing = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(HostImageService));
                List <object> lstParams = new List <object>();
                lstParams.Add(PeerType);
                lstParams.Add(uri);
                lstParams.Add(MyPermissions);

                bgHostService.RunWorkerAsync(lstParams);
                //tHostImageSharing.Start(lstParams);

                dispTimer.Interval = TimeSpan.FromSeconds(2);
                dispTimer.Tick    += new EventHandler(dispTimer_Tick);
                this.Loaded       += new RoutedEventHandler(ctlImageSharing_Loaded);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "ctlImageSharing", "ctlImageSharing.xaml.cs");
            }
        }
예제 #2
0
        public ctlDialer(VMuktiAPI.PeerType objLocalPeerType, string uri, ModulePermissions[] MyPermissions,string Role)
        {
            InitializeComponent();
             System.OperatingSystem osInfo = System.Environment.OSVersion;
             if (osInfo.Version.Major.ToString() == "6")
             {
                 blIsVista = true;
                 ProcStartAudioVistaExe = new System.Diagnostics.Process();
                 ProcStartAudioVistaExe.StartInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory.ToString() + @"\VistaAudio";
                 ProcStartAudioVistaExe.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                 ProcStartAudioVistaExe.StartInfo.FileName = AppDomain.CurrentDomain.BaseDirectory.ToString() + @"\VistaAudio\VMuktiAudio.VistaService.exe";
                 ProcStartAudioVistaExe.Start();
             }
             else
             {
                 blIsVista = false;
             }
            objPeerType = objLocalPeerType;
            _MyPermissions = MyPermissions;
            FncPermissionsReview();
            try
            {
                btnPad.Click += new RoutedEventHandler(btnPad_Click);
                btnReject.Click += new RoutedEventHandler(btnReject_Click);
                btnAccept.Click += new RoutedEventHandler(btnAccept_Click);
                btnCancel.Click += new RoutedEventHandler(btnCancel_Click);
                btnTransfer.Click += new RoutedEventHandler(btnTransfer_Click);
                btnDTMF.Click += new RoutedEventHandler(btnDTMF_Click);
                btnCall.Click += new RoutedEventHandler(btnCall_Click);
                btnHangup.Click += new RoutedEventHandler(btnHangup_Click);
                btnHold.Click += new RoutedEventHandler(btnHold_Click);
                btnConference.Click += new RoutedEventHandler(btnConference_Click);
                btnChannels = new Button[6];

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

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

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


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

                thostActiveAgent = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(hostActiveAgentService));
                List<object> lstParams = new List<object>();
                lstParams.Add("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapActiveAgentReport");
                lstParams.Add("P2PActiveAgentMesh");
                thostActiveAgent.Start(lstParams);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ctlDialer()", "ctlDialer.xaml.cs");
            }
        }
        public ctlPredictivePhone(VMuktiAPI.PeerType objLocalPeerType, string uri, ModulePermissions[] MyPermissions,string Role)
        {
            InitializeComponent();
            objPeerType = objLocalPeerType;
            try
            {
                btnReject.Click += new RoutedEventHandler(btnReject_Click);
                btnAccept.Click += new RoutedEventHandler(btnAccept_Click);
                btnCancel.Click += new RoutedEventHandler(btnCancel_Click);
                btnConference.Click += new RoutedEventHandler(btnConference_Click);
                btnTransfer.Click += new RoutedEventHandler(btnTransfer_Click);
                btnDTMF.Click += new RoutedEventHandler(btnDTMF_Click);
                btnCall.Click += new RoutedEventHandler(btnCall_Click);
                btnHangup.Click += new RoutedEventHandler(btnHangup_Click);
                btnHold.Click += new RoutedEventHandler(btnHold_Click);

                #region To add Channel Buttons
                btnChannels = new Button[6];
                int btnLeft = 20;
                int btnTop = 60;
                for (int i = 0; i < 6; i++)
                {
                    (btnChannels[i]) = new Button();
                    btnChannels[i].Style = (Style)this.Resources["SimpleButton"];
                    btnChannels[i].Height = 20;
                    btnChannels[i].Width = 35;
                    btnChannels[i].Content = (i + 1).ToString();
                    btnChannels[i].Name = "btnCh" + (i + 1).ToString();
                    btnChannels[i].Background = Brushes.Transparent;
                    btnChannels[i].Foreground = Brushes.Black;
                    btnChannels[i].FontSize = 13;
                    btnChannels[i].BorderThickness = new Thickness(0, 0, 0, 0);
                    btnChannels[i].Margin = new Thickness(btnLeft, btnTop, 0, 0);
                    btnLeft = btnLeft + 39;
                    btnChannels[i].Click += new RoutedEventHandler(ChClick);
                    btnChannels[i].Tag = "Free";
                    btnChannels[i].IsEnabled = false;
                    CnvPhoneProperty.Children.Add(btnChannels[i]);
                    TimeCounterCollection.Add(i, "0:00:00");
                }
                
                #endregion

                VMuktiHelper.RegisterEvent("RegisterAgent").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(FncRegister);
                VMuktiHelper.RegisterEvent("Dial").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEventDial);
                VMuktiHelper.RegisterEvent("HangUp").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEventHangUp);
                VMuktiHelper.RegisterEvent("TransferCall").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlPredictivePhoneTransferCall_VMuktiEvent);
                VMuktiHelper.RegisterEvent("BargeCall").VMuktiEvent+=new VMuktiEvents.VMuktiEventHandler(ctlPredictivePhoneBargeCall_VMuktiEvent);
                VMuktiHelper.RegisterEvent("HijeckCall").VMuktiEvent+=new VMuktiEvents.VMuktiEventHandler(ctlPredictivePhoneHijeckCal_VMuktiEvent);
                VMuktiHelper.RegisterEvent("UnMuteCall").VMuktiEvent+=new VMuktiEvents.VMuktiEventHandler(ctlPredictivePhoneUnMuteCall_VMuktiEvent);
                VMuktiHelper.RegisterEvent("StartManualDialing").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEventStartManualDialing);
                VMuktiHelper.RegisterEvent("SetSoftPhoneEnable").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEvent_SetSoftPhoneEnable);
                VMuktiHelper.RegisterEvent("SetIncomingNumber").VMuktiEvent+=new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEvent_SetIncomingNumber);
                VMuktiHelper.RegisterEvent("HoldCall").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlPredictivePhone_VMuktiEvent);
                
                VMuktiAPI.VMuktiHelper.RegisterEvent("SignOut").VMuktiEvent +=new VMuktiEvents.VMuktiEventHandler(ctlPredictivePhone_VMuktiEvent_SingOut); 

                t1 = new System.Timers.Timer(1000);
                t1.Elapsed += new System.Timers.ElapsedEventHandler(t1_Elapsed);
                btnHold.IsEnabled = false;
                btnTransfer.IsEnabled = false;
                //this.Unloaded += new RoutedEventHandler(ctlDialer_Unloaded);
                
                objHangupAdmin = new DelHangupAdmin(HangupAdmin);
                objBargeRequest = new DelBargeReqest(BargeRequest);

                #region Thread for Register Client of ActiveAgent Report
                
                thostActiveAgent = new Thread(new ParameterizedThreadStart(hostActiveAgentService));
                List<object> lstParams = new List<object>();
                lstParams.Add("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapActiveAgentReport");
                lstParams.Add("P2PActiveAgentMesh");
                thostActiveAgent.Start(lstParams);

                #endregion

                
                //calling its own registered event to disable soft phone at initial time
                VMuktiHelper.CallEvent("StartManualDialing", this, new VMuktiEventArgs(false, "Manual"));
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "ctlPredictivePhone()", "ctlPredictivePhone.xaml.cs");
            }
        }
예제 #4
0
        public ctlVideo(VMuktiAPI.PeerType PeerType, string URI, ModulePermissions[] MyPermissions, string MyMeetingRole)
        {
            try
            {
                InitializeComponent();

                VMuktiAPI.VMuktiHelper.RegisterEvent("SignOut").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlVideo_VMuktiEvent);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ctlVideo", "ctlVideo.xaml.cs");
            }

            try
            {
                this.Loaded              += new RoutedEventHandler(ctlVideo_Loaded);
                this.Unloaded            += new RoutedEventHandler(ctlVideo_Unloaded);
                Application.Current.Exit += new ExitEventHandler(Current_Exit);

                if (MyMeetingRole == "Host")
                {
                    _MyMeetingRole = MeetingRoles.Host;
                }
                else
                {
                    _MyMeetingRole = MeetingRoles.Participant;
                }

                objGetUserList = new DelGetUserList(objDelGetUserList);
                objRemoveUser  = new DelRemoveUser(objDelRemoveUser);
                objClose       = new DelClose(objDelClose);

                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.NodeWithHttp)
                {
                    thostSNodeVideo = new Thread(new ParameterizedThreadStart(hostSNodeVideoService));

                    List <object> lstMainVideoParams = new List <object>();
                    lstMainVideoParams.Add(PeerType);
                    lstMainVideoParams.Add(URI);
                    lstMainVideoParams.Add(MyPermissions);
                    lstMainVideoParams.Add(_MyMeetingRole);

                    List <object> lstSNodeVideoParams = new List <object>();
                    lstSNodeVideoParams.Add(PeerType);
                    lstSNodeVideoParams.Add("http://" + VMuktiInfo.CurrentPeer.SuperNodeIP + ":80/NetP2PVideoHoster");
                    lstSNodeVideoParams.Add(MyPermissions);
                    lstSNodeVideoParams.Add(_MyMeetingRole);

                    lstSNodeVideoParams.Add(lstMainVideoParams);

                    thostSNodeVideo.Start(lstSNodeVideoParams);
                }
                else
                {
                    cnvHttp.Visibility = Visibility.Visible;
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ctlVideo", "ctlVideo.xaml.cs");
            }
        }