//##ModelId=424BB6470121 Agent ACDX::agentByCallId(CString _epid, CString _callid) { std::list<Agent>::iterator aliasElement; Agent agent; for(aliasElement = aliasList.begin(); aliasElement != aliasList.end(); ++aliasElement ) { agent = *aliasElement; if (_epid==agent.getEpid() && _callid==agent.getCallId()) { agent.isOK = TRUE; return agent; } } return agent; }
//##ModelId=424BB6470058 CString ACDX::dumpAgentStates() { //SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss"); //SYSTEMTIME systemtime; CString result = "Agent list\n"; std::list<Agent>::iterator aliasElement; Agent ag; for(aliasElement = aliasList.begin(); aliasElement != aliasList.end(); ++aliasElement ) { ag = *aliasElement; //systemtime.wMilliseconds = ag.getLastCall();//? here to h m s maybe case error struct tm * t = (struct tm *)ag.getLastTime(); //t->tm_mon+1 t->tm_hour; t->tm_min; t->tm_sec; char c_hour[sizeof(int)]; char c_min[sizeof(int)]; char c_sec[sizeof(int)]; itoa(t->tm_hour,c_hour,10); itoa(t->tm_min,c_min,10); itoa(t->tm_sec,c_sec,10); // agent last call time CString cs_time = CString(c_hour)+":"+CString(c_min)+":"+CString(c_sec); //t->tm_mon+1; //CTime t(systemtime); if (ag.isAgent()) { // agent list contains all GK registration, only list configured agents result += ag.getAlias() + " (" + ag.getEpid() + "):\t" + (ag.isBlocked() ? "NOT logged in" : " logged in") + "\tstate: " + (ag.getState()==0 ? "AVAILABLE" : "TALKING " ) + //"\tlast call: " + t.Format("%H:%M:%S") + "\tlast call: " + cs_time + "\n<br>"; } } return result; }