if (block.find("Event: ManagerUserEvent",0) != std::string::npos && \ block.find("Event: CRM_LoginAgent",0) != std::string::npos) \ { \ std::string theEvent, theAgent, isPaused = "0"; int theStatus; theEvent = "CRM_LoginAgent"; if (gDebug) { std::cout << "UserEvent - CRM_LoginAgent "; } if (block.find("Agent: ",0) != std::string::npos) { pos = block.find("Agent: ",0) + 7; end = block.find("|",pos); theAgent = block.substr(pos,end-pos); if (gLog) { writeGnudialerLog("ManagerUserEvent - " + theEvent + " - " + theAgent); } if (gDebug) { std::cout << " Agent: " << theAgent; } } std::cout << std::endl; if (TheAgents.exists(atoi(theAgent.c_str()))) { theStatus = TheAgents.where(atoi(theAgent.c_str())).GetStatus(); if (theStatus != -2) { if (theStatus == -3) { isPaused = "1"; } pid = fork(); if (pid == 0) { doSendLoggedIn(theAgent,isPaused,managerUser,managerPass); exit(0); } if (pid == -1) { throw xForkError(); } } } else { std::cout << "CRM_LoginAgent: Error parsing agent number! " << std::endl; } } //*********************************************************************************** if (block.find("Event: ManagerUserEvent",0) != std::string::npos && \ block.find("Event: CRM_LoginAgent",0) != std::string::npos) \ { \ std::string theEvent, theAgent, isPaused = "0"; int theStatus; theEvent = "CRM_LoginAgent"; if (gDebug) { std::cout << "UserEvent - CRM_LoginAgent "; } if (block.find("Agent: ",0) != std::string::npos) { pos = block.find("Agent: ",0) + 7; end = block.find("|",pos); theAgent = block.substr(pos,end-pos); if (gLog) { writeGnudialerLog("ManagerUserEvent - " + theEvent + " - " + theAgent); } if (gDebug) { std::cout << " Agent: " << theAgent; } } std::cout << std::endl; if (TheAgents.exists(atoi(theAgent.c_str()))) { theStatus = TheAgents.where(atoi(theAgent.c_str())).GetStatus(); if (theStatus != -2) { if (theStatus == -3) { isPaused = "1"; } pid = fork(); if (pid == 0) { doSendLoggedIn(theAgent,isPaused,managerUser,managerPass); exit(0); } if (pid == -1) { throw xForkError(); } } } else { std::cout << "CRM_LoginAgent: Error parsing agent number! " << std::endl; } }