Skip to content

Commit

Permalink
Migrated all c++ operations components to use the new logger.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joegen Baclor committed May 4, 2011
1 parent c1156bc commit ef2d965
Show file tree
Hide file tree
Showing 357 changed files with 5,471 additions and 7,944 deletions.
60 changes: 30 additions & 30 deletions sipXacd/src/ACDAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ ACDAgent::~ACDAgent()

void ACDAgent::updateState(ePresenceStateType type, bool state)
{
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent(%s)::updateState - type: %d, state: %d", mUriString.data(), type, state);
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent(%s)::updateState - type: %d, state: %d", mUriString.data(), type, state);
osPrintf("ACDAgent(%s)::updateState - type: %d, state: %d\n", mUriString.data(), type, state);

ACDAgentMsg updateStateMsg(ACDAgentMsg::UPDATE_STATE, type, state);
Expand Down Expand Up @@ -243,15 +243,15 @@ SIPX_CALL ACDAgent::connect(ACDCall* pACDCall)
// Create the outbound call to the agent URI
if (sipxCallCreate(mhAcdCallManagerHandle, hLine, &mhCallHandle) != SIPX_RESULT_SUCCESS)
{
OsSysLog::add(FAC_ACD, PRI_ERR,
Os::Logger::instance().log(FAC_ACD, PRI_ERR,
"ACDAgent::connect - "
"ACDAgent(%s) failed to create outbound call",
mUriString.data());
mhCallHandle = SIPX_CALL_NULL ;
return 0;
}

OsSysLog::add(FAC_ACD, gACD_DEBUG,
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG,
"ACDAgent::connect - "
"ACDAgent(%s) succeeded to create outbound call with call handle %d. mBounceCount=%d",
mUriString.data(), mhCallHandle, mBounceCount);
Expand Down Expand Up @@ -313,7 +313,7 @@ SIPX_CALL ACDAgent::connect(ACDCall* pACDCall)
tempFromUrl.toString(displayUserAndQueue);

#ifdef TEST_PRINT
OsSysLog::add(FAC_ACD, PRI_DEBUG,
Os::Logger::instance().log(FAC_ACD, PRI_DEBUG,
"ACDAgent::connect - "
"fromDisp '%s' fromUser '%s' "
"From '%s' pAcdLineAor '%s' qName '%s' "
Expand All @@ -333,7 +333,7 @@ SIPX_CALL ACDAgent::connect(ACDCall* pACDCall)
mNonResponsiveTime = acdQueue->getAgentsNonResponsiveTime();
// Update mMaxBounceCount from the queue
mMaxBounceCount = acdQueue->getMaxBounceCount();
OsSysLog::add(FAC_ACD, gACD_DEBUG,
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG,
"ACDAgent::connect - ACDAgent(%s) "
"mWrapupTime=%d mNonResponsiveTime=%d mMaxBounceCount=%d",
mUriString.data(),mWrapupTime, mNonResponsiveTime, mMaxBounceCount);
Expand All @@ -355,7 +355,7 @@ SIPX_CALL ACDAgent::connect(ACDCall* pACDCall)
displayUserAndQueue.data(),
TRUE) != SIPX_RESULT_SUCCESS) //CpCallManager::AddPaiHdr
{
OsSysLog::add(FAC_ACD, PRI_ERR,
Os::Logger::instance().log(FAC_ACD, PRI_ERR,
"ACDAgent::connect - "
"ACDAgent(%s) failed to initiate outbound call",
mUriString.data());
Expand Down Expand Up @@ -384,7 +384,7 @@ SIPX_CALL ACDAgent::connect(ACDCall* pACDCall)

void ACDAgent::drop(bool rna)
{
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent::drop Agent(%s)",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent::drop Agent(%s)",
getUriString()->data());

// Remove the association 'tween Call and Agent right away, as
Expand Down Expand Up @@ -526,7 +526,7 @@ void ACDAgent::setAttributes(ProvisioningAttrList& rRequestAttributes)
mLock.acquire();

// Set the individual attributes
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent(%s)::setAttributes",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent(%s)::setAttributes",
mUriString.data());

// name
Expand All @@ -538,7 +538,7 @@ void ACDAgent::setAttributes(ProvisioningAttrList& rRequestAttributes)
// monitor-presence
// take action only if adminstrative state is STANDBY
if (((mpAcdAgentManager->getAcdServer())->getAdministrativeState()) == ACDServer::STANDBY) {
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent(%s)::setAttributes - monitor-presence",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent(%s)::setAttributes - monitor-presence",
mUriString.data());
rRequestAttributes.getAttribute(AGENT_MONITOR_PRESENCE_TAG, mMonitorPresence);
// FUTURE: Inteligently subscribe/unsubscribe to LinePresenceMonitor and PresenceServer
Expand All @@ -547,7 +547,7 @@ void ACDAgent::setAttributes(ProvisioningAttrList& rRequestAttributes)
// always-available
// take action only if adminstrative state is STANDBY
if ((mpAcdAgentManager->getAcdServer())->getAdministrativeState() == ACDServer::STANDBY) {
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent(%s)::setAttributes - always-available",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent(%s)::setAttributes - always-available",
mUriString.data());
if (rRequestAttributes.getAttribute(AGENT_ALWAYS_AVAILABLE_TAG, mAlwaysAvailable)) {
// FUTURE: Inteligently subscribe/unsubscribe to LinePresenceMonitor and PresenceServer
Expand Down Expand Up @@ -980,7 +980,7 @@ bool ACDAgent::isAvailable(bool markBusy)
}
break ;
}
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent::isAvailable - ACDAgent(%s) is %s %s",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent::isAvailable - ACDAgent(%s) is %s %s",
mUriString.data(), mAvailable == available ? "still":"now", reason);

if (available && markBusy)
Expand Down Expand Up @@ -1106,7 +1106,7 @@ void ACDAgent::notifyAvailability()
UtlSListIterator listIterator(mAcdQueueList);
while ((pQueue = dynamic_cast<ACDQueue*>(listIterator())) != NULL)
{
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent::notifyAvailability - informing the queue(%s) that agent(%s) is available",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent::notifyAvailability - informing the queue(%s) that agent(%s) is available",
pQueue->getUriString()->data(),
mUriString.data());
pQueue->agentAvailable(this);
Expand Down Expand Up @@ -1142,7 +1142,7 @@ void ACDAgent::setAvailable()
{
// This agent is now available
mAvailable = true;
OsSysLog::add(FAC_ACD, PRI_INFO, "ACDAgent::setAvailable - ACDAgent(%s) is now AVAILABLE",
Os::Logger::instance().log(FAC_ACD, PRI_INFO, "ACDAgent::setAvailable - ACDAgent(%s) is now AVAILABLE",
mUriString.data());
// Let others know the good news.
notifyAvailability();
Expand All @@ -1155,7 +1155,7 @@ void ACDAgent::setAvailable()
{
// Mark this agent as unavailable for calls
mAvailable = false;
OsSysLog::add(FAC_ACD, PRI_INFO, "ACDAgent::setAvailable - ACDAgent(%s) is now UNAVAILABLE",
Os::Logger::instance().log(FAC_ACD, PRI_INFO, "ACDAgent::setAvailable - ACDAgent(%s) is now UNAVAILABLE",
mUriString.data());
}
}
Expand Down Expand Up @@ -1319,7 +1319,7 @@ UtlBoolean ACDAgent::handleMessage(OsMsg& rMessage)

default:
// Bad message
OsSysLog::add(FAC_ACD, PRI_ERR, "ACDAgent::handleMessage - Received bad message");
Os::Logger::instance().log(FAC_ACD, PRI_ERR, "ACDAgent::handleMessage - Received bad message");
break;
}

Expand All @@ -1332,13 +1332,13 @@ UtlBoolean ACDAgent::handleMessage(OsMsg& rMessage)
((OsEventMsg&)rMessage).getUserData((void*&)timerSource);
switch (timerSource) {
case WRAP_UP_TIMER:
OsSysLog::add(FAC_ACD, gACD_DEBUG,
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG,
"ACDAgent::handleMessage - Agent(%s) WRAP_UP_TIMER expired", getUriString()->data());
handleWrapupTimeout();
break;
default:
// Bad message
OsSysLog::add(FAC_ACD, PRI_ERR, "ACDAgent::handleMessage - Received bad message");
Os::Logger::instance().log(FAC_ACD, PRI_ERR, "ACDAgent::handleMessage - Received bad message");
break;
}
return true;
Expand Down Expand Up @@ -1376,7 +1376,7 @@ UtlBoolean ACDAgent::handleMessage(OsMsg& rMessage)

void ACDAgent::updateStateMessage(ePresenceStateType type, bool state, bool recordIdle)
{
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent(%s)::updateStateMessage - type: %d, state: %d",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent(%s)::updateStateMessage - type: %d, state: %d",
mUriString.data(), type, state);

mLock.acquire();
Expand Down Expand Up @@ -1409,25 +1409,25 @@ void ACDAgent::updateStateMessage(ePresenceStateType type, bool state, bool reco
OsDateTime nowTime;
OsDateTime::getCurTime(nowTime);
nowTime.cvtToTimeSinceEpoch(mIdleTimeStart);
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent::updateStateMessage ON_HOOK Agent(%s), idleTime (%d)",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent::updateStateMessage ON_HOOK Agent(%s), idleTime (%d)",
getUriString()->data(), mIdleTimeStart.seconds());
}
else
{
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent::updateStateMessage ON_HOOK Agent(%s)",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent::updateStateMessage ON_HOOK Agent(%s)",
getUriString()->data());
}
setOnHook(true);
break;

case OFF_HOOK:
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent::updateStateMessage OFF_HOOK Agent(%s)",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent::updateStateMessage OFF_HOOK Agent(%s)",
getUriString()->data());
setOnHook(false);
break;

case SIGNED_IN:
OsSysLog::add(FAC_ACD, PRI_INFO, "ACDAgent::updateStateMessage - ACDAgent(%s) SIGNED IN",
Os::Logger::instance().log(FAC_ACD, PRI_INFO, "ACDAgent::updateStateMessage - ACDAgent(%s) SIGNED IN",
mUriString.data());
if (mMonitorPresence)
{
Expand All @@ -1437,7 +1437,7 @@ void ACDAgent::updateStateMessage(ePresenceStateType type, bool state, bool reco
break;

case SIGNED_OUT:
OsSysLog::add(FAC_ACD, PRI_INFO, "ACDAgent::updateStateMessage - ACDAgent(%s) SIGNED OUT",
Os::Logger::instance().log(FAC_ACD, PRI_INFO, "ACDAgent::updateStateMessage - ACDAgent(%s) SIGNED OUT",
mUriString.data());
if (mMonitorPresence)
{
Expand Down Expand Up @@ -1483,7 +1483,7 @@ void ACDAgent::dropCallMessage(bool rna)
OsDateTime::getCurTime(nowTime);
nowTime.cvtToTimeSinceEpoch(mIdleTimeStart);
// Debug
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent::dropCallMessage Agent(%s), idleTime (%d) rna=%s",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent::dropCallMessage Agent(%s), idleTime (%d) rna=%s",
getUriString()->data(), mIdleTimeStart.seconds(),
rna?"true":"false");

Expand All @@ -1496,7 +1496,7 @@ void ACDAgent::dropCallMessage(bool rna)
// answered a call in that many tries, then sign him out if possible.
if (mMaxBounceCount != 0 && mBounceCount>= mMaxBounceCount)
{
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent::dropCallMessage ACDAgent(%s) is being signed Out. mBounceCount=%d",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent::dropCallMessage ACDAgent(%s) is being signed Out. mBounceCount=%d",
getUriString()->data(), mBounceCount);

signOut();
Expand Down Expand Up @@ -1538,7 +1538,7 @@ void ACDAgent::dropCallMessage(bool rna)
if(wrapUpDelay != 0)
{
// Wait the for the Wrapup timer to fire before marking the agent free
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent::dropCallMessage Agent(%s), wrapUpDelay=%d",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent::dropCallMessage Agent(%s), wrapUpDelay=%d",
getUriString()->data(),wrapUpDelay);

mpWrapupTimer->oneshotAfter(OsTime(wrapUpDelay,0));
Expand Down Expand Up @@ -1573,7 +1573,7 @@ void ACDAgent::dropCallMessage(bool rna)

void ACDAgent::handleWrapupTimeout()
{
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent::handleWrapupTimeout Agent(%s), wrapupTime = %d ", getUriString()->data(), mWrapupTime);
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent::handleWrapupTimeout Agent(%s), wrapupTime = %d ", getUriString()->data(), mWrapupTime);

mLock.acquire();
setFree();
Expand All @@ -1599,11 +1599,11 @@ void ACDAgent::handleWrapupTimeout()

void ACDAgent::signOut()
{
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent::signOut Agent(%s) is to be bounced out.",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent::signOut Agent(%s) is to be bounced out.",
mUriString.data());

if (mAlwaysAvailable) {
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent::signOut but Agent(%s) is always available",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent::signOut but Agent(%s) is always available",
mUriString.data());
return ;
}
Expand Down Expand Up @@ -1636,5 +1636,5 @@ void ACDAgent::signOut()
result = request.execute(response) ? OS_SUCCESS : OS_FAILED;
}

OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAgent::signOut PresenceServiceUrl = %s agent(%s) signOut result is %d ", url.data(), mUriString.data(),result);
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAgent::signOut PresenceServiceUrl = %s agent(%s) signOut result is %d ", url.data(), mUriString.data(),result);
}
16 changes: 8 additions & 8 deletions sipXacd/src/ACDAgentManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

// SYSTEM INCLUDES
// APPLICATION INCLUDES
#include <os/OsSysLog.h>
#include <os/OsLogger.h>
#include <xmlparser/tinyxml.h>
#include <cp/LinePresenceMonitor.h>
#include <net/ProvisioningAgent.h>
Expand Down Expand Up @@ -83,7 +83,7 @@ ACDAgentManager::ACDAgentManager(ACDServer* pAcdServer, int presenceMonitorPort,
}
else {
mPresenceServerEnabled = true;
OsSysLog::add(FAC_ACD, PRI_INFO, "ACDAgentManager::ACDAgentManager - Presence Server (%s) is enabled",
Os::Logger::instance().log(FAC_ACD, PRI_INFO, "ACDAgentManager::ACDAgentManager - Presence Server (%s) is enabled",
presenceServerUri.toString().data());
}
}
Expand Down Expand Up @@ -214,7 +214,7 @@ ACDAgent* ACDAgentManager::createACDAgent(const char* pAgentUriString,
// Create a mapping between the ACDAgent URI and the ACDAgent instance.
mAcdAgentList.insertKeyAndValue(new UtlString(pAgentUriString), pAgentRef);

OsSysLog::add(FAC_ACD, PRI_INFO, "ACDAgentManager::createACDAgent - Agent added: %s",
Os::Logger::instance().log(FAC_ACD, PRI_INFO, "ACDAgentManager::createACDAgent - Agent added: %s",
pAgentUriString);

mLock.release();
Expand Down Expand Up @@ -251,7 +251,7 @@ void ACDAgentManager::deleteACDAgent(const char* pAgentUriString)
pKey = mAcdAgentList.removeKeyAndValue(&searchUriKey, pAgentRef);
if (pKey == NULL) {
// Error. Did not find a matching ACDAgent object.
OsSysLog::add(FAC_ACD, PRI_ERR, "ACDAgentManager::deleteACDAgent - Failed to find reference to Agent: %s",
Os::Logger::instance().log(FAC_ACD, PRI_ERR, "ACDAgentManager::deleteACDAgent - Failed to find reference to Agent: %s",
pAgentUriString);
mLock.release();
return;
Expand All @@ -267,7 +267,7 @@ void ACDAgentManager::deleteACDAgent(const char* pAgentUriString)
// Finally delete the ACDAgent object.
delete pAgentRef;

OsSysLog::add(FAC_ACD, PRI_INFO, "ACDAgentManager::deleteACDAgent - Agent: %s deleted",
Os::Logger::instance().log(FAC_ACD, PRI_INFO, "ACDAgentManager::deleteACDAgent - Agent: %s deleted",
pAgentUriString);

mLock.release();
Expand Down Expand Up @@ -497,7 +497,7 @@ ProvisioningAttrList* ACDAgentManager::Create(ProvisioningAttrList& rRequestAttr
}

// Update the configuration file
OsSysLog::add(LOG_FACILITY, PRI_INFO, "ACDAgentManager::Create - Updating the config file");
Os::Logger::instance().log(LOG_FACILITY, PRI_INFO, "ACDAgentManager::Create - Updating the config file");
mpXmlConfigDoc->SaveFile();

mLock.release();
Expand Down Expand Up @@ -569,7 +569,7 @@ ProvisioningAttrList* ACDAgentManager::Delete(ProvisioningAttrList& rRequestAttr
deletePSInstance(ACD_AGENT_TAG, AGENT_URI_TAG, agentUriString);

// Update the configuration file
OsSysLog::add(LOG_FACILITY, PRI_INFO, "ACDAgentManager::Delete - Updating the config file");
Os::Logger::instance().log(LOG_FACILITY, PRI_INFO, "ACDAgentManager::Delete - Updating the config file");
mpXmlConfigDoc->SaveFile();

mLock.release();
Expand Down Expand Up @@ -705,7 +705,7 @@ ProvisioningAttrList* ACDAgentManager::Set(ProvisioningAttrList& rRequestAttribu
}

// Update the configuration file
OsSysLog::add(LOG_FACILITY, PRI_INFO, "ACDAgentManager::Set - Updating the config file");
Os::Logger::instance().log(LOG_FACILITY, PRI_INFO, "ACDAgentManager::Set - Updating the config file");
mpXmlConfigDoc->SaveFile();

mLock.release();
Expand Down
2 changes: 1 addition & 1 deletion sipXacd/src/ACDAgentMsg.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// SYSTEM INCLUDES
// APPLICATION INCLUDES
#include <os/OsDefs.h>
#include <os/OsSysLog.h>
#include <os/OsLogger.h>
#include <os/OsMsg.h>
#include <cp/LinePresenceBase.h>

Expand Down
12 changes: 6 additions & 6 deletions sipXacd/src/ACDAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ ACDAudio::ACDAudio(ACDAudioManager* pAcdAudioManager,
// Check to see if the file is already there
if (!OsFileSystem::exists(mAudioPath)) {
// No, attempt to download it
OsSysLog::add(FAC_ACD, PRI_INFO, "ACDAudio::ACDAudio - starting download of: %s", mUriString.data());
Os::Logger::instance().log(FAC_ACD, PRI_INFO, "ACDAudio::ACDAudio - starting download of: %s", mUriString.data());
start();
}
}
Expand Down Expand Up @@ -267,7 +267,7 @@ bool ACDAudio::getAudio(char*& prAudio, unsigned long& rLength)
// Loading failed, clean up
delete mpAudioBuffer;
mpAudioBuffer = false;
OsSysLog::add(FAC_ACD, PRI_ERR, "ACDAudio::getAudio - failed to load audio: %s", mAudioPath.data());
Os::Logger::instance().log(FAC_ACD, PRI_ERR, "ACDAudio::getAudio - failed to load audio: %s", mAudioPath.data());
return false;
}

Expand Down Expand Up @@ -446,7 +446,7 @@ int ACDAudio::compareTo(UtlContainable const* pInVal) const

int ACDAudio::run(void* pArg)
{
OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAudio::run - starting get from: %s", mUriString.data());
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAudio::run - starting get from: %s", mUriString.data());

HttpMessage *pGetRequest = new HttpMessage;

Expand All @@ -463,15 +463,15 @@ int ACDAudio::run(void* pArg)
const HttpBody* pResponseBody = pGetRequest->getBody();
pResponseBody->getBytes(&audioData, &audioLength);

OsSysLog::add(FAC_ACD, gACD_DEBUG, "ACDAudio::run - received %zd bytes from: %s\n",
Os::Logger::instance().log(FAC_ACD, gACD_DEBUG, "ACDAudio::run - received %zd bytes from: %s\n",
audioLength, mUriString.data());

// Now save the downloaded audio to a local file
size_t writeLength;

OsFile audioFile(mAudioPath);
if (audioFile.open(OsFile::CREATE) != OS_SUCCESS) {
OsSysLog::add(FAC_ACD, PRI_ERR, "ACDAudio::run - "
Os::Logger::instance().log(FAC_ACD, PRI_ERR, "ACDAudio::run - "
"Unable to create audio file: %s", mAudioPath.data());
}
else {
Expand All @@ -480,7 +480,7 @@ int ACDAudio::run(void* pArg)
}
}
else {
OsSysLog::add(FAC_ACD, PRI_ERR, "ACDAudio::run - failed get from: %s", mUriString.data());
Os::Logger::instance().log(FAC_ACD, PRI_ERR, "ACDAudio::run - failed get from: %s", mUriString.data());
}

delete pGetRequest;
Expand Down
Loading

0 comments on commit ef2d965

Please sign in to comment.