private void buttonLogOut_Click(object sender, EventArgs e) { IAgent logoutAgent = null; int counter = 0; int selectedIndex = 0; try { foreach (ListViewItem item in listViewAgentsList.SelectedItems) { selectedIndex = listViewAgentsList.SelectedIndices[counter++]; Agent agent = (Agent)item.Tag; if (loginObjectTable.Contains(agent.AgentKey)) { logoutAgent = (IAgent)loginObjectTable[agent.AgentKey]; logoutAgent.Logoff(enMediaTypes.MediaType_Voice); agent.Status = "LoggedOUT"; listViewAgentsList.Items[selectedIndex].BackColor = Color.AliceBlue; listViewAgentsList.Items[selectedIndex].SubItems[2].Text = agent.Status; loginObjectTable.Remove(agent.AgentKey); _logger.Info("Logging off agent " + agent.Name); } } } catch (Exception ex) { _logger.Error("Exception in logout" + ex); } }
private void Start() { SMLogManager.Initialize(); _logger = SMLogManager.GetLogger("trg.sm.si.unify.UnifySimulator.main"); _logger.Info("StartUp Thread started"); dataGridCallDetail.RowPostPaint += new DataGridViewRowPostPaintEventHandler(dataGridCallDetail_RowPostPaint); loginObjectTable = new Hashtable(); AgentsTimer = new Hashtable(); ConnectToServer(); _logger.Info("Server Connected successfully Connected"); AdminLogon(); _logger.Info("Admin logged in successfully"); _logger.Info("Exitting StartUp Thread"); loadBox.Hide(); }
private void ProcessEvent() { while (true) { Object baseEvent = eventQueue.Take(); switch (baseEvent) { case MediaEvent mediaEvent: _logger.Info("Unhandled Event from Switch"); ProcessMediaEvent(mediaEvent); break; case RoutingEvent routingEvent: ProcessRoutingEvent(routingEvent); break; default: _logger.Info("Unhandled Event from Switch "); break; } } }