Exemplo n.º 1
0
        void onExit()
        {
            try
            {
                if (!isExitCalled)
                {
                    VMuktiHelper.UnRegisterEvent("SetDispositionForPredictive");
                    VMuktiHelper.UnRegisterEvent("SetChannelStatusForPredictive");

                    if (CallInfoChannel != null)
                    {
                        CallInfoChannel.Close();
                        CallInfoChannel.Dispose();
                        CallInfoChannel = null;
                    }
                    isExitCalled = true;
                }
                objChannelManager.CallExit();
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "onExit()", "PredictiveDialer.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 onExit()
        {
            try
            {
                if (!isExitCalled)
                {
                    VMuktiHelper.UnRegisterEvent("SetDispositionForPredictive");
                    VMuktiHelper.UnRegisterEvent("SetChannelStatusForPredictive");

                    if (CallInfoChannel != null)
                    {
                        CallInfoChannel.Close();
                        CallInfoChannel.Dispose();
                        CallInfoChannel = null;
                    }
                    isExitCalled = true;
                }
                objChannelManager.CallExit();
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "onExit()", "PredictiveDialer.xaml.cs");
            }
        }
Exemplo n.º 4
0
        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");
            }
        }