Adjusted debugging in MGCP, prevent log spamming.
git-svn-id: http://yate.null.ro/svn/yate/trunk@4212 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
4bc4db8ee7
commit
0d1c48aa8f
|
@ -69,14 +69,14 @@ MGCPPrivateThread::MGCPPrivateThread(MGCPEngine* engine, bool process,
|
|||
m_engine(engine),
|
||||
m_action(process?Process:Receive)
|
||||
{
|
||||
XDebug(m_engine,DebugInfo,"MGCPPrivateThread::MGCPPrivateThread() [%p]",this);
|
||||
DDebug(m_engine,DebugInfo,"MGCPPrivateThread::MGCPPrivateThread() [%p]",this);
|
||||
if (m_engine)
|
||||
m_engine->appendThread(this);
|
||||
}
|
||||
|
||||
MGCPPrivateThread::~MGCPPrivateThread()
|
||||
{
|
||||
XDebug(m_engine,DebugInfo,"MGCPPrivateThread::~MGCPPrivateThread() [%p]",this);
|
||||
DDebug(m_engine,DebugInfo,"MGCPPrivateThread::~MGCPPrivateThread() [%p]",this);
|
||||
if (m_engine)
|
||||
m_engine->removeThread(this);
|
||||
}
|
||||
|
@ -431,7 +431,7 @@ bool MGCPEngine::receive(unsigned char* buffer, SocketAddr& addr)
|
|||
new MGCPTransaction(this,msg,false,addr);
|
||||
continue;
|
||||
}
|
||||
DDebug(this,DebugNote,"Received response %d for unknown transaction %u",
|
||||
Debug(this,DebugNote,"Received response %d for unknown transaction %u",
|
||||
msg->code(),msg->transactionId());
|
||||
TelEngine::destruct(msg);
|
||||
}
|
||||
|
@ -569,16 +569,16 @@ void MGCPEngine::cleanup(bool gracefully, const char* text)
|
|||
return;
|
||||
|
||||
// Terminate private threads
|
||||
XDebug(this,DebugAll,"Terminating %u private threads",m_threads.count());
|
||||
Debug(this,DebugAll,"Terminating %u private threads",m_threads.count());
|
||||
lock();
|
||||
ListIterator iter(m_threads);
|
||||
for (GenObject* o = 0; 0 != (o = iter.get());)
|
||||
static_cast<MGCPPrivateThread*>(o)->cancel(!gracefully);
|
||||
unlock();
|
||||
XDebug(this,DebugAll,"Waiting for private threads to terminate");
|
||||
DDebug(this,DebugAll,"Waiting for private threads to terminate");
|
||||
while (m_threads.skipNull())
|
||||
Thread::yield();
|
||||
XDebug(this,DebugAll,"Private threads terminated");
|
||||
DDebug(this,DebugAll,"Private threads terminated");
|
||||
}
|
||||
|
||||
// Write data to socket
|
||||
|
|
|
@ -310,7 +310,7 @@ void MGCPTransaction::processMessage(MGCPMessage* msg)
|
|||
retrans = true;
|
||||
send(m_ack);
|
||||
}
|
||||
Debug(m_engine,(ok || retrans) ? DebugAll : DebugNote,
|
||||
DDebug(m_engine,(ok || retrans) ? DebugAll : DebugNote,
|
||||
"%s. Received %sresponse %d [%p]",m_debug.c_str(),
|
||||
ok?"":(retrans?"retransmission for ":"different "),msg->code(),this);
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ void MGCPTransaction::processMessage(MGCPMessage* msg)
|
|||
ok = (!m_response && !m_provisional);
|
||||
if (ok)
|
||||
m_provisional = msg;
|
||||
Debug(m_engine,(ok || m_response)? DebugAll : DebugNote,
|
||||
DDebug(m_engine,(ok || m_response)? DebugAll : DebugNote,
|
||||
"%s. Received %sprovisional response %d [%p]",m_debug.c_str(),
|
||||
ok?"":(m_response?"late ":"different "),msg->code(),this);
|
||||
}
|
||||
|
@ -474,8 +474,10 @@ MGCPEvent* MGCPTransaction::terminate()
|
|||
m_engine->removeTrans(this,false);
|
||||
if (m_timeout)
|
||||
Debug(m_engine,DebugNote,"%s. Timeout in state %u [%p]",m_debug.c_str(),state(),this);
|
||||
#ifdef DEBUG
|
||||
else
|
||||
DDebug(m_engine,DebugAll,"%s. Terminated in state %u [%p]",m_debug.c_str(),state(),this);
|
||||
Debug(m_engine,DebugAll,"%s. Terminated in state %u [%p]",m_debug.c_str(),state(),this);
|
||||
#endif
|
||||
MGCPEvent* event = new MGCPEvent(this);
|
||||
deref();
|
||||
return event;
|
||||
|
|
|
@ -391,7 +391,7 @@ bool YMGCPEngine::processEvent(MGCPTransaction* trans, MGCPMessage* msg, void* d
|
|||
MGCPWrapper* wrap = YOBJECT(MGCPWrapper,static_cast<GenObject*>(data));
|
||||
MGCPSpan* span = YOBJECT(MGCPSpan,static_cast<GenObject*>(data));
|
||||
MGCPCircuit* circ = YOBJECT(MGCPCircuit,static_cast<GenObject*>(data));
|
||||
Debug(this,DebugAll,"YMGCPEngine::processEvent(%p,%p,%p) wrap=%p span=%p circ=%p [%p]",
|
||||
DDebug(this,DebugAll,"YMGCPEngine::processEvent(%p,%p,%p) wrap=%p span=%p circ=%p [%p]",
|
||||
trans,msg,data,wrap,span,circ,this);
|
||||
if (!trans)
|
||||
return false;
|
||||
|
@ -566,7 +566,7 @@ MGCPWrapper::~MGCPWrapper()
|
|||
// Process incoming events for this wrapper
|
||||
bool MGCPWrapper::processEvent(MGCPTransaction* tr, MGCPMessage* mm)
|
||||
{
|
||||
Debug(&splugin,DebugAll,"MGCPWrapper::processEvent(%p,%p) [%p]",
|
||||
DDebug(&splugin,DebugAll,"MGCPWrapper::processEvent(%p,%p) [%p]",
|
||||
tr,mm,this);
|
||||
if (tr == m_tr) {
|
||||
if (!mm || (tr->msgResponse())) {
|
||||
|
@ -713,11 +713,13 @@ RefPointer<MGCPMessage> MGCPWrapper::sendSync(MGCPMessage* mm, const SocketAddr&
|
|||
Thread::idle();
|
||||
RefPointer<MGCPMessage> tmp = m_msg;
|
||||
m_msg = 0;
|
||||
if (tmp)
|
||||
Debug(&splugin,DebugNote,"MGCPWrapper::sendSync() returning %d '%s' [%p]",
|
||||
tmp->code(),tmp->comment().c_str(),this);
|
||||
else
|
||||
if (!tmp)
|
||||
Debug(&splugin,DebugMild,"MGCPWrapper::sendSync() returning NULL [%p]",this);
|
||||
#ifdef DEBUG
|
||||
else
|
||||
Debug(&splugin,DebugInfo,"MGCPWrapper::sendSync() returning %d '%s' [%p]",
|
||||
tmp->code(),tmp->comment().c_str(),this);
|
||||
#endif
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
@ -1428,11 +1430,13 @@ RefPointer<MGCPMessage> MGCPCircuit::sendSync(MGCPMessage* mm)
|
|||
Thread::idle();
|
||||
RefPointer<MGCPMessage> tmp = m_msg;
|
||||
m_msg = 0;
|
||||
if (tmp)
|
||||
Debug(&splugin,DebugNote,"MGCPCircuit::sendSync() returning %d '%s' [%p]",
|
||||
tmp->code(),tmp->comment().c_str(),this);
|
||||
else
|
||||
if (!tmp)
|
||||
Debug(&splugin,DebugMild,"MGCPCircuit::sendSync() returning NULL [%p]",this);
|
||||
#ifdef DEBUG
|
||||
else
|
||||
Debug(&splugin,DebugInfo,"MGCPCircuit::sendSync() returning %d '%s' [%p]",
|
||||
tmp->code(),tmp->comment().c_str(),this);
|
||||
#endif
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
@ -1760,7 +1764,7 @@ bool MGCPCircuit::sendEvent(SignallingCircuitEvent::Type type, NamedList* params
|
|||
// Process incoming events for this circuit
|
||||
bool MGCPCircuit::processEvent(MGCPTransaction* tr, MGCPMessage* mm)
|
||||
{
|
||||
Debug(&splugin,DebugAll,"MGCPCircuit::processEvent(%p,%p) [%p]",
|
||||
DDebug(&splugin,DebugAll,"MGCPCircuit::processEvent(%p,%p) [%p]",
|
||||
tr,mm,this);
|
||||
if (tr == m_tr) {
|
||||
if (!mm || (tr->msgResponse())) {
|
||||
|
|
Loading…
Reference in New Issue