From 70cb301bae1804632433b94813c90857f0cd59de Mon Sep 17 00:00:00 2001 From: rjongbloed Date: Wed, 4 Apr 2007 02:12:00 +0000 Subject: [PATCH] Reviewed and adjusted PTRACE log levels Now follows 1=error,2=warn,3=info,4+=debug --- src/codec/echocancel.cxx | 6 +- src/codec/opalpluginmgr.cxx | 24 ++-- src/codec/rfc2833.cxx | 10 +- src/codec/silencedetect.cxx | 6 +- src/h224/h224.cxx | 10 +- src/h224/h281.cxx | 23 +-- src/h323/channels.cxx | 20 +-- src/h323/gkclient.cxx | 28 ++-- src/h323/gkserver.cxx | 40 +++--- src/h323/h235auth.cxx | 10 +- src/h323/h235auth1.cxx | 14 +- src/h323/h323.cxx | 106 +++++++------- src/h323/h323caps.cxx | 6 +- src/h323/h323ep.cxx | 18 ++- src/h323/h323neg.cxx | 28 ++-- src/h323/h323rtp.cxx | 6 +- src/h323/h323trans.cxx | 24 ++-- src/h323/h450pdu.cxx | 12 +- src/h323/peclient.cxx | 30 ++-- src/h323/svcctrl.cxx | 8 +- src/lids/lid.cxx | 22 +-- src/lids/lidep.cxx | 29 ++-- src/opal/call.cxx | 6 +- src/opal/connection.cxx | 28 ++-- src/opal/endpoint.cxx | 8 +- src/opal/ivr.cxx | 14 +- src/opal/manager.cxx | 14 +- src/opal/mediastrm.cxx | 6 +- src/opal/patch.cxx | 20 +-- src/opal/pcss.cxx | 14 +- src/opal/transports.cxx | 16 ++- src/rtp/jitter.cxx | 16 ++- src/rtp/rtp.cxx | 340 +++++++++++++++++++++++--------------------- src/sip/sdp.cxx | 74 +++++----- src/sip/sipcon.cxx | 74 +++++----- src/sip/sipep.cxx | 36 ++--- src/sip/sippdu.cxx | 28 ++-- 37 files changed, 667 insertions(+), 507 deletions(-) diff --git a/src/codec/echocancel.cxx b/src/codec/echocancel.cxx index 2fe96ac0..7bd7d7bf 100644 --- a/src/codec/echocancel.cxx +++ b/src/codec/echocancel.cxx @@ -23,6 +23,10 @@ * Contributor(s): Miguel Rodriguez Perez. * * $Log$ + * Revision 1.19 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 1.18 2006/02/04 14:27:18 dsandras * Fixed leak. * @@ -133,7 +137,7 @@ OpalEchoCanceler::OpalEchoCanceler() mean = 0; clockRate = 8000; - PTRACE(3, "Echo Canceler\tHandler created"); + PTRACE(4, "Echo Canceler\tHandler created"); } diff --git a/src/codec/opalpluginmgr.cxx b/src/codec/opalpluginmgr.cxx index dd122bfd..84dab309 100644 --- a/src/codec/opalpluginmgr.cxx +++ b/src/codec/opalpluginmgr.cxx @@ -25,6 +25,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.20 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.19 2007/04/02 05:51:33 rjongbloed * Tidied some trace logs to assure all have a category (bit before a tab character) set. * @@ -1692,14 +1696,14 @@ void OpalPluginCodecManager::OnLoadPlugin(PDynaLink & dll, INT code) { PluginCodec_GetCodecFunction getCodecs; if (!dll.GetFunction(PString(signatureFunctionName), (PDynaLink::Function &)getCodecs)) { - PTRACE(3, "OpalPlugin\nPlugin Codec DLL " << dll.GetName() << " is not a plugin codec"); + PTRACE(2, "OpalPlugin\nPlugin Codec DLL " << dll.GetName() << " is not a plugin codec"); return; } unsigned int count; PluginCodec_Definition * codecs = (*getCodecs)(&count, PLUGIN_CODEC_VERSION_FAX); if (codecs == NULL || count == 0) { - PTRACE(3, "OpalPlugin\nPlugin Codec DLL " << dll.GetName() << " contains no codec definitions"); + PTRACE(1, "OpalPlugin\nPlugin Codec DLL " << dll.GetName() << " contains no codec definitions"); return; } @@ -1730,7 +1734,7 @@ void OpalPluginCodecManager::RegisterStaticCodec( unsigned int count; PluginCodec_Definition * codecs = (*getCodecFn)(&count, PLUGIN_CODEC_VERSION_FAX); if (codecs == NULL || count == 0) { - PTRACE(3, "OpalPlugin\nStatic codec " << name << " contains no codec definitions"); + PTRACE(1, "OpalPlugin\nStatic codec " << name << " contains no codec definitions"); return; } @@ -1795,7 +1799,7 @@ void OpalPluginCodecManager::RegisterCodecPlugins(unsigned int count, void * _co RegisterPluginPair(&encoder, &decoder); found = TRUE; - PTRACE(2, "OpalPlugin\nPlugin codec " << encoder.descr << " defined"); + PTRACE(3, "OpalPlugin\nPlugin codec " << encoder.descr << " defined"); break; } } @@ -1865,12 +1869,12 @@ void OpalPluginCodecManager::RegisterPluginPair( // add the media format if (defaultSessionID == 0) { - PTRACE(3, "OpalPlugin\nCodec DLL provides unknown media format " << (int)(encoderCodec->flags & PluginCodec_MediaTypeMask)); + PTRACE(1, "OpalPlugin\nCodec DLL provides unknown media format " << (int)(encoderCodec->flags & PluginCodec_MediaTypeMask)); } else { PString fmtName = CreateCodecName(encoderCodec, FALSE); OpalMediaFormat existingFormat(fmtName); if (existingFormat.IsValid() && existingFormat.GetCodecBaseTime() >= timeStamp) { - PTRACE(3, "OpalPlugin\nNewer media format " << fmtName << " already exists"); + PTRACE(2, "OpalPlugin\nNewer media format " << fmtName << " already exists"); //AddFormat(existingFormat); } else { if (existingFormat.IsValid()) { @@ -1998,7 +2002,7 @@ void OpalPluginCodecManager::RegisterPluginPair( } else { - PTRACE(3, "OpalPlugin\nAudio plugin defines unsupported clock rate " << encoderCodec->sampleRate); + PTRACE(1, "OpalPlugin\nAudio plugin defines unsupported clock rate " << encoderCodec->sampleRate); } break; case PluginCodec_MediaTypeAudioStreamed: @@ -2013,7 +2017,7 @@ void OpalPluginCodecManager::RegisterPluginPair( } else { - PTRACE(3, "OpalPlugin\nAudio plugin defines unsupported clock rate " << encoderCodec->sampleRate); + PTRACE(1, "OpalPlugin\nAudio plugin defines unsupported clock rate " << encoderCodec->sampleRate); } break; #endif @@ -2033,7 +2037,7 @@ void OpalPluginCodecManager::RegisterPluginPair( if (encoderCodec->h323CapabilityType == PluginCodec_H323Codec_NoH323 || (hasCodecControl && (retVal == 0)) ) { - PTRACE(3, "OpalPlugin\nNot adding H.323 capability for plugin codec " << encoderCodec->destFormat << " as this has been specifically disabled"); + PTRACE(2, "OpalPlugin\nNot adding H.323 capability for plugin codec " << encoderCodec->destFormat << " as this has been specifically disabled"); return; } @@ -2068,7 +2072,7 @@ void OpalPluginCodecManager::RegisterCapability(PluginCodec_Definition * encoder } if (map == NULL) { - PTRACE(3, "OpalPlugin\nCannot create capability for unknown plugin codec media format " << (int)(encoderCodec->flags & PluginCodec_MediaTypeMask)); + PTRACE(1, "OpalPlugin\nCannot create capability for unknown plugin codec media format " << (int)(encoderCodec->flags & PluginCodec_MediaTypeMask)); } else if (encoderCodec->h323CapabilityType != PluginCodec_H323Codec_undefined) { for (PINDEX i = 0; map[i].pluginCapType >= 0; i++) { diff --git a/src/codec/rfc2833.cxx b/src/codec/rfc2833.cxx index ac815637..8908acdc 100644 --- a/src/codec/rfc2833.cxx +++ b/src/codec/rfc2833.cxx @@ -23,6 +23,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.5 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.4 2007/03/12 23:36:31 csoutheren * Add support for Cisco NSE * @@ -79,7 +83,7 @@ OpalRFC2833Proto::OpalRFC2833Proto(const PNotifier & rx) #pragma warning(default:4355) #endif { - PTRACE(3, "RFC2833\tHandler created"); + PTRACE(4, "RFC2833\tHandler created"); payloadType = RTP_DataFrame::IllegalPayloadType; receiveComplete = TRUE; @@ -160,7 +164,7 @@ void OpalRFC2833Proto::ReceivedPacket(RTP_DataFrame & frame, INT) PWaitAndSignal m(mutex); if (frame.GetPayloadSize() < 4) { - PTRACE(1, "RFC2833\tIgnoring packet, too small."); + PTRACE(2, "RFC2833\tIgnoring packet, too small."); return; } @@ -192,7 +196,7 @@ void OpalRFC2833Proto::ReceivedPacket(RTP_DataFrame & frame, INT) } if ((payload[1]&0x80) == 0) { - PTRACE(1, "RFC2833\tIgnoring packet, not end of event."); + PTRACE(2, "RFC2833\tIgnoring packet, not end of event."); return; } diff --git a/src/codec/silencedetect.cxx b/src/codec/silencedetect.cxx index d62b9339..4e4b724e 100644 --- a/src/codec/silencedetect.cxx +++ b/src/codec/silencedetect.cxx @@ -23,6 +23,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 1.5 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 1.4 2005/07/09 06:52:39 rjongbloed * Added print (operator<<) of silence detect mode enum. * @@ -91,7 +95,7 @@ OpalSilenceDetector::OpalSilenceDetector() // Initialise the adaptive threshold variables. SetParameters(param); - PTRACE(3, "Silence\tHandler created"); + PTRACE(4, "Silence\tHandler created"); } diff --git a/src/h224/h224.cxx b/src/h224/h224.cxx index aa4ed055..01fe3525 100644 --- a/src/h224/h224.cxx +++ b/src/h224/h224.cxx @@ -19,6 +19,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 1.6 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 1.5 2007/04/02 05:51:33 rjongbloed * Tidied some trace logs to assure all have a category (bit before a tab character) set. * @@ -606,7 +610,7 @@ void OpalH224Handler::TransmitFrame(H224_Frame & frame) PINDEX size = frame.GetEncodedSize(); if(!frame.Encode(transmitFrame->GetPayloadPtr(), size, transmitBitIndex)) { - PTRACE(2, "H.224\tFailed to encode frame"); + PTRACE(1, "H.224\tFailed to encode frame"); return; } @@ -619,7 +623,7 @@ void OpalH224Handler::TransmitFrame(H224_Frame & frame) transmitFrame->SetMarker(TRUE); if(!session->WriteData(*transmitFrame)) { - PTRACE(2, "H.224\tFailed to write encoded frame"); + PTRACE(1, "H.224\tFailed to write encoded frame"); } } @@ -662,7 +666,7 @@ void OpalH224ReceiverThread::Main() return; } } else { - PTRACE(2, "H.224\tDecoding of frame failed"); + PTRACE(1, "H.224\tDecoding of frame failed"); } inUse.Signal(); diff --git a/src/h224/h281.cxx b/src/h224/h281.cxx index 47d81b26..5cf38892 100644 --- a/src/h224/h281.cxx +++ b/src/h224/h281.cxx @@ -19,6 +19,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 1.7 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 1.6 2007/04/02 05:51:33 rjongbloed * Tidied some trace logs to assure all have a category (bit before a tab character) set. * @@ -732,18 +736,17 @@ void OpalH281Handler::OnReceivedMessage(const H281_Frame & message) OnStopAction(); } - } else if(requestType == H281_Frame::SelectVideoSource) { - OnSelectVideoSource(message.GetVideoSourceNumber(), - message.GetVideoMode()); - - } else if(requestType == H281_Frame::StoreAsPreset) { + } else if(requestType == H281_Frame::SelectVideoSource) { + OnSelectVideoSource(message.GetVideoSourceNumber(), message.GetVideoMode()); + + } else if(requestType == H281_Frame::StoreAsPreset) { OnStoreAsPreset(message.GetPresetNumber()); - + } else if(requestType == H281_Frame::ActivatePreset) { - OnActivatePreset(message.GetPresetNumber()); - - } else { - PTRACE(3, "H.281\tUnknown Request: " << requestType); + OnActivatePreset(message.GetPresetNumber()); + + } else { + PTRACE(2, "H.281\tUnknown Request: " << requestType); } } diff --git a/src/h323/channels.cxx b/src/h323/channels.cxx index e2361436..93535253 100644 --- a/src/h323/channels.cxx +++ b/src/h323/channels.cxx @@ -27,6 +27,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.39 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.38 2007/03/29 05:16:49 csoutheren * Pass OpalConnection to OpalMediaSream constructor * Add ID to OpalMediaStreams so that transcoders can match incoming and outgoing codecs @@ -752,7 +756,7 @@ void H323Channel::Close() // Signal to the connection that this channel is on the way out connection.OnClosedLogicalChannel(*this); - PTRACE(3, "LogChan\tCleaned up " << number); + PTRACE(4, "LogChan\tCleaned up " << number); } @@ -914,7 +918,7 @@ void H323UnidirectionalChannel::Close() if (terminating) return; - PTRACE(3, "H323RTP\tCleaning up media stream on " << number); + PTRACE(4, "H323RTP\tCleaning up media stream on " << number); // If we have source media stream close it if (mediaStream != NULL) @@ -1103,7 +1107,7 @@ void H323_RealTimeChannel::OnSendOpenAck(const H245_OpenLogicalChannel & open, OnSendOpenAck(param); - PTRACE(2, "H323RTP\tSending open logical channel ACK: sessionID=" << sessionID); + PTRACE(3, "H323RTP\tSending open logical channel ACK: sessionID=" << sessionID); } @@ -1163,7 +1167,7 @@ BOOL H323_RealTimeChannel::OnReceivedAckPDU(const H245_OpenLogicalChannelAck & a BOOL H323_RealTimeChannel::SetDynamicRTPPayloadType(int newType) { - PTRACE(1, "H323RTP\tSetting dynamic RTP payload type: " << newType); + PTRACE(4, "H323RTP\tAttempting to set dynamic RTP payload type: " << newType); // This is "no change" if (newType == -1) @@ -1178,7 +1182,7 @@ BOOL H323_RealTimeChannel::SetDynamicRTPPayloadType(int newType) return FALSE; rtpPayloadType = (RTP_DataFrame::PayloadTypes)newType; - PTRACE(3, "H323RTP\tSetting dynamic payload type to " << rtpPayloadType); + PTRACE(3, "H323RTP\tSet dynamic payload type to " << rtpPayloadType); return TRUE; } @@ -1427,7 +1431,7 @@ BOOL H323_ExternalRTPChannel::OnReceivedPDU(const H245_H2250LogicalChannelParame BOOL H323_ExternalRTPChannel::OnReceivedAckPDU(const H245_H2250LogicalChannelAckParameters & param) { if (param.HasOptionalField(H245_H2250LogicalChannelAckParameters::e_sessionID) && (param.m_sessionID != sessionID)) { - PTRACE(1, "LogChan\twarning: Ack for invalid session: " << param.m_sessionID); + PTRACE(2, "LogChan\tAck for invalid session: " << param.m_sessionID); } @@ -1522,7 +1526,7 @@ void H323DataChannel::Close() if (terminating) return; - PTRACE(3, "LogChan\tCleaning up data channel " << number); + PTRACE(4, "LogChan\tCleaning up data channel " << number); // Break any I/O blocks and wait for the thread that uses this object to // terminate before we allow it to be deleted. @@ -1629,7 +1633,7 @@ BOOL H323DataChannel::OnReceivedPDU(const H245_OpenLogicalChannel & open, if (separateReverseChannel && open.HasOptionalField(H245_OpenLogicalChannel::e_reverseLogicalChannelParameters)) { errorCode = H245_OpenLogicalChannelReject_cause::e_unsuitableReverseParameters; - PTRACE(2, "LogChan\tOnReceivedPDU has unexpected reverse parameters"); + PTRACE(1, "LogChan\tOnReceivedPDU has unexpected reverse parameters"); return FALSE; } diff --git a/src/h323/gkclient.cxx b/src/h323/gkclient.cxx index a04d8c29..6c258b71 100644 --- a/src/h323/gkclient.cxx +++ b/src/h323/gkclient.cxx @@ -27,6 +27,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.37 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.36 2007/04/02 05:51:33 rjongbloed * Tidied some trace logs to assure all have a category (bit before a tab character) set. * @@ -810,7 +814,7 @@ BOOL H323Gatekeeper::StartDiscovery(const H323TransportAddress & initialAddress) /// don't send GRQ if not requested if (!endpoint.GetSendGRQ() && !initialAddress.IsEmpty()) { StartChannel(); - PTRACE(2, "RAS\tSkipping gatekeeper discovery for " << initialAddress); + PTRACE(3, "RAS\tSkipping gatekeeper discovery for " << initialAddress); return TRUE; } @@ -840,7 +844,7 @@ BOOL H323Gatekeeper::StartDiscovery(const H323TransportAddress & initialAddress) transport->EndConnect(transport->GetLocalAddress()); if (discoveryComplete) { - PTRACE(2, "RAS\tGatekeeper discovered at: " + PTRACE(3, "RAS\tGatekeeper discovered at: " << transport->GetRemoteAddress() << " (if=" << transport->GetLocalAddress() << ')'); StartChannel(); @@ -920,7 +924,7 @@ BOOL H323Gatekeeper::OnReceiveGatekeeperConfirm(const H225_GatekeeperConfirm & g } H323TransportAddress locatedAddress(gcf.m_rasAddress, "udp"); - PTRACE(2, "RAS\tGatekeeper discovery found " << locatedAddress); + PTRACE(3, "RAS\tGatekeeper discovery found " << locatedAddress); if (!transport->SetRemoteAddress(locatedAddress)) { PTRACE(2, "RAS\tInvalid gatekeeper discovery address: \"" << locatedAddress << '"'); @@ -1162,7 +1166,7 @@ BOOL H323Gatekeeper::OnReceiveRegistrationConfirm(const H225_RegistrationConfirm } } for (i = 0; i < aliasesToChange.GetSize(); i++) { - PTRACE(2, "RAS\tGatekeeper add of alias \"" << aliasesToChange[i] << '"'); + PTRACE(3, "RAS\tGatekeeper add of alias \"" << aliasesToChange[i] << '"'); endpoint.AddAliasName(aliasesToChange[i]); } @@ -1177,7 +1181,7 @@ BOOL H323Gatekeeper::OnReceiveRegistrationConfirm(const H225_RegistrationConfirm aliasesToChange.AppendString(currentAliases[i]); } for (i = 0; i < aliasesToChange.GetSize(); i++) { - PTRACE(2, "RAS\tGatekeeper removal of alias \"" << aliasesToChange[i] << '"'); + PTRACE(3, "RAS\tGatekeeper removal of alias \"" << aliasesToChange[i] << '"'); endpoint.RemoveAliasName(aliasesToChange[i]); } } @@ -1218,7 +1222,7 @@ void H323Gatekeeper::RegistrationTimeToLive() PTRACE(3, "RAS\tTime To Live reregistration"); if (requiresDiscovery) { - PTRACE(2, "RAS\tRepeating discovery on gatekeepers request."); + PTRACE(3, "RAS\tRepeating discovery on gatekeepers request."); H323RasPDU pdu; Request request(SetupGatekeeperRequest(pdu), pdu); @@ -1324,16 +1328,16 @@ BOOL H323Gatekeeper::OnReceiveUnregistrationRequest(const H225_UnregistrationReq if (!H225_RAS::OnReceiveUnregistrationRequest(urq)) return FALSE; - PTRACE(2, "RAS\tUnregistration received"); + PTRACE(3, "RAS\tUnregistration received"); if (!urq.HasOptionalField(H225_UnregistrationRequest::e_gatekeeperIdentifier) || urq.m_gatekeeperIdentifier.GetValue() != gatekeeperIdentifier) { - PTRACE(1, "RAS\tInconsistent gatekeeperIdentifier!"); + PTRACE(2, "RAS\tInconsistent gatekeeperIdentifier!"); return FALSE; } if (!urq.HasOptionalField(H225_UnregistrationRequest::e_endpointIdentifier) || urq.m_endpointIdentifier.GetValue() != endpointIdentifier) { - PTRACE(1, "RAS\tInconsistent endpointIdentifier!"); + PTRACE(2, "RAS\tInconsistent endpointIdentifier!"); return FALSE; } @@ -1351,7 +1355,7 @@ BOOL H323Gatekeeper::OnReceiveUnregistrationRequest(const H225_UnregistrationReq BOOL ok = WritePDU(response); if (autoReregister) { - PTRACE(3, "RAS\tReregistering by setting timeToLive"); + PTRACE(4, "RAS\tReregistering by setting timeToLive"); reregisterNow = TRUE; monitorTickle.Signal(); } @@ -2235,7 +2239,7 @@ void H323Gatekeeper::SetPassword(const PString & password, void H323Gatekeeper::MonitorMain(PThread &, INT) { - PTRACE(3, "RAS\tBackground thread started"); + PTRACE(4, "RAS\tBackground thread started"); for (;;) { monitorTickle.Wait(); @@ -2254,7 +2258,7 @@ void H323Gatekeeper::MonitorMain(PThread &, INT) } } - PTRACE(3, "RAS\tBackground thread ended"); + PTRACE(4, "RAS\tBackground thread ended"); } diff --git a/src/h323/gkserver.cxx b/src/h323/gkserver.cxx index d9db6069..7c6b40aa 100644 --- a/src/h323/gkserver.cxx +++ b/src/h323/gkserver.cxx @@ -27,6 +27,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.21 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.20 2006/08/21 05:29:25 csoutheren * Messy but relatively simple change to add support for secure (SSL/TLS) TCP transport * and secure H.323 signalling via the sh323 URL scheme @@ -814,7 +818,7 @@ H323GatekeeperGRQ::H323GatekeeperGRQ(H323GatekeeperListener & rasChannel, } else { isBehindNAT = TRUE; - PTRACE(3, "RAS\tUnsuitable RAS address in GRQ, using " << replyAddresses[0]); + PTRACE(2, "RAS\tUnsuitable RAS address in GRQ, using " << replyAddresses[0]); } } @@ -1740,13 +1744,13 @@ BOOL H323GatekeeperCall::Disengage(int reason) if (drqReceived) { UnlockReadWrite(); - PTRACE(1, "RAS\tAlready disengaged call " << *this); + PTRACE(2, "RAS\tAlready disengaged call " << *this); return FALSE; } drqReceived = TRUE; - PTRACE(2, "RAS\tDisengage of call " << *this); + PTRACE(3, "RAS\tDisengage of call " << *this); UnlockReadWrite(); @@ -1840,7 +1844,7 @@ H323GatekeeperRequest::Response H323GatekeeperCall::OnInfoResponse(H323Gatekeepe { PTRACE_BLOCK("H323GatekeeperCall::OnInfoResponse"); - PTRACE(2, "RAS\tIRR received for call " << *this); + PTRACE(3, "RAS\tIRR received for call " << *this); if (!LockReadWrite()) { PTRACE(1, "RAS\tIRR rejected, lock failed on call " << *this); @@ -1923,7 +1927,7 @@ BOOL H323GatekeeperCall::OnHeartbeat() UnlockReadOnly(); // Do IRQ and wait for IRR on call - PTRACE(2, "RAS\tTimeout on heartbeat, doing IRQ for call "<< *this); + PTRACE(3, "RAS\tTimeout on heartbeat, doing IRQ for call "<< *this); if (!rasChannel->InfoRequest(*endpoint, this)) return FALSE; @@ -2137,7 +2141,7 @@ H323RegisteredEndPoint::H323RegisteredEndPoint(H323GatekeeperServer & gk, { activeCalls.DisallowDeleteObjects(); - PTRACE(3, "RAS\tCreated registered endpoint: " << id); + PTRACE(4, "RAS\tCreated registered endpoint: " << id); } @@ -2756,14 +2760,14 @@ H323GatekeeperListener::H323GatekeeperListener(H323EndPoint & ep, transport->SetPromiscuous(H323Transport::AcceptFromAny); - PTRACE(2, "H323gk\tGatekeeper server created."); + PTRACE(4, "H323gk\tGatekeeper server created."); } H323GatekeeperListener::~H323GatekeeperListener() { StopChannel(); - PTRACE(2, "H323gk\tGatekeeper server destroyed."); + PTRACE(4, "H323gk\tGatekeeper server destroyed."); } @@ -3487,7 +3491,7 @@ H323GatekeeperRequest::Response H323GatekeeperServer::OnRegistration(H323Gatekee // Have successfully registered, save it AddEndPoint(info.endpoint); - PTRACE(2, "RAS\tRRQ accepted: \"" << *info.endpoint << '"'); + PTRACE(3, "RAS\tRRQ accepted: \"" << *info.endpoint << '"'); return H323GatekeeperRequest::Confirm; } @@ -3523,7 +3527,7 @@ H323GatekeeperRequest::Response H323GatekeeperServer::OnUnregistration(H323Gatek info.endpoint->GetAliases(), info.endpoint->GetSignalAddresses()); } else { - PTRACE(2, "RAS\tRemoving endpoint " << *info.endpoint << " with no aliases"); + PTRACE(3, "RAS\tRemoving endpoint " << *info.endpoint << " with no aliases"); RemoveEndPoint(info.endpoint); // will also remove descriptor if required } } @@ -3820,7 +3824,7 @@ H323GatekeeperRequest::Response H323GatekeeperServer::OnAdmission(H323Gatekeeper peakCalls = activeCalls.GetSize(); totalCalls++; - PTRACE(2, "RAS\tAdded new call (total=" << activeCalls.GetSize() << ") " << *newCall); + PTRACE(3, "RAS\tAdded new call (total=" << activeCalls.GetSize() << ") " << *newCall); mutex.Signal(); AddCall(oldCall); @@ -3942,7 +3946,7 @@ void H323GatekeeperServer::RemoveCall(H323GatekeeperCall * call) call->SetBandwidthUsed(0); PAssert(call->GetEndPoint().RemoveCall(call), PLogicError); - PTRACE(2, "RAS\tRemoved call (total=" << (activeCalls.GetSize()-1) << ") id=" << *call); + PTRACE(3, "RAS\tRemoved call (total=" << (activeCalls.GetSize()-1) << ") id=" << *call); PAssert(activeCalls.Remove(call), PLogicError); } @@ -4001,7 +4005,7 @@ H323GatekeeperRequest::Response H323GatekeeperServer::OnLocation(H323GatekeeperL if (ep != NULL) { ep->GetSignalAddress(0).SetPDU(info.lcf.m_callSignalAddress); ep->GetRASAddress(0).SetPDU(info.lcf.m_rasAddress); - PTRACE(2, "RAS\tLocation of " << H323GetAliasAddressString(info.lrq.m_destinationInfo[i]) + PTRACE(3, "RAS\tLocation of " << H323GetAliasAddressString(info.lrq.m_destinationInfo[i]) << " is endpoint " << *ep); return H323GatekeeperRequest::Confirm; } @@ -4020,7 +4024,7 @@ H323GatekeeperRequest::Response H323GatekeeperServer::OnLocation(H323GatekeeperL if (info.lcf.m_destinationInfo.GetSize() > 0) info.lcf.IncludeOptionalField(H225_LocationConfirm::e_destinationInfo); - PTRACE(2, "RAS\tLocation of " << H323GetAliasAddressString(info.lrq.m_destinationInfo[i]) + PTRACE(3, "RAS\tLocation of " << H323GetAliasAddressString(info.lrq.m_destinationInfo[i]) << " is " << address); return H323GatekeeperRequest::Confirm; } @@ -4044,7 +4048,7 @@ BOOL H323GatekeeperServer::TranslateAliasAddress(const H225_AliasAddress & alias // if AccessRequest returns OK, but no aliases, then all of the aliases // must have been wildcards. In this case, add the original aliase back into the list if (aliases.GetSize() == 0) { - PTRACE(1, "RAS\tAdding original alias to the top of the alias list"); + PTRACE(3, "RAS\tAdding original alias to the top of the alias list"); aliases.SetSize(1); aliases[0] = alias; } @@ -4072,14 +4076,14 @@ BOOL H323GatekeeperServer::TranslateAliasAddressToSignalAddress(const H225_Alias if (isGatekeeperRouted) { const H323ListenerList & listeners = ownerEndPoint.GetListeners(); address = listeners[0].GetTransportAddress(); - PTRACE(2, "RAS\tTranslating alias " << aliasString << " to " << address << ", gatekeeper routed"); + PTRACE(3, "RAS\tTranslating alias " << aliasString << " to " << address << ", gatekeeper routed"); return TRUE; } PSafePtr ep = FindEndPointByAliasAddress(alias, PSafeReadOnly); if (ep != NULL) { address = ep->GetSignalAddress(0); - PTRACE(2, "RAS\tTranslating alias " << aliasString << " to " << address << ", registered endpoint"); + PTRACE(3, "RAS\tTranslating alias " << aliasString << " to " << address << ", registered endpoint"); return TRUE; } @@ -4099,7 +4103,7 @@ BOOL H323GatekeeperServer::TranslateAliasAddressToSignalAddress(const H225_Alias } address = H323TransportAddress(ip, port); - PTRACE(2, "RAS\tTranslating alias " << aliasString << " to " << address << ", host name"); + PTRACE(3, "RAS\tTranslating alias " << aliasString << " to " << address << ", host name"); return TRUE; } diff --git a/src/h323/h235auth.cxx b/src/h323/h235auth.cxx index cc22ebec..5313eedb 100644 --- a/src/h323/h235auth.cxx +++ b/src/h323/h235auth.cxx @@ -24,6 +24,10 @@ * Contributor(s): __________________________________ * * $Log$ + * Revision 2.13 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.12 2006/07/28 10:41:50 rjongbloed * Fixed DevStudio 2005 warnings on time_t conversions. * @@ -678,7 +682,7 @@ H235Authenticator::ValidationResult !clearToken.HasOptionalField(H235_ClearToken::e_timeStamp) || !clearToken.HasOptionalField(H235_ClearToken::e_random) || !clearToken.HasOptionalField(H235_ClearToken::e_challenge)) { - PTRACE(2, "H235RAS\tCAT requires generalID, timeStamp, random and challenge fields"); + PTRACE(1, "H235RAS\tCAT requires generalID, timeStamp, random and challenge fields"); return e_Error; } @@ -712,7 +716,7 @@ H235Authenticator::ValidationResult int randomInt = clearToken.m_random; if (randomInt < -127 || randomInt > 255) { - PTRACE(2, "H235RAS\tCAT requires single byte random field, got " << randomInt); + PTRACE(1, "H235RAS\tCAT requires single byte random field, got " << randomInt); return e_Error; } @@ -728,7 +732,7 @@ H235Authenticator::ValidationResult stomach.Complete(digest); if (clearToken.m_challenge.GetValue().GetSize() != sizeof(digest)) { - PTRACE(2, "H235RAS\tCAT requires 16 byte challenge field"); + PTRACE(1, "H235RAS\tCAT requires 16 byte challenge field"); return e_Error; } diff --git a/src/h323/h235auth1.cxx b/src/h323/h235auth1.cxx index 8e651094..121a3801 100644 --- a/src/h323/h235auth1.cxx +++ b/src/h323/h235auth1.cxx @@ -24,6 +24,10 @@ * Contributor(s): Fürbass Franz * * $Log$ + * Revision 2.12 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.11 2006/07/28 10:41:50 rjongbloed * Fixed DevStudio 2005 warnings on time_t conversions. * @@ -337,7 +341,7 @@ BOOL H235AuthProcedure1::Finalise(PBYTEArray & rawPDU) if (foundat == -1) { //Can't find the search pattern in the ASN1 packet. - PTRACE(2, "H235RAS\tPDU not prepared for H235AuthProcedure1"); + PTRACE(1, "H235RAS\tPDU not prepared for H235AuthProcedure1"); return FALSE; } @@ -439,7 +443,7 @@ H235Authenticator::ValidationResult H235AuthProcedure1::ValidateCryptoToken( if (lastTimestamp == crHashed.m_hashedVals.m_timeStamp && lastRandomSequenceNumber == crHashed.m_hashedVals.m_random) { //a message with this timespamp and the same random number was already verified - PTRACE(1, "H235RAS\tConsecutive messages with the same random and timestamp"); + PTRACE(2, "H235RAS\tConsecutive messages with the same random and timestamp"); return e_ReplyAttack; } @@ -483,7 +487,7 @@ H235Authenticator::ValidationResult H235AuthProcedure1::ValidateCryptoToken( BYTE RV[HASH_SIZE]; if (crHashed.m_token.m_hash.GetSize() != HASH_SIZE*8) { - PTRACE(2, "H235RAS\tH235AuthProcedure1 requires a hash!"); + PTRACE(1, "H235RAS\tH235AuthProcedure1 requires a hash!"); return e_Error; } @@ -517,7 +521,7 @@ H235Authenticator::ValidationResult H235AuthProcedure1::ValidateCryptoToken( if (foundat != 0) break; - PTRACE(2, "H235RAS\tH235AuthProcedure1 could not locate embedded hash!"); + PTRACE(1, "H235RAS\tH235AuthProcedure1 could not locate embedded hash!"); return e_Error; } @@ -548,7 +552,7 @@ H235Authenticator::ValidationResult H235AuthProcedure1::ValidateCryptoToken( foundat++; } - PTRACE(1, "H235RAS\tH235AuthProcedure1 hash does not match."); + PTRACE(2, "H235RAS\tH235AuthProcedure1 hash does not match."); return e_BadPassword; } diff --git a/src/h323/h323.cxx b/src/h323/h323.cxx index 86469925..3e65779e 100644 --- a/src/h323/h323.cxx +++ b/src/h323/h323.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.147 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.146 2007/04/02 05:51:33 rjongbloed * Tidied some trace logs to assure all have a category (bit before a tab character) set. * @@ -487,7 +491,7 @@ H323Connection::~H323Connection() delete progressPDU; delete holdMediaChannel; - PTRACE(3, "H323\tConnection " << callToken << " deleted."); + PTRACE(4, "H323\tConnection " << callToken << " deleted."); } void H323Connection::OnReleased() @@ -500,14 +504,14 @@ void H323Connection::OnReleased() void H323Connection::CleanUpOnCallEnd() { - PTRACE(3, "H323\tConnection " << callToken << " closing: connectionState=" << connectionState); + PTRACE(4, "H323\tConnection " << callToken << " closing: connectionState=" << connectionState); connectionState = ShuttingDownConnection; if (!callEndTime.IsValid()) callEndTime = PTime(); - PTRACE(2, "H225\tSending release complete PDU: callRef=" << callReference); + PTRACE(3, "H225\tSending release complete PDU: callRef=" << callReference); H323SignalPDU rcPDU; rcPDU.BuildReleaseComplete(*this); #if OPAL_H450 @@ -566,7 +570,7 @@ void H323Connection::CleanUpOnCallEnd() // Wait a while for the remote to send an endSession PTRACE(4, "H323\tAwaiting end session from remote for " << waitTime << " seconds"); if (!endSessionReceived.Wait(waitTime)) { - PTRACE(3, "H323\tDid not receive an end session from remote."); + PTRACE(2, "H323\tDid not receive an end session from remote."); } } @@ -580,7 +584,7 @@ void H323Connection::CleanUpOnCallEnd() if (signallingChannel != NULL) signallingChannel->CloseWait(); - PTRACE(1, "H323\tConnection " << callToken << " terminated."); + PTRACE(3, "H323\tConnection " << callToken << " terminated."); } @@ -638,7 +642,7 @@ void H323Connection::HandleSignallingChannel() { PAssert(signallingChannel != NULL, PLogicError); - PTRACE(2, "H225\tReading PDUs: callRef=" << callReference); + PTRACE(3, "H225\tReading PDUs: callRef=" << callReference); while (signallingChannel->IsOpen()) { H323SignalPDU pdu; @@ -681,7 +685,7 @@ void H323Connection::HandleSignallingChannel() if (controlChannel == NULL) endSessionReceived.Signal(); - PTRACE(2, "H225\tSignal channel closed."); + PTRACE(3, "H225\tSignal channel closed."); } @@ -738,7 +742,7 @@ BOOL H323Connection::HandleSignalPDU(H323SignalPDU & pdu) const H225_H221NonStandard & h221 = id; if (h221.m_t35CountryCode == 181 && h221.m_t35Extension == 0 && h221.m_manufacturerCode == 18) { remoteApplication = "Cisco IOS\t12.x\t181/18"; - PTRACE(2, "H225\tSet remote application name: \"" << remoteApplication << '"'); + PTRACE(3, "H225\tSet remote application name: \"" << remoteApplication << '"'); break; } } @@ -1095,7 +1099,7 @@ BOOL H323Connection::OnReceivedSignalSetup(const H323SignalPDU & originalSetupPD /** If we have a case of incoming call intrusion we should not Clear the Call*/ if (!OnIncomingCall(*setupPDU, *alertingPDU) && (!isCallIntrusion)) { Release(EndedByNoAccept); - PTRACE(1, "H225\tApplication not accepting calls"); + PTRACE(2, "H225\tApplication not accepting calls"); return FALSE; } if ((phase == ReleasingPhase) || (phase == ReleasedPhase)) { @@ -1113,7 +1117,7 @@ BOOL H323Connection::OnReceivedSignalSetup(const H323SignalPDU & originalSetupPD H323Gatekeeper::AdmissionResponse response; response.destExtraCallInfo = &destExtraCallInfoArray; if (!gatekeeper->AdmissionRequest(*this, response)) { - PTRACE(1, "H225\tGatekeeper refused admission: " + PTRACE(2, "H225\tGatekeeper refused admission: " << (response.rejectReason == UINT_MAX ? PString("Transport error") : H225_AdmissionRejectReason(response.rejectReason).GetTagName())); @@ -1258,7 +1262,7 @@ void H323Connection::SetRemotePartyInfo(const H323SignalPDU & pdu) else remotePartyName = newRemotePartyName + " [" + remoteHostName + ']'; - PTRACE(2, "H225\tSet remote party name: \"" << remotePartyName << '"'); + PTRACE(3, "H225\tSet remote party name: \"" << remotePartyName << '"'); } @@ -1266,7 +1270,7 @@ void H323Connection::SetRemoteApplication(const H225_EndpointType & pdu) { if (pdu.HasOptionalField(H225_EndpointType::e_vendor)) { remoteApplication = H323GetApplicationInfo(pdu.m_vendor); - PTRACE(2, "H225\tSet remote application name: \"" << remoteApplication << '"'); + PTRACE(3, "H225\tSet remote application name: \"" << remoteApplication << '"'); } } @@ -1479,7 +1483,7 @@ BOOL H323Connection::OnReceivedSignalConnect(const H323SignalPDU & pdu) // We have no tunnelling and not separate channel, but we really want one // so we will start one using a facility message - PTRACE(2, "H225\tNo H245 address provided by remote, starting control channel"); + PTRACE(3, "H225\tNo H245 address provided by remote, starting control channel"); H323SignalPDU want245PDU; H225_Facility_UUIE * fac = want245PDU.BuildFacility(*this, FALSE); @@ -1718,7 +1722,7 @@ H323Connection::AnswerCallResponse void H323Connection::AnsweringCall(AnswerCallResponse response) { - PTRACE(2, "H323\tAnswering call: " << response); + PTRACE(3, "H323\tAnswering call: " << response); PSafeLockReadWrite safeLock(*this); if (!safeLock.IsLocked() || GetPhase() >= ReleasingPhase) @@ -1781,7 +1785,7 @@ void H323Connection::AnsweringCall(AnswerCallResponse response) case AnswerCallDenied : // If response is denied, abort the call - PTRACE(1, "H225\tApplication has declined to answer incoming call"); + PTRACE(2, "H225\tApplication has declined to answer incoming call"); Release(EndedByAnswerDenied); break; @@ -1876,7 +1880,7 @@ OpalConnection::CallEndReason H323Connection::SendSignalSetup(const PString & al return EndedByCallerAbort; if (ok) break; - PTRACE(1, "H225\tGatekeeper refused admission: " + PTRACE(2, "H225\tGatekeeper refused admission: " << (response.rejectReason == UINT_MAX ? PString("Transport error") : H225_AdmissionRejectReason(response.rejectReason).GetTagName())); @@ -2168,13 +2172,13 @@ BOOL H323Connection::SetConnected() PTRACE(3, "H323CON\tSetConnected " << *this); if (connectPDU == NULL){ - PTRACE(2, "H323CON\tSetConnected connectPDU is null" << *this); + PTRACE(1, "H323CON\tSetConnected connectPDU is null" << *this); return FALSE; } if (!endpoint.OnSendConnect(*this, *connectPDU)){ /* let the application to avoid sending the connect, mainly for testing other endpoints*/ - PTRACE(3, "H323CON\tSetConnected connect not sent"); + PTRACE(2, "H323CON\tSetConnected connect not sent"); return TRUE; } // Assure capabilities are set to other connections media list (if not already) @@ -2375,7 +2379,7 @@ BOOL H323Connection::SendFastStartAcknowledge(H225_ArrayOf_PASN_OctetString & ar BOOL H323Connection::HandleFastStartAcknowledge(const H225_ArrayOf_PASN_OctetString & array) { if (fastStartChannels.IsEmpty()) { - PTRACE(3, "H225\tFast start response with no channels to open"); + PTRACE(2, "H225\tFast start response with no channels to open"); return FALSE; } @@ -2475,7 +2479,7 @@ BOOL H323Connection::HandleFastStartAcknowledge(const H225_ArrayOf_PASN_OctetStr // should not be deleted via this structure now. fastStartChannels.DisallowDeleteObjects(); - PTRACE(2, "H225\tFast starting " << fastStartChannels.GetSize() << " channels"); + PTRACE(3, "H225\tFast starting " << fastStartChannels.GetSize() << " channels"); if (fastStartChannels.IsEmpty()) return FALSE; @@ -2499,7 +2503,7 @@ BOOL H323Connection::CreateOutgoingControlChannel(const H225_TransportAddress & { PTRACE(3, "H225\tCreateOutgoingControlChannel h245Address = " << h245Address); if (endpoint.IsH245Disabled()){ - PTRACE(1, "H225\tCreateOutgoingControlChannel h245 is disabled, do nothing"); + PTRACE(2, "H225\tCreateOutgoingControlChannel h245 is disabled, do nothing"); /* return TRUE to act as if it was succeded*/ return TRUE; } @@ -2555,7 +2559,7 @@ BOOL H323Connection::CreateIncomingControlChannel(H225_TransportAddress & h245Ad PAssert(controlChannel == NULL, PLogicError); if (endpoint.IsH245Disabled()){ - PTRACE(1, "H225\tCreateIncomingControlChannel: do not create channel because h245 is disabled"); + PTRACE(2, "H225\tCreateIncomingControlChannel: do not create channel because h245 is disabled"); return FALSE; } @@ -2661,7 +2665,7 @@ BOOL H323Connection::WriteControlPDU(const H323ControlPDU & pdu) BOOL H323Connection::StartControlNegotiations() { - PTRACE(2, "H245\tStarted control channel"); + PTRACE(3, "H245\tStarted control channel"); if (endpoint.IsH245Disabled()){ @@ -2740,7 +2744,7 @@ void H323Connection::HandleControlChannel() if (signallingChannel == NULL) endSessionReceived.Signal(); - PTRACE(2, "H245\tControl channel closed."); + PTRACE(3, "H245\tControl channel closed."); } @@ -3023,7 +3027,7 @@ BOOL H323Connection::OnH245_MiscellaneousCommand( if (chan != NULL) chan->OnMiscellaneousCommand(pdu.m_type); else - PTRACE(3, "H245\tMiscellaneousCommand: is ignored chan=" << pdu.m_logicalChannelNumber + PTRACE(2, "H245\tMiscellaneousCommand: is ignored chan=" << pdu.m_logicalChannelNumber << ", type=" << pdu.m_type.GetTagName()); return TRUE; @@ -3037,7 +3041,7 @@ BOOL H323Connection::OnH245_MiscellaneousIndication( if (chan != NULL) chan->OnMiscellaneousIndication(pdu.m_type); else - PTRACE(3, "H245\tMiscellaneousIndication is ignored. chan=" << pdu.m_logicalChannelNumber + PTRACE(2, "H245\tMiscellaneousIndication is ignored. chan=" << pdu.m_logicalChannelNumber << ", type=" << pdu.m_type.GetTagName()); return TRUE; @@ -3357,7 +3361,7 @@ static void SetRFC2833PayloadType(H323Capabilities & capabilities, if (capability != NULL) { RTP_DataFrame::PayloadTypes pt = ((H323_UserInputCapability*)capability)->GetPayloadType(); if (rfc2833handler.GetPayloadType() != pt) { - PTRACE(2, "H323\tUser Input RFC2833 payload type set to " << pt); + PTRACE(3, "H323\tUser Input RFC2833 payload type set to " << pt); rfc2833handler.SetPayloadType(pt); } } @@ -3497,7 +3501,7 @@ void H323Connection::OnSetLocalCapabilities() localCapabilities.Remove(GetCall().GetManager().GetMediaFormatMask()); - PTRACE(2, "H323\tSetLocalCapabilities:\n" << setprecision(2) << localCapabilities); + PTRACE(3, "H323\tSetLocalCapabilities:\n" << setprecision(2) << localCapabilities); } @@ -3514,7 +3518,7 @@ void H323Connection::StartRoundTripDelay() masterSlaveDeterminationProcedure->IsDetermined() && capabilityExchangeProcedure->HasSentCapabilities()) { if (roundTripDelayProcedure->IsRemoteOffline()) { - PTRACE(2, "H245\tRemote failed to respond to PDU."); + PTRACE(1, "H245\tRemote failed to respond to PDU."); if (endpoint.ShouldClearCallOnRoundTripFail()) Release(EndedByTransportFail); } @@ -3633,7 +3637,7 @@ BOOL H323Connection::OpenSourceMediaStream(const OpalMediaFormatList & /*mediaFo FindChannel(sessionID, FALSE) != NULL) return FALSE; - PTRACE(1, "H323\tOpenSourceMediaStream called: session " << sessionID); + PTRACE(3, "H323\tOpenSourceMediaStream called: session " << sessionID); return TRUE; } @@ -3728,7 +3732,7 @@ void H323Connection::StartFastStartChannel(unsigned sessionID, H323Channel::Dire void H323Connection::OnSelectLogicalChannels() { - PTRACE(2, "H245\tDefault OnSelectLogicalChannels, " << fastStartState); + PTRACE(3, "H245\tDefault OnSelectLogicalChannels, " << fastStartState); // Select the first codec that uses the "standard" audio session. switch (fastStartState) { @@ -3843,7 +3847,7 @@ BOOL H323Connection::OpenLogicalChannel(const H323Capability & capability, transmitterMediaStream = logicalChannels->FindChannelBySession(sessionID, FALSE)->GetMediaStream(); if (GetCall().OpenSourceMediaStreams(*this, capability.GetMediaFormat(), sessionID)) return TRUE; - PTRACE(2, "H323\tOpenLogicalChannel, OpenSourceMediaStreams failed: " << capability); + PTRACE(1, "H323\tOpenLogicalChannel, OpenSourceMediaStreams failed: " << capability); return FALSE; case FastStartResponse : @@ -3882,7 +3886,7 @@ BOOL H323Connection::OnOpenLogicalChannel(const H245_OpenLogicalChannel & /*open fastStartState = FastStartDisabled; if (!fastStartChannels.IsEmpty()) { fastStartChannels.RemoveAll(); - PTRACE(1, "H245\tReceived early start OLC, aborting fast start"); + PTRACE(3, "H245\tReceived early start OLC, aborting fast start"); } //errorCode = H245_OpenLogicalChannelReject_cause::e_unspecified; @@ -3962,7 +3966,7 @@ H323Channel * H323Connection::CreateLogicalChannel(const H245_OpenLogicalChannel H245_OpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters ::e_h2250LogicalChannelParameters) { errorCode = H245_OpenLogicalChannelReject_cause::e_unsuitableReverseParameters; - PTRACE(2, "H323\tCreateLogicalChannel - reverse channel, H225.0 only supported"); + PTRACE(1, "H323\tCreateLogicalChannel - reverse channel, H225.0 only supported"); return NULL; } @@ -3980,7 +3984,7 @@ H323Channel * H323Connection::CreateLogicalChannel(const H245_OpenLogicalChannel if (capabilityExchangeProcedure->HasReceivedCapabilities() || (capability = endpoint.FindCapability(*dataType)) == NULL) { errorCode = H245_OpenLogicalChannelReject_cause::e_unknownDataType; - PTRACE(2, "H323\tCreateLogicalChannel - unknown data type"); + PTRACE(1, "H323\tCreateLogicalChannel - unknown data type"); return NULL; // If codec not supported, return error } @@ -3992,7 +3996,7 @@ H323Channel * H323Connection::CreateLogicalChannel(const H245_OpenLogicalChannel if (open.m_forwardLogicalChannelParameters.m_multiplexParameters.GetTag() != H245_OpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters ::e_h2250LogicalChannelParameters) { - PTRACE(2, "H323\tCreateLogicalChannel - forward channel, H225.0 only supported"); + PTRACE(1, "H323\tCreateLogicalChannel - forward channel, H225.0 only supported"); errorCode = H245_OpenLogicalChannelReject_cause::e_unspecified; return NULL; } @@ -4007,14 +4011,14 @@ H323Channel * H323Connection::CreateLogicalChannel(const H245_OpenLogicalChannel capability = localCapabilities.FindCapability(*dataType); if (capability == NULL) { errorCode = H245_OpenLogicalChannelReject_cause::e_unknownDataType; - PTRACE(2, "H323\tCreateLogicalChannel - unknown data type"); + PTRACE(1, "H323\tCreateLogicalChannel - unknown data type"); return NULL; // If codec not supported, return error } } if (!capability->OnReceivedPDU(*dataType, direction == H323Channel::IsReceiver)) { errorCode = H245_OpenLogicalChannelReject_cause::e_dataTypeNotSupported; - PTRACE(2, "H323\tCreateLogicalChannel - data type not supported"); + PTRACE(1, "H323\tCreateLogicalChannel - data type not supported"); return NULL; // If codec not supported, return error } @@ -4024,7 +4028,7 @@ H323Channel * H323Connection::CreateLogicalChannel(const H245_OpenLogicalChannel H323Channel * channel = capability->CreateChannel(*this, direction, param->m_sessionID, param); if (channel == NULL) { errorCode = H245_OpenLogicalChannelReject_cause::e_dataTypeNotAvailable; - PTRACE(2, "H323\tCreateLogicalChannel - data type not available"); + PTRACE(1, "H323\tCreateLogicalChannel - data type not available"); return NULL; } @@ -4033,7 +4037,7 @@ H323Channel * H323Connection::CreateLogicalChannel(const H245_OpenLogicalChannel else if (channel->OnReceivedPDU(open, errorCode)) return channel; - PTRACE(2, "H323\tOnReceivedPDU gave error " << errorCode); + PTRACE(1, "H323\tOnReceivedPDU gave error " << errorCode); delete channel; return NULL; } @@ -4049,7 +4053,7 @@ H323Channel * H323Connection::CreateRealTimeLogicalChannel(const H323Capability PSafeLockReadOnly m(ownerCall); PSafePtr otherParty = GetCall().GetOtherPartyConnection(*this); if (otherParty == NULL) { - PTRACE(2, "H323\tCowardly refusing to create an RTP channel with only one connection"); + PTRACE(1, "H323\tCowardly refusing to create an RTP channel with only one connection"); return NULL; } @@ -4287,7 +4291,7 @@ BOOL H323Connection::SendUserInputString(const PString & value) { SendUserInputModes mode = GetRealSendUserInputMode(); - PTRACE(2, "H323\tSendUserInput(\"" << value << "\"), using mode " << mode); + PTRACE(3, "H323\tSendUserInput(\"" << value << "\"), using mode " << mode); if (mode == SendUserInputAsString || mode == SendUserInputAsProtocolDefault) return SendUserInputIndicationString(value); @@ -4300,7 +4304,7 @@ BOOL H323Connection::SendUserInputTone(char tone, unsigned duration) { SendUserInputModes mode = GetRealSendUserInputMode(); - PTRACE(2, "H323\tSendUserInputTime('" << tone << "', " << duration << "), using mode " << mode); + PTRACE(3, "H323\tSendUserInputTime('" << tone << "', " << duration << "), using mode " << mode); switch (mode) { case SendUserInputAsQ931 : @@ -4323,7 +4327,7 @@ BOOL H323Connection::SendUserInputTone(char tone, unsigned duration) BOOL H323Connection::SendUserInputIndicationQ931(const PString & value) { - PTRACE(2, "H323\tSendUserInputIndicationQ931(\"" << value << "\")"); + PTRACE(3, "H323\tSendUserInputIndicationQ931(\"" << value << "\")"); H323SignalPDU pdu; pdu.BuildInformation(*this); @@ -4338,7 +4342,7 @@ BOOL H323Connection::SendUserInputIndicationQ931(const PString & value) BOOL H323Connection::SendUserInputIndicationString(const PString & value) { - PTRACE(2, "H323\tSendUserInputIndicationString(\"" << value << "\")"); + PTRACE(3, "H323\tSendUserInputIndicationString(\"" << value << "\")"); H323ControlPDU pdu; PASN_GeneralString & str = pdu.BuildUserInputIndication(value); @@ -4355,7 +4359,7 @@ BOOL H323Connection::SendUserInputIndicationTone(char tone, unsigned logicalChannel, unsigned rtpTimestamp) { - PTRACE(2, "H323\tSendUserInputIndicationTone(" + PTRACE(3, "H323\tSendUserInputIndicationTone(" << tone << ',' << duration << ',' << logicalChannel << ',' @@ -4506,7 +4510,7 @@ BOOL H323Connection::OnRequestModeChange(const H245_RequestMode & pdu, return TRUE; } - PTRACE(1, "H245\tMode change rejected as does not have capabilities"); + PTRACE(2, "H245\tMode change rejected as does not have capabilities"); return FALSE; } @@ -4522,7 +4526,7 @@ void H323Connection::OnModeChanged(const H245_ModeDescription & newMode) if (!OpenLogicalChannel(*capability, capability->GetDefaultSessionID(), H323Channel::IsTransmitter)) { - PTRACE(1, "H245\tCould not open channel after mode change: " << *capability); + PTRACE(2, "H245\tCould not open channel after mode change: " << *capability); } } } @@ -4534,7 +4538,7 @@ void H323Connection::OnAcceptModeChange(const H245_RequestModeAck & pdu) if (t38ModeChangeCapabilities.IsEmpty()) return; - PTRACE(2, "H323\tT.38 mode change accepted."); + PTRACE(3, "H323\tT.38 mode change accepted."); // Now we have conviced the other side to send us T.38 data we should do the // same assuming the RequestModeChangeT38() function provided a list of \n @@ -4559,11 +4563,11 @@ void H323Connection::OnAcceptModeChange(const H245_RequestModeAck & pdu) if (capability != NULL && OpenLogicalChannel(*capability, capability->GetDefaultSessionID(), H323Channel::IsTransmitter)) { - PTRACE(1, "H245\tOpened " << *capability << " after T.38 mode change"); + PTRACE(3, "H245\tOpened " << *capability << " after T.38 mode change"); break; } - PTRACE(1, "H245\tCould not open channel after T.38 mode change"); + PTRACE(2, "H245\tCould not open channel after T.38 mode change"); } t38ModeChangeCapabilities = PString::Empty(); diff --git a/src/h323/h323caps.cxx b/src/h323/h323caps.cxx index c7e4987e..e14d6c9f 100644 --- a/src/h323/h323caps.cxx +++ b/src/h323/h323caps.cxx @@ -27,6 +27,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.28 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.27 2006/09/28 07:42:17 csoutheren * Merge of useful SRTP implementation * @@ -2635,7 +2639,7 @@ BOOL H323Capabilities::IsAllowed(const H323Capability & capability1, BOOL H323Capabilities::IsAllowed(const unsigned a_capno1, const unsigned a_capno2) { if (a_capno1 == a_capno2) { - PTRACE(1, "H323\tH323Capabilities::IsAllowed() capabilities are the same."); + PTRACE(2, "H323\tH323Capabilities::IsAllowed() capabilities are the same."); return TRUE; } diff --git a/src/h323/h323ep.cxx b/src/h323/h323ep.cxx index e2c82b8b..dd63130c 100644 --- a/src/h323/h323ep.cxx +++ b/src/h323/h323ep.cxx @@ -27,6 +27,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.68 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.67 2007/04/03 07:40:24 rjongbloed * Fixed CreateCall usage so correct function (with userData) is called on * incoming connections. @@ -231,7 +235,7 @@ H323EndPoint::H323EndPoint(OpalManager & manager, const char * _prefix, WORD _de features.LoadFeatureSet(H460_Feature::FeatureBase); #endif - PTRACE(3, "H323\tCreated endpoint."); + PTRACE(4, "H323\tCreated endpoint."); } @@ -243,7 +247,7 @@ H323EndPoint::~H323EndPoint() // Shut down the listeners as soon as possible to avoid race conditions listeners.RemoveAll(); - PTRACE(3, "H323\tDeleted endpoint."); + PTRACE(4, "H323\tDeleted endpoint."); } @@ -390,7 +394,7 @@ BOOL H323EndPoint::UseGatekeeper(const PString & address, same = gatekeeper->GetTransport().GetLocalAddress().IsEquivalent(localAddress); if (same) { - PTRACE(2, "H323\tUsing existing gatekeeper " << *gatekeeper); + PTRACE(3, "H323\tUsing existing gatekeeper " << *gatekeeper); return TRUE; } } @@ -684,7 +688,7 @@ BOOL H323EndPoint::SetupTransfer(const PString & oldToken, call.RemoveMediaStreams(); - PTRACE(2, "H323\tTransferring call to: " << remoteParty); + PTRACE(3, "H323\tTransferring call to: " << remoteParty); BOOL ok = InternalMakeCall(call, oldToken, callIdentity, @@ -1094,7 +1098,7 @@ BOOL H323EndPoint::OnAlerting(H323Connection & connection, const H323SignalPDU & /*alertingPDU*/, const PString & /*username*/) { - PTRACE(1, "H225\tReceived alerting PDU."); + PTRACE(3, "H225\tReceived alerting PDU."); ((OpalConnection&)connection).OnAlerting(); return TRUE; } @@ -1157,7 +1161,7 @@ BOOL H323EndPoint::IsConnectionEstablished(const PString & token) BOOL H323EndPoint::OnOutgoingCall(H323Connection & /*connection*/, const H323SignalPDU & /*connectPDU*/) { - PTRACE(1, "H225\tReceived connect PDU."); + PTRACE(3, "H225\tReceived connect PDU."); return TRUE; } @@ -1186,7 +1190,7 @@ static void OnStartStopChannel(const char * startstop, const H323Channel & chann break; } - PTRACE(2, "H323\t" << startstop << "ed " + PTRACE(3, "H323\t" << startstop << "ed " << dir << "ing logical channel: " << channel.GetCapability()); } diff --git a/src/h323/h323neg.cxx b/src/h323/h323neg.cxx index 415fb64e..8589db18 100644 --- a/src/h323/h323neg.cxx +++ b/src/h323/h323neg.cxx @@ -27,6 +27,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.12 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.11 2004/02/19 10:47:04 rjongbloed * Merged OpenH323 version 1.13.1 changes. * @@ -410,7 +414,7 @@ BOOL H245NegMasterSlaveDetermination::HandleIncoming(const H245_MasterSlaveDeter H323ControlPDU reply; if (newStatus != e_Indeterminate) { - PTRACE(2, "H245\tMasterSlaveDetermination: local is " + PTRACE(3, "H245\tMasterSlaveDetermination: local is " << (newStatus == e_DeterminedMaster ? "master" : "slave")); reply.BuildMasterSlaveDeterminationAck(newStatus == e_DeterminedMaster); state = e_Incoming; @@ -454,7 +458,7 @@ BOOL H245NegMasterSlaveDetermination::HandleAck(const H245_MasterSlaveDeterminat H323ControlPDU reply; if (state == e_Outgoing) { status = newStatus; - PTRACE(2, "H245\tMasterSlaveDetermination: remote is " + PTRACE(3, "H245\tMasterSlaveDetermination: remote is " << (newStatus == e_DeterminedSlave ? "master" : "slave")); reply.BuildMasterSlaveDeterminationAck(newStatus == e_DeterminedMaster); if (!connection.WriteControlPDU(reply)) @@ -567,12 +571,12 @@ BOOL H245NegTerminalCapabilitySet::Start(BOOL renegotiate, BOOL empty) PWaitAndSignal wait(mutex); if (state == e_InProgress) { - PTRACE(3, "H245\tTerminalCapabilitySet already in progress: outSeq=" << outSequenceNumber); + PTRACE(2, "H245\tTerminalCapabilitySet already in progress: outSeq=" << outSequenceNumber); return TRUE; } if (!renegotiate && state == e_Sent) { - PTRACE(3, "H245\tTerminalCapabilitySet already sent."); + PTRACE(2, "H245\tTerminalCapabilitySet already sent."); return TRUE; } @@ -615,7 +619,7 @@ BOOL H245NegTerminalCapabilitySet::HandleIncoming(const H245_TerminalCapabilityS if (pdu.m_sequenceNumber == inSequenceNumber) { mutex.Signal(); - PTRACE(3, "H245\tIgnoring TerminalCapabilitySet, already received sequence number"); + PTRACE(2, "H245\tIgnoring TerminalCapabilitySet, already received sequence number"); return TRUE; // Already had this one } @@ -662,7 +666,7 @@ BOOL H245NegTerminalCapabilitySet::HandleAck(const H245_TerminalCapabilitySetAck replyTimer.Stop(); state = e_Sent; - PTRACE(2, "H245\tTerminalCapabilitySet Sent."); + PTRACE(3, "H245\tTerminalCapabilitySet Sent."); return TRUE; } @@ -771,7 +775,7 @@ BOOL H245NegLogicalChannel::OpenWhileLocked(const H323Capability & capability, unsigned replacementFor) { if (state != e_Released && state != e_AwaitingRelease) { - PTRACE(3, "H245\tOpen of channel currently in negotiations: " << channelNumber); + PTRACE(2, "H245\tOpen of channel currently in negotiations: " << channelNumber); return FALSE; } @@ -789,14 +793,14 @@ BOOL H245NegLogicalChannel::OpenWhileLocked(const H323Capability & capability, H245_OpenLogicalChannel & open = pdu.BuildOpenLogicalChannel(channelNumber); if (!capability.OnSendingPDU(open.m_forwardLogicalChannelParameters.m_dataType)) { - PTRACE(3, "H245\tOpening channel: " << channelNumber + PTRACE(1, "H245\tOpening channel: " << channelNumber << ", capability.OnSendingPDU() failed"); return FALSE; } channel = capability.CreateChannel(connection, H323Channel::IsTransmitter, sessionID, NULL); if (channel == NULL) { - PTRACE(3, "H245\tOpening channel: " << channelNumber + PTRACE(1, "H245\tOpening channel: " << channelNumber << ", capability.CreateChannel() failed"); return FALSE; } @@ -804,7 +808,7 @@ BOOL H245NegLogicalChannel::OpenWhileLocked(const H323Capability & capability, channel->SetNumber(channelNumber); if (!channel->OnSendingPDU(open)) { - PTRACE(3, "H245\tOpening channel: " << channelNumber + PTRACE(1, "H245\tOpening channel: " << channelNumber << ", channel->OnSendingPDU() failed"); return FALSE; } @@ -824,7 +828,7 @@ BOOL H245NegLogicalChannel::OpenWhileLocked(const H323Capability & capability, return FALSE; if (!channel->SetInitialBandwidth()) { - PTRACE(3, "H245\tOpening channel: " << channelNumber << ", Insufficient bandwidth"); + PTRACE(2, "H245\tOpening channel: " << channelNumber << ", Insufficient bandwidth"); return FALSE; } @@ -1512,7 +1516,7 @@ BOOL H245NegRequestMode::StartRequest(const PString & newModes) BOOL H245NegRequestMode::StartRequest(const H245_ArrayOf_ModeDescription & newModes) { - PTRACE(1, "H245\tStarted request mode: outSeq=" << outSequenceNumber + PTRACE(3, "H245\tStarted request mode: outSeq=" << outSequenceNumber << (awaitingResponse ? " awaitingResponse" : " idle")); if (awaitingResponse) diff --git a/src/h323/h323rtp.cxx b/src/h323/h323rtp.cxx index c0211c6b..78a735c2 100644 --- a/src/h323/h323rtp.cxx +++ b/src/h323/h323rtp.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.13 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.12 2005/03/03 18:31:23 dsandras * Fixed silence detection definition in the logical channel parameters. * @@ -311,7 +315,7 @@ BOOL H323_RTP_UDP::OnReceivedPDU(H323_RTPChannel & channel, if (param.HasOptionalField(H245_H2250LogicalChannelParameters::e_mediaChannel)) { if (ok && channel.GetDirection() == H323Channel::IsReceiver) - PTRACE(3, "RTP_UDP\tIgnoring media transport for " << channel); + PTRACE(2, "RTP_UDP\tIgnoring media transport for " << channel); else if (!ExtractTransport(param.m_mediaChannel, TRUE, errorCode)) { PTRACE(1, "RTP_UDP\tFailed to extract media transport for " << channel); return FALSE; diff --git a/src/h323/h323trans.cxx b/src/h323/h323trans.cxx index 7b3cf357..6ba4b57b 100644 --- a/src/h323/h323trans.cxx +++ b/src/h323/h323trans.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.3 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.2 2005/01/16 23:07:34 csoutheren * Fixed problem with IPv6 INADDR_ANY * @@ -285,7 +289,7 @@ BOOL H323Transactor::SetTransport(const H323TransportAddress & iface) PIPSocket::Address addr; WORD port = defaultLocalPort; if (!iface.GetIpAndPort(addr, port)) { - PTRACE(2, "Trans\tCannot create listener for " << iface); + PTRACE(1, "Trans\tCannot create listener for " << iface); return FALSE; } @@ -338,7 +342,7 @@ void H323Transactor::HandleTransactions(PThread &, INT) if (PAssertNULL(transport) == NULL) return; - PTRACE(2, "Trans\tStarting listener thread on " << *transport); + PTRACE(4, "Trans\tStarting listener thread on " << *transport); transport->SetReadTimeout(PMaxTimeInterval); @@ -386,7 +390,7 @@ void H323Transactor::HandleTransactions(PThread &, INT) AgeResponses(); } - PTRACE(2, "Trans\tEnded listener thread on " << *transport); + PTRACE(4, "Trans\tEnded listener thread on " << *transport); } @@ -529,7 +533,7 @@ BOOL H323Transactor::CheckForResponse(unsigned reqTag, unsigned seqNum, const PA requestsMutex.Signal(); if (lastRequest == NULL) { - PTRACE(3, "Trans\tTimed out or received sequence number (" << seqNum << ") for PDU we never requested"); + PTRACE(2, "Trans\tTimed out or received sequence number (" << seqNum << ") for PDU we never requested"); return FALSE; } @@ -549,7 +553,7 @@ BOOL H323Transactor::HandleRequestInProgress(const H323TransactionPDU & pdu, requestsMutex.Signal(); if (lastRequest == NULL) { - PTRACE(3, "Trans\tTimed out or received sequence number (" << seqNum << ") for PDU we never requested"); + PTRACE(2, "Trans\tTimed out or received sequence number (" << seqNum << ") for PDU we never requested"); return FALSE; } @@ -652,7 +656,7 @@ BOOL H323Transactor::Request::Poll(H323Transactor & rasChannel) return FALSE; case BadCryptoTokens : - PTRACE(2, "Trans\tResponse to seqnum=" << requestPDU.GetSequenceNumber() + PTRACE(1, "Trans\tResponse to seqnum=" << requestPDU.GetSequenceNumber() << " had invalid crypto tokens."); return FALSE; @@ -676,7 +680,7 @@ BOOL H323Transactor::Request::Poll(H323Transactor & rasChannel) void H323Transactor::Request::CheckResponse(unsigned reqTag, const PASN_Choice * reason) { if (requestPDU.GetChoice().GetTag() != reqTag) { - PTRACE(3, "Trans\tReceived reply for incorrect PDU tag."); + PTRACE(2, "Trans\tReceived reply for incorrect PDU tag."); responseResult = RejectReceived; rejectReason = UINT_MAX; return; @@ -687,7 +691,7 @@ void H323Transactor::Request::CheckResponse(unsigned reqTag, const PASN_Choice * return; } - PTRACE(1, "Trans\t" << requestPDU.GetChoice().GetTagName() + PTRACE(2, "Trans\t" << requestPDU.GetChoice().GetTagName() << " rejected: " << reason->GetTagName()); responseResult = RejectReceived; rejectReason = reason->GetTag(); @@ -846,14 +850,14 @@ BOOL H323Transaction::HandlePDU() void H323Transaction::SlowHandler(PThread &, INT) { - PTRACE(3, "Trans\tStarted slow PDU handler thread."); + PTRACE(4, "Trans\tStarted slow PDU handler thread."); while (HandlePDU()) ; delete this; - PTRACE(3, "Trans\tEnded slow PDU handler thread."); + PTRACE(4, "Trans\tEnded slow PDU handler thread."); } diff --git a/src/h323/h450pdu.cxx b/src/h323/h450pdu.cxx index 103948c9..5220a3b5 100644 --- a/src/h323/h450pdu.cxx +++ b/src/h323/h450pdu.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.22 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.21 2007/04/02 05:51:33 rjongbloed * Tidied some trace logs to assure all have a category (bit before a tab character) set. * @@ -383,7 +387,7 @@ void H450ServiceAPDU::BuildCallIntrusionForcedRelease(int invokeId, X880_ReturnResult& H450ServiceAPDU::BuildCallIntrusionForcedReleaseResult(int invokeId) { - PTRACE(1 ,"H450.11\tH450ServiceAPDU::BuildCallIntrusionForcedReleaseResult BEGIN"); + PTRACE(3 ,"H450.11\tH450ServiceAPDU::BuildCallIntrusionForcedReleaseResult BEGIN"); X880_ReturnResult& result = BuildReturnResult(invokeId); result.IncludeOptionalField(X880_ReturnResult::e_result); @@ -635,7 +639,7 @@ BOOL H450xDispatcher::OnReceivedInvoke(X880_Invoke & invoke, H4501_Interpretatio if (invoke.m_opcode.GetTag() == X880_Code::e_local) { int opcode = ((PASN_Integer&) invoke.m_opcode).GetValue(); if (!opcodeHandler.Contains(opcode)) { - PTRACE(2, "H4501\tInvoke of unsupported local opcode:\n " << invoke); + PTRACE(3, "H4501\tInvoke of unsupported local opcode:\n " << invoke); if (interpretation.GetTag() != H4501_InterpretationApdu::e_discardAnyUnrecognizedInvokePdu) SendInvokeReject(invokeId, 1 /*X880_InvokeProblem::e_unrecognisedOperation*/); if (interpretation.GetTag() == H4501_InterpretationApdu::e_clearCallIfAnyInvokePduNotRecognized) @@ -1533,7 +1537,7 @@ void H4502Handler::onReceivedAdmissionReject(const int returnError) // Send a FACILITY message back to the transferring party on the primary connection PSafePtr primaryConnection = endpoint.FindConnectionWithLock(transferringCallToken); if (primaryConnection != NULL) { - PTRACE(3, "H4502\tReceived an Admission Reject at the Transferred Endpoint - aborting the transfer."); + PTRACE(2, "H4502\tReceived an Admission Reject at the Transferred Endpoint - aborting the transfer."); primaryConnection->HandleCallTransferFailure(returnError); } } @@ -1796,7 +1800,7 @@ BOOL H4507Handler::OnReceivedInvoke(int opcode, break; default: - PTRACE(1, "H450.7\tOnReceivedInvoke, not an interrogate"); + PTRACE(2, "H450.7\tOnReceivedInvoke, not an interrogate"); currentInvokeId = 0; return FALSE; } diff --git a/src/h323/peclient.cxx b/src/h323/peclient.cxx index 6720a0a0..caf9d385 100644 --- a/src/h323/peclient.cxx +++ b/src/h323/peclient.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.4 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.3 2007/04/02 05:51:33 rjongbloed * Tidied some trace logs to assure all have a category (bit before a tab character) set. * @@ -382,7 +386,7 @@ void H323PeerElement::PrintOn(ostream & strm) const void H323PeerElement::MonitorMain(PThread &, INT) { - PTRACE(3, "PeerElement\tBackground thread started"); + PTRACE(4, "PeerElement\tBackground thread started"); for (;;) { @@ -410,7 +414,7 @@ void H323PeerElement::MonitorMain(PThread &, INT) // check to see if expired or needs refresh scheduled PTime expireTime = sr->expireTime + 1000 * ServiceRequestGracePeriod; if (now >= expireTime) { - PTRACE(3, "PeerElement\tService relationship " << sr->serviceID << "expired"); + PTRACE(2, "PeerElement\tService relationship " << sr->serviceID << "expired"); localServiceRelationships.Remove(sr); { PWaitAndSignal m(localPeerListMutex); @@ -449,12 +453,12 @@ void H323PeerElement::MonitorMain(PThread &, INT) break; } - PTRACE(3, "PeerElement\tBackground thread ended"); + PTRACE(4, "PeerElement\tBackground thread ended"); } void H323PeerElement::UpdateAllDescriptors(PThread &, INT) { - PTRACE(2, "PeerElement\tDescriptor update thread started"); + PTRACE(4, "PeerElement\tDescriptor update thread started"); for (PSafePtr descriptor = GetFirstDescriptor(PSafeReadWrite); descriptor != NULL; descriptor++) { PWaitAndSignal m(localPeerListMutex); @@ -472,7 +476,7 @@ void H323PeerElement::UpdateAllDescriptors(PThread &, INT) monitorTickle.Signal(); - PTRACE(2, "PeerElement\tDescriptor update thread ended"); + PTRACE(4, "PeerElement\tDescriptor update thread ended"); } void H323PeerElement::TickleMonitor(PTimer &, INT) @@ -670,7 +674,7 @@ H323PeerElement::Error H323PeerElement::ServiceRequestByAddr(const H323Transport remoteServiceRelationships.Append(sr); - PTRACE(2, "PeerElement\tNew service relationship established with " << peer << " - next update in " << replyBody.m_timeToLive); + PTRACE(3, "PeerElement\tNew service relationship established with " << peer << " - next update in " << replyBody.m_timeToLive); OnAddServiceRelationship(peer); // mark all descriptors as needing an update @@ -713,7 +717,7 @@ H323PeerElement::Error H323PeerElement::ServiceRequestByID(OpalGloballyUniqueID H501_ServiceConfirmation & replyBody = reply.m_body; sr->expireTime = PTime() + 1000 * ((replyBody.m_timeToLive < ServiceRequestRetryTime) ? (int)replyBody.m_timeToLive : ServiceRequestRetryTime); sr->lastUpdateTime = PTime(); - PTRACE(2, "PeerElement\tConfirmed service relationship with " << sr->peer << " - next update in " << replyBody.m_timeToLive); + PTRACE(3, "PeerElement\tConfirmed service relationship with " << sr->peer << " - next update in " << replyBody.m_timeToLive); return Confirmed; } @@ -1040,10 +1044,10 @@ BOOL H323PeerElement::AddDescriptor(const OpalGloballyUniqueID & descriptorID, // do the update now, or later if (now) { - PTRACE(2, "PeerElement\tDescriptor " << descriptorID << " added/updated"); + PTRACE(3, "PeerElement\tDescriptor " << descriptorID << " added/updated"); UpdateDescriptor(descriptor, updateType); } else if (descriptor->state != H323PeerElementDescriptor::Deleted) { - PTRACE(2, "PeerElement\tDescriptor " << descriptorID << " queued to be added"); + PTRACE(3, "PeerElement\tDescriptor " << descriptorID << " queued to be added"); descriptor->state = H323PeerElementDescriptor::Dirty; monitorTickle.Signal(); } @@ -1135,10 +1139,10 @@ BOOL H323PeerElement::DeleteDescriptor(const OpalGloballyUniqueID & descriptorID // delete the descriptor, or mark it as to be deleted if (now) { - PTRACE(2, "PeerElement\tDescriptor " << descriptorID << " deleted"); + PTRACE(3, "PeerElement\tDescriptor " << descriptorID << " deleted"); UpdateDescriptor(descriptor, H501_UpdateInformation_updateType::e_deleted); } else { - PTRACE(2, "PeerElement\tDescriptor for " << descriptorID << " queued to be deleted"); + PTRACE(3, "PeerElement\tDescriptor for " << descriptorID << " queued to be deleted"); descriptor->state = H323PeerElementDescriptor::Deleted; monitorTickle.Signal(); } @@ -1425,11 +1429,11 @@ BOOL H323PeerElement::AccessRequest(const H225_AliasAddress & searchAlias, destAliases.SetSize(count); transportAddress = contactAddress; - PTRACE(2, "Main\tAccessRequest for " << searchAlias << " returned " << transportAddress << " from " << peerAddr); + PTRACE(3, "Main\tAccessRequest for " << searchAlias << " returned " << transportAddress << " from " << peerAddr); return TRUE; } else { // H501_RouteInformation_messageType::e_nonExistent - PTRACE(2, "Main\tAccessRequest for " << searchAlias << " from " << peerAddr << " returned nonExistent"); + PTRACE(3, "Main\tAccessRequest for " << searchAlias << " from " << peerAddr << " returned nonExistent"); break; } diff --git a/src/h323/svcctrl.cxx b/src/h323/svcctrl.cxx index 26f727c3..d37cdef1 100644 --- a/src/h323/svcctrl.cxx +++ b/src/h323/svcctrl.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.2 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.1 2004/02/19 10:47:05 rjongbloed * Merged OpenH323 version 1.13.1 changes. * @@ -113,7 +117,7 @@ void H323HTTPServiceControl::OnChange(unsigned type, H323EndPoint & endpoint, H323Connection * /*connection*/) const { - PTRACE(2, "SvcCtrl\tOnChange HTTP service control " << url); + PTRACE(3, "SvcCtrl\tOnChange HTTP service control " << url); endpoint.OnHTTPServiceControl(type, sessionId, url); } @@ -257,7 +261,7 @@ void H323CallCreditServiceControl::OnChange(unsigned /*type*/, H323EndPoint & endpoint, H323Connection * connection) const { - PTRACE(2, "SvcCtrl\tOnChange Call Credit service control " + PTRACE(3, "SvcCtrl\tOnChange Call Credit service control " << amount << (mode ? " debit " : " credit ") << durationLimit); endpoint.OnCallCreditServiceControl(amount, mode); diff --git a/src/lids/lid.cxx b/src/lids/lid.cxx index 0f681987..a98e064e 100644 --- a/src/lids/lid.cxx +++ b/src/lids/lid.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.23 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.22 2007/03/30 02:09:53 rjongbloed * Fixed various GCC warnings * @@ -920,26 +924,26 @@ BOOL OpalLineInterfaceDevice::StopTone(unsigned) BOOL OpalLineInterfaceDevice::PlayAudio(unsigned /*line*/, const PString & /*filename*/) { - PTRACE(3, "LID\tBase Class PlayAudio method called, exiting with FALSE"); + PTRACE(2, "LID\tBase Class PlayAudio method called, exiting with FALSE"); return FALSE; } BOOL OpalLineInterfaceDevice::StopAudio(unsigned /*line*/) { - PTRACE(3, "LID\tBase Class StopAudio method called, exiting with FALSE"); + PTRACE(2, "LID\tBase Class StopAudio method called, exiting with FALSE"); return FALSE; } BOOL OpalLineInterfaceDevice::RecordAudioStart(unsigned /*line*/, const PString & /*fn*/) { - PTRACE(1, "LID\tRecordAudioStart KO, must be implemented in concrete class"); + PTRACE(2, "LID\tRecordAudioStart must be implemented in concrete class"); return FALSE; } BOOL OpalLineInterfaceDevice::RecordAudioStop(unsigned /*line*/) { - PTRACE(1, "LID\tRecordAudioStop KO, must be implemented in concrete class"); + PTRACE(2, "LID\tRecordAudioStop must be implemented in concrete class"); return FALSE; } @@ -952,7 +956,7 @@ OpalLineInterfaceDevice::CallProgressTones PTRACE(3, "LID\tDialOut to " << number << ", line = " << line << ", requireTone = " << requireTone); if (IsLineTerminal(line)) { - PTRACE(1, "LID\tDialOut line is a terminal, do nothing"); + PTRACE(2, "LID\tDialOut line is a terminal, do nothing"); return NoTone; } @@ -964,7 +968,7 @@ OpalLineInterfaceDevice::CallProgressTones /* Wait for dial tone or Message waiting tone */ CallProgressTones tone = WaitForToneDetect(line, m_uiDialToneTimeout); if (tone != DialTone && tone != MwiTone) { - PTRACE(3, "LID\tDialOut dial tone or mwi tone not detected"); + PTRACE(2, "LID\tDialOut dial tone or mwi tone not detected"); if (requireTone) return tone; } @@ -1259,7 +1263,7 @@ BOOL OpalLineInterfaceDevice::SetCountryCode(T35CountryCodes country) for (PINDEX i = 0; i < PARRAYSIZE(CountryInfo); i++) { if (CountryInfo[i].t35Code == country) { - PTRACE(2, "LID\tCountry set to \"" << CountryInfo[i].fullName << '"'); + PTRACE(3, "LID\tCountry set to \"" << CountryInfo[i].fullName << '"'); for (line = 0; line < GetLineCount(); line++) { for (int tone = 0; tone < NumTones; tone++) { const char * toneStr = CountryInfo[i].tone[tone]; @@ -1273,7 +1277,7 @@ BOOL OpalLineInterfaceDevice::SetCountryCode(T35CountryCodes country) } } - PTRACE(2, "LID\tCountry could not be set to \"" << GetCountryCodeName(country) <<"\", leaveing as \"" << GetCountryCodeName() << '"'); + PTRACE(2, "LID\tCountry could not be set to \"" << GetCountryCodeName(country) <<"\", leaving as \"" << GetCountryCodeName() << '"'); return TRUE; } @@ -1408,7 +1412,7 @@ OpalLine::OpalLine(OpalLineInterfaceDevice & dev, unsigned num, const char * des description = descript; - PTRACE(3, "LID\tOpalLine::OpalLine device name " << dev.GetDeviceName() << " num = " << num << + PTRACE(4, "LID\tOpalLine constructed - device name " << dev.GetDeviceName() << " num = " << num << ", descript = " << description); ringCount = 0; diff --git a/src/lids/lidep.cxx b/src/lids/lidep.cxx index 05a4f7c2..0a1903ed 100644 --- a/src/lids/lidep.cxx +++ b/src/lids/lidep.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.44 2007/04/04 02:12:00 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.43 2007/04/03 07:40:24 rjongbloed * Fixed CreateCall usage so correct function (with userData) is called on * incoming connections. @@ -211,7 +215,7 @@ OpalLIDEndPoint::OpalLIDEndPoint(OpalManager & mgr, : OpalEndPoint(mgr, prefix, attributes), defaultLine("*") { - PTRACE(3, "LID EP\tOpalLIDEndPoint " << prefix); + PTRACE(4, "LID EP\tOpalLIDEndPoint " << prefix << " created"); monitorThread = PThread::Create(PCREATE_NOTIFIER(MonitorLines), 0, PThread::NoAutoDeleteThread, PThread::LowPriority, @@ -223,7 +227,7 @@ OpalLIDEndPoint::~OpalLIDEndPoint() { if(NULL != monitorThread) { - PTRACE(3, "LID EP\tAwaiting monitor thread termination " << GetPrefixName()); + PTRACE(4, "LID EP\tAwaiting monitor thread termination " << GetPrefixName()); exitFlag.Signal(); monitorThread->WaitForTermination(); delete monitorThread; @@ -236,6 +240,7 @@ OpalLIDEndPoint::~OpalLIDEndPoint() */ RemoveAllLines(); } + PTRACE(4, "LID EP\tOpalLIDEndPoint " << GetPrefixName() << " destroyed"); } @@ -528,7 +533,7 @@ void OpalLIDEndPoint::SetDefaultLine(const PString & lineName) void OpalLIDEndPoint::MonitorLines(PThread &, INT) { - PTRACE(3, "LID EP\tMonitor thread started for " << GetPrefixName()); + PTRACE(4, "LID EP\tMonitor thread started for " << GetPrefixName()); while (!exitFlag.Wait(100)) { linesMutex.Wait(); @@ -537,7 +542,7 @@ void OpalLIDEndPoint::MonitorLines(PThread &, INT) linesMutex.Signal(); } - PTRACE(3, "LID EP\tMonitor thread stopped for " << GetPrefixName()); + PTRACE(4, "LID EP\tMonitor thread stopped for " << GetPrefixName()); } @@ -622,10 +627,10 @@ OpalLineConnection::OpalLineConnection(OpalCall & call, void OpalLineConnection::OnReleased() { - PTRACE(2, "LID Con\tOnReleased " << *this); + PTRACE(3, "LID Con\tOnReleased " << *this); if (handlerThread != NULL) { - PTRACE(3, "LID Con\tAwaiting handler thread termination " << *this); + PTRACE(4, "LID Con\tAwaiting handler thread termination " << *this); // Stop the signalling handler thread SetUserInput(PString()); // Break out of ReadUserInput handlerThread->WaitForTermination(); @@ -658,7 +663,7 @@ BOOL OpalLineConnection::OnSetUpConnection() BOOL OpalLineConnection::SetAlerting(const PString & calleeName, BOOL) { if (IsOriginating()) { - PTRACE(3, "LID Con\tSetAlerting ignored on call we originated."); + PTRACE(2, "LID Con\tSetAlerting ignored on call we originated."); return TRUE; } @@ -679,7 +684,7 @@ BOOL OpalLineConnection::SetAlerting(const PString & calleeName, BOOL) BOOL OpalLineConnection::SetConnected() { if (IsOriginating()) { - PTRACE(3, "LID Con\tSetConnected ignored on call we originated."); + PTRACE(2, "LID Con\tSetConnected ignored on call we originated."); return TRUE; } @@ -819,7 +824,7 @@ void OpalLineConnection::Monitor(BOOL offHook) return; } - PTRACE(2, "LID Con\tOutgoing connection " << *this << " routed to \"" << ownerCall.GetPartyB() << '"'); + PTRACE(3, "LID Con\tOutgoing connection " << *this << " routed to \"" << ownerCall.GetPartyB() << '"'); if (!ownerCall.OnSetUp(*this)) { Release(EndedByNoAccept); return; @@ -851,7 +856,7 @@ void OpalLineConnection::HandleIncoming(PThread &, INT) do { count = line.GetRingCount(); if (count == 0) { - PTRACE(2, "LID Con\tIncoming PSTN call stopped."); + PTRACE(3, "LID Con\tIncoming PSTN call stopped."); Release(EndedByCallerAbort); return; } @@ -885,7 +890,7 @@ void OpalLineConnection::HandleIncoming(PThread &, INT) return; } - PTRACE(2, "LID\tIncoming call routed for " << *this); + PTRACE(3, "LID\tIncoming call routed for " << *this); if (!ownerCall.OnSetUp(*this)) Release(EndedByNoAccept); } @@ -919,7 +924,7 @@ BOOL OpalLineConnection::SetUpConnection() break; default : - PTRACE(3, "LID Con\tError dialling " << remotePartyNumber << " on " << line); + PTRACE(1, "LID Con\tError dialling " << remotePartyNumber << " on " << line); return FALSE; } } diff --git a/src/opal/call.cxx b/src/opal/call.cxx index 4b0286ad..ac0fdefa 100644 --- a/src/opal/call.cxx +++ b/src/opal/call.cxx @@ -25,6 +25,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.58 2007/04/04 02:12:01 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.57 2007/04/03 05:27:30 rjongbloed * Cleaned up somewhat confusing usage of the OnAnswerCall() virtual * function. The name is innaccurate and exists as a legacy from the @@ -542,7 +546,7 @@ BOOL OpalCall::OpenSourceMediaStreams(const OpalConnection & connection, const OpalMediaFormatList & mediaFormats, unsigned sessionID) { - PTRACE(2, "Call\tOpenSourceMediaStreams for session " << sessionID + PTRACE(3, "Call\tOpenSourceMediaStreams for session " << sessionID << " with media " << setfill(',') << mediaFormats << setfill(' ')); BOOL startedOne = FALSE; diff --git a/src/opal/connection.cxx b/src/opal/connection.cxx index 71e0ba36..c5cbdd24 100644 --- a/src/opal/connection.cxx +++ b/src/opal/connection.cxx @@ -25,6 +25,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.102 2007/04/04 02:12:01 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.101 2007/04/02 05:51:33 rjongbloed * Tidied some trace logs to assure all have a category (bit before a tab character) set. * @@ -720,7 +724,7 @@ void OpalConnection::ClearCallSynchronous(PSyncPoint * sync, CallEndReason reaso void OpalConnection::TransferConnection(const PString & PTRACE_PARAM(remoteParty), const PString & /*callIdentity*/) { - PTRACE(3, "OpalCon\tCan not transfer connection to " << remoteParty); + PTRACE(2, "OpalCon\tCan not transfer connection to " << remoteParty); } @@ -729,7 +733,7 @@ void OpalConnection::Release(CallEndReason reason) { PWaitAndSignal m(phaseMutex); if (phase >= ReleasingPhase) { - PTRACE(3, "OpalCon\tAlready released " << *this); + PTRACE(2, "OpalCon\tAlready released " << *this); return; } SetPhase(ReleasingPhase); @@ -738,7 +742,7 @@ void OpalConnection::Release(CallEndReason reason) { PSafeLockReadWrite safeLock(*this); if (!safeLock.IsLocked()) { - PTRACE(3, "OpalCon\tAlready released " << *this); + PTRACE(2, "OpalCon\tAlready released " << *this); return; } @@ -762,7 +766,7 @@ void OpalConnection::OnReleaseThreadMain(PThread &, INT) { OnReleased(); - PTRACE(3, "OpalCon\tOnRelease thread completed for " << GetToken()); + PTRACE(4, "OpalCon\tOnRelease thread completed for " << GetToken()); // Dereference on the way out of the thread SafeDereference(); @@ -970,7 +974,7 @@ void OpalConnection::StartMediaStreams() strm.Start(); } } - PTRACE(2, "OpalCon\tMedia stream threads started."); + PTRACE(3, "OpalCon\tMedia stream threads started."); } @@ -985,7 +989,7 @@ void OpalConnection::CloseMediaStreams() } } - PTRACE(2, "OpalCon\tMedia stream threads closed."); + PTRACE(3, "OpalCon\tMedia stream threads closed."); } @@ -995,7 +999,7 @@ void OpalConnection::RemoveMediaStreams() CloseMediaStreams(); mediaStreams.RemoveAll(); - PTRACE(2, "OpalCon\tMedia stream threads removed from session."); + PTRACE(3, "OpalCon\tMedia stream threads removed from session."); } void OpalConnection::PauseMediaStreams(BOOL paused) @@ -1076,7 +1080,7 @@ void OpalConnection::OnClosedMediaStream(const OpalMediaStream & stream) void OpalConnection::OnPatchMediaStream(BOOL /*isSource*/, OpalMediaPatch & /*patch*/) { - PTRACE(3, "OpalCon\tNew patch created"); + PTRACE(4, "OpalCon\tNew patch created"); } @@ -1141,7 +1145,7 @@ BOOL OpalConnection::RemoveMediaStream(OpalMediaStream * strm) BOOL OpalConnection::IsMediaBypassPossible(unsigned /*sessionID*/) const { - PTRACE(3, "OpalCon\tIsMediaBypassPossible: default returns FALSE"); + PTRACE(4, "OpalCon\tIsMediaBypassPossible: default returns FALSE"); return FALSE; } @@ -1150,7 +1154,7 @@ BOOL OpalConnection::GetMediaInformation(unsigned sessionID, MediaInformation & info) const { if (!mediaTransportAddresses.Contains(sessionID)) { - PTRACE(3, "OpalCon\tGetMediaInformation for session " << sessionID << " - no channel."); + PTRACE(2, "OpalCon\tGetMediaInformation for session " << sessionID << " - no channel."); return FALSE; } @@ -1389,7 +1393,7 @@ BOOL OpalConnection::SetBandwidthUsed(unsigned releasedBandwidth, void OpalConnection::SetSendUserInputMode(SendUserInputModes mode) { - PTRACE(2, "OPAL\tSetting default User Input send mode to " << mode); + PTRACE(3, "OPAL\tSetting default User Input send mode to " << mode); sendUserInputMode = mode; } @@ -1482,7 +1486,7 @@ void OpalConnection::OnUserInputInBandDTMF(RTP_DataFrame & frame, INT) // Pass the 16 bit PCM audio through the DTMF decoder PString tones = dtmfDecoder.Decode((const short *)frame.GetPayloadPtr(), frame.GetPayloadSize()/sizeof(short)); if (!tones.IsEmpty()) { - PTRACE(1, "OPAL\tDTMF detected. " << tones); + PTRACE(3, "OPAL\tDTMF detected. " << tones); PINDEX i; for (i = 0; i < tones.GetLength(); i++) { OnUserInputTone(tones[i], 0); diff --git a/src/opal/endpoint.cxx b/src/opal/endpoint.cxx index 6c370b70..9477dafe 100644 --- a/src/opal/endpoint.cxx +++ b/src/opal/endpoint.cxx @@ -25,6 +25,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.56 2007/04/04 02:12:01 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.55 2007/03/29 23:55:46 rjongbloed * Tidied some code when a new connection is created by an endpoint. Now * if someone needs to derive a connection class they can create it without @@ -288,7 +292,7 @@ OpalEndPoint::OpalEndPoint(OpalManager & mgr, if (defaultLocalPartyName.IsEmpty()) defaultLocalPartyName = PProcess::Current().GetName() & "User"; - PTRACE(3, "OpalEP\tCreated endpoint: " << prefixName); + PTRACE(4, "OpalEP\tCreated endpoint: " << prefixName); defaultSecurityMode = mgr.GetDefaultSecurityMode(); } @@ -307,7 +311,7 @@ OpalEndPoint::~OpalEndPoint() } #endif - PTRACE(3, "OpalEP\t" << prefixName << " endpoint destroyed."); + PTRACE(4, "OpalEP\t" << prefixName << " endpoint destroyed."); } BOOL OpalEndPoint::MakeConnection(OpalCall & /*call*/, const PString & /*party*/, void * /*userData*/, unsigned int /*options*/, OpalConnection::StringOptions * /*stringOptions*/) diff --git a/src/opal/ivr.cxx b/src/opal/ivr.cxx index 6afe4eb6..d1aaa6a4 100755 --- a/src/opal/ivr.cxx +++ b/src/opal/ivr.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.22 2007/04/04 02:12:01 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.21 2007/03/29 23:55:46 rjongbloed * Tidied some code when a new connection is created by an endpoint. Now * if someone needs to derive a connection class they can create it without @@ -148,13 +152,13 @@ OpalIVREndPoint::OpalIVREndPoint(OpalManager & mgr, const char * prefix) defaultMediaFormats += OpalPCM16; - PTRACE(3, "IVR\tCreated endpoint."); + PTRACE(4, "IVR\tCreated endpoint."); } OpalIVREndPoint::~OpalIVREndPoint() { - PTRACE(3, "IVR\tDeleted endpoint."); + PTRACE(4, "IVR\tDeleted endpoint."); } @@ -245,13 +249,13 @@ OpalIVRConnection::OpalIVRConnection(OpalCall & call, { phase = SetUpPhase; - PTRACE(3, "IVR\tConstructed"); + PTRACE(4, "IVR\tConstructed"); } OpalIVRConnection::~OpalIVRConnection() { - PTRACE(3, "IVR\tDestroyed."); + PTRACE(4, "IVR\tDestroyed."); } @@ -265,7 +269,7 @@ BOOL OpalIVRConnection::SetUpConnection() return FALSE; } - PTRACE(2, "IVR\tOutgoing call routed to " << ownerCall.GetPartyB() << " for " << *this); + PTRACE(3, "IVR\tOutgoing call routed to " << ownerCall.GetPartyB() << " for " << *this); if (!ownerCall.OnSetUp(*this)) { Release(EndedByNoAccept); return FALSE; diff --git a/src/opal/manager.cxx b/src/opal/manager.cxx index 01e700d2..d9ffc05a 100644 --- a/src/opal/manager.cxx +++ b/src/opal/manager.cxx @@ -25,6 +25,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.81 2007/04/04 02:12:01 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.80 2007/04/03 13:04:24 rjongbloed * Added driverName to PVideoDevice::OpenArgs (so can select YUVFile) * Added new statics to create correct video input/output device object @@ -457,7 +461,7 @@ OpalManager::OpalManager() PThread::LowPriority, "OpalGarbage"); - PTRACE(3, "OpalMan\tCreated manager."); + PTRACE(4, "OpalMan\tCreated manager."); } #ifdef _MSC_VER @@ -485,7 +489,7 @@ OpalManager::~OpalManager() delete stun; - PTRACE(3, "OpalMan\tDeleted manager."); + PTRACE(4, "OpalMan\tDeleted manager."); } @@ -563,7 +567,7 @@ BOOL OpalManager::SetUpCall(const PString & partyA, } if (!activeCalls.RemoveAt(token)) { - PTRACE(1, "OpalMan\tSetUpCall could not remove call from active call list"); + PTRACE(2, "OpalMan\tSetUpCall could not remove call from active call list"); } token.MakeEmpty(); @@ -1030,7 +1034,7 @@ BOOL OpalManager::AddRouteEntry(const PString & spec) RouteEntry * entry = new RouteEntry(spec.Left(equal).Trim(), spec.Mid(equal+1).Trim()); if (entry->regex.GetErrorCode() != PRegularExpression::NoError) { - PTRACE(1, "OpalMan\tIllegal regular expression in route table entry: \"" << spec << '"'); + PTRACE(2, "OpalMan\tIllegal regular expression in route table entry: \"" << spec << '"'); delete entry; return FALSE; } @@ -1182,7 +1186,7 @@ PSTUNClient::NatTypes OpalManager::SetSTUNServer(const PString & server) if (type != PSTUNClient::BlockedNat) stun->GetExternalAddress(translationAddress); - PTRACE(2, "OPAL\tSTUN server \"" << server << "\" replies " << type << ", external IP " << translationAddress); + PTRACE(3, "OPAL\tSTUN server \"" << server << "\" replies " << type << ", external IP " << translationAddress); return type; } diff --git a/src/opal/mediastrm.cxx b/src/opal/mediastrm.cxx index c754a8c1..9bf8243f 100644 --- a/src/opal/mediastrm.cxx +++ b/src/opal/mediastrm.cxx @@ -24,6 +24,10 @@ * Contributor(s): ________________________________________. * * $Log$ + * Revision 2.55 2007/04/04 02:12:01 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.54 2007/04/02 05:51:33 rjongbloed * Tidied some trace logs to assure all have a category (bit before a tab character) set. * @@ -826,7 +830,7 @@ BOOL OpalRawMediaStream::WriteData(const BYTE * buffer, PINDEX length, PINDEX & BOOL OpalRawMediaStream::Close() { - PTRACE(1, "Media\tClosing raw media stream " << *this); + PTRACE(3, "Media\tClosing raw media stream " << *this); if (!OpalMediaStream::Close()) return FALSE; diff --git a/src/opal/patch.cxx b/src/opal/patch.cxx index 3e279c0b..119c80c2 100644 --- a/src/opal/patch.cxx +++ b/src/opal/patch.cxx @@ -25,6 +25,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.46 2007/04/04 02:12:01 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.45 2007/04/02 05:51:33 rjongbloed * Tidied some trace logs to assure all have a category (bit before a tab character) set. * @@ -219,7 +223,7 @@ OpalMediaPatch::~OpalMediaPatch() PWaitAndSignal m(patchThreadMutex); inUse.Wait(); delete patchThread; - PTRACE(3, "Patch\tMedia patch thread " << *this << " destroyed."); + PTRACE(4, "Patch\tMedia patch thread " << *this << " destroyed."); } @@ -280,7 +284,7 @@ void OpalMediaPatch::Close() RemoveSink(stream); } - PTRACE(3, "Patch\tWaiting for media patch thread to stop " << *this); + PTRACE(4, "Patch\tWaiting for media patch thread to stop " << *this); if (patchThread != NULL && !patchThread->IsSuspended()) { inUse.Signal(); PAssert(patchThread->WaitForTermination(10000), "Media patch thread not terminated."); @@ -337,7 +341,7 @@ BOOL OpalMediaPatch::AddSink(OpalMediaStream * stream, const RTP_DataFrame::Payl sink->primaryCodec->SetMaxOutputSize(stream->GetDataSize()); if (!stream->SetDataSize(sink->primaryCodec->GetOptimalDataFrameSize(FALSE))) { - PTRACE(2, "Patch\tSink stream " << *stream << " cannot support data size " + PTRACE(1, "Patch\tSink stream " << *stream << " cannot support data size " << sink->primaryCodec->GetOptimalDataFrameSize(FALSE)); return FALSE; } @@ -349,19 +353,19 @@ BOOL OpalMediaPatch::AddSink(OpalMediaStream * stream, const RTP_DataFrame::Payl OpalMediaFormat intermediateFormat; if (!OpalTranscoder::FindIntermediateFormat(sourceFormat, destinationFormat, intermediateFormat)) { - PTRACE(2, "Patch\tCould find compatible media format for " << *stream); + PTRACE(1, "Patch\tCould find compatible media format for " << *stream); return FALSE; } sink->primaryCodec = OpalTranscoder::Create(sourceFormat, intermediateFormat, (const BYTE *)id, id.GetLength()); sink->secondaryCodec = OpalTranscoder::Create(intermediateFormat, destinationFormat, (const BYTE *)id, id.GetLength()); - PTRACE(4, "Patch\tcreated two stage codec " << sourceFormat << "/" << intermediateFormat << "/" << destinationFormat << " with ID " << id); + PTRACE(4, "Patch\tCreated two stage codec " << sourceFormat << "/" << intermediateFormat << "/" << destinationFormat << " with ID " << id); sink->secondaryCodec->SetMaxOutputSize(sink->stream->GetDataSize()); if (!stream->SetDataSize(sink->secondaryCodec->GetOptimalDataFrameSize(FALSE))) { - PTRACE(2, "Patch\tSink stream " << *stream << " cannot support data size " + PTRACE(1, "Patch\tSink stream " << *stream << " cannot support data size " << sink->secondaryCodec->GetOptimalDataFrameSize(FALSE)); return FALSE; } @@ -516,7 +520,7 @@ void OpalMediaPatch::SetCommandNotifier(const PNotifier & notifier, BOOL fromSin void OpalMediaPatch::Main() { - PTRACE(3, "Patch\tThread started for " << *this); + PTRACE(4, "Patch\tThread started for " << *this); PINDEX i; inUse.Wait(); @@ -568,7 +572,7 @@ void OpalMediaPatch::Main() sourceFrame = emptyFrame; } - PTRACE(3, "Patch\tThread ended for " << *this); + PTRACE(4, "Patch\tThread ended for " << *this); } diff --git a/src/opal/pcss.cxx b/src/opal/pcss.cxx index 00fd8fda..ea89e7f8 100644 --- a/src/opal/pcss.cxx +++ b/src/opal/pcss.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.44 2007/04/04 02:12:01 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.43 2007/04/03 07:59:14 rjongbloed * Warning: API change to PCSS callbacks: * changed return on OnShowIncoming to BOOL, now agrees with @@ -246,13 +250,13 @@ OpalPCSSEndPoint::OpalPCSSEndPoint(OpalManager & mgr, const char * prefix) soundChannelBuffers = 2; #endif - PTRACE(3, "PCSS\tCreated PC sound system endpoint."); + PTRACE(4, "PCSS\tCreated PC sound system endpoint."); } OpalPCSSEndPoint::~OpalPCSSEndPoint() { - PTRACE(3, "PCSS\tDeleted PC sound system endpoint."); + PTRACE(4, "PCSS\tDeleted PC sound system endpoint."); } @@ -428,13 +432,13 @@ OpalPCSSConnection::OpalPCSSConnection(OpalCall & call, silenceDetector = new OpalPCM16SilenceDetector; echoCanceler = new OpalEchoCanceler; - PTRACE(3, "PCSS\tCreated PC sound system connection with token '" << callToken << "'"); + PTRACE(4, "PCSS\tCreated PC sound system connection with token '" << callToken << "'"); } OpalPCSSConnection::~OpalPCSSConnection() { - PTRACE(3, "PCSS\tDeleted PC sound system connection."); + PTRACE(4, "PCSS\tDeleted PC sound system connection."); } @@ -448,7 +452,7 @@ BOOL OpalPCSSConnection::SetUpConnection() return FALSE; } - PTRACE(2, "PCSS\tOutgoing call routed to " << ownerCall.GetPartyB() << " for " << *this); + PTRACE(3, "PCSS\tOutgoing call routed to " << ownerCall.GetPartyB() << " for " << *this); if (!ownerCall.OnSetUp(*this)) { Release(EndedByNoAccept); return FALSE; diff --git a/src/opal/transports.cxx b/src/opal/transports.cxx index 3210fb1f..0c4306d8 100644 --- a/src/opal/transports.cxx +++ b/src/opal/transports.cxx @@ -29,6 +29,10 @@ * http://www.jfcom.mil/about/abt_j9.htm * * $Log$ + * Revision 2.76 2007/04/04 02:12:01 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.75 2007/03/29 07:07:23 rjongbloed * Fixed deadlock in UDP multi-interface connect algorithm, and getting a SIP retry before completion. * @@ -1615,7 +1619,7 @@ BOOL OpalTransportTCP::ReadPDU(PBYTEArray & pdu) if (ok) { PINDEX packetLength = ((header[1] << 8)|header[2]); if (packetLength < 4) { - PTRACE(1, "H323TCP\tDwarf PDU received (length " << packetLength << ")"); + PTRACE(2, "H323TCP\tDwarf PDU received (length " << packetLength << ")"); ok = FALSE; } else { packetLength -= 4; @@ -1679,7 +1683,7 @@ BOOL OpalTransportTCP::OnOpen() } #endif - PTRACE(1, "OpalTCP\tStarted connection to " + PTRACE(3, "OpalTCP\tStarted connection to " << remoteAddress << ':' << remotePort << " (if=" << localAddress << ':' << localPort << ')'); @@ -1819,10 +1823,10 @@ BOOL OpalTransportUDP::Connect() if (remoteAddress == 0) { remoteAddress = INADDR_BROADCAST; - PTRACE(2, "OpalUDP\tBroadcast connect to port " << remotePort); + PTRACE(3, "OpalUDP\tBroadcast connect to port " << remotePort); } else { - PTRACE(2, "OpalUDP\tStarted connect to " << remoteAddress << ':' << remotePort); + PTRACE(3, "OpalUDP\tStarted connect to " << remoteAddress << ':' << remotePort); } OpalManager & manager = endpoint.GetManager(); @@ -2085,7 +2089,7 @@ BOOL OpalTransportUDP::Read(void * buffer, PINDEX length) if (remoteAddress *= address) return TRUE; - PTRACE(1, "UDP\tReceived PDU from incorrect host: " << address << ':' << port); + PTRACE(2, "UDP\tReceived PDU from incorrect host: " << address << ':' << port); } } @@ -2304,7 +2308,7 @@ BOOL OpalTransportTCPS::OnOpen() } #endif - PTRACE(1, "OpalTCPS\tStarted connection to " + PTRACE(3, "OpalTCPS\tStarted connection to " << remoteAddress << ':' << remotePort << " (if=" << localAddress << ':' << localPort << ')'); diff --git a/src/rtp/jitter.cxx b/src/rtp/jitter.cxx index 48a8eb75..e97e2071 100644 --- a/src/rtp/jitter.cxx +++ b/src/rtp/jitter.cxx @@ -27,6 +27,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.19 2007/04/04 02:12:01 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.18 2007/04/02 05:51:33 rjongbloed * Tidied some trace logs to assure all have a category (bit before a tab character) set. * @@ -370,7 +374,7 @@ OpalJitterBuffer::OpalJitterBuffer(unsigned minJitterDelay, freeFrames = frame; } - PTRACE(2, "RTP\tOpal jitter buffer created:" << *this << " obj=" << this); + PTRACE(4, "RTP\tOpal jitter buffer created:" << *this << " obj=" << this); #if PTRACING && !defined(NO_ANALYSER) analyser = new RTP_JitterBufferAnalyser; @@ -404,7 +408,7 @@ OpalJitterBuffer::~OpalJitterBuffer() delete jitterThread; jitterThread = NULL; } else { - PTRACE(3, "RTP\tJitter buffer thread is null, when the OpalJitterBuffer destructor runs"); + PTRACE(1, "RTP\tJitter buffer thread is null, when the OpalJitterBuffer destructor runs"); } } bufferMutex.Wait(); @@ -481,7 +485,7 @@ void OpalJitterBuffer::SetDelay(unsigned minJitterDelay, unsigned maxJitterDelay shuttingDown = FALSE; preBuffering = TRUE; - PTRACE(2, "RTP\tJitter buffer restarted:" << *this); + PTRACE(3, "RTP\tJitter buffer restarted:" << *this); jitterThread->Restart(); } } @@ -514,7 +518,7 @@ void OpalJitterBuffer::JitterThreadMain(PThread &, INT) OpalJitterBuffer::Entry * currentReadFrame; BOOL markerWarning; - PTRACE(3, "RTP\tJitter RTP receive thread started: " << this); + PTRACE(4, "RTP\tJitter RTP receive thread started: " << this); if (Init(currentReadFrame, markerWarning)) { @@ -529,7 +533,7 @@ void OpalJitterBuffer::JitterThreadMain(PThread &, INT) DeInit(currentReadFrame, markerWarning); } - PTRACE(3, "RTP\tJitter RTP receive thread finished: " << this); + PTRACE(4, "RTP\tJitter RTP receive thread finished: " << this); } //void OpalJitterBuffer::Main() @@ -619,7 +623,7 @@ BOOL OpalJitterBuffer::OnRead(OpalJitterBuffer::Entry * & currentReadFrame, BOOL currentReadFrame->SetMarker(FALSE); if (!markerWarning && consecutiveMarkerBits == maxConsecutiveMarkerBits) { markerWarning = TRUE; - PTRACE(3, "RTP\tEvery packet has Marker bit, ignoring them from this client!"); + PTRACE(2, "RTP\tEvery packet has Marker bit, ignoring them from this client!"); } } diff --git a/src/rtp/rtp.cxx b/src/rtp/rtp.cxx index 5ba41488..e0685acc 100644 --- a/src/rtp/rtp.cxx +++ b/src/rtp/rtp.cxx @@ -27,6 +27,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.59 2007/04/04 02:12:01 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.58 2007/04/02 05:51:34 rjongbloed * Tidied some trace logs to assure all have a category (bit before a tab character) set. * @@ -958,23 +962,23 @@ RTP_Session::RTP_Session( RTP_Session::~RTP_Session() { PTRACE_IF(2, packetsSent != 0 || packetsReceived != 0, - "RTP\tFinal statistics:\n" - " packetsSent = " << packetsSent << "\n" - " octetsSent = " << octetsSent << "\n" - " averageSendTime = " << averageSendTime << "\n" - " maximumSendTime = " << maximumSendTime << "\n" - " minimumSendTime = " << minimumSendTime << "\n" - " packetsReceived = " << packetsReceived << "\n" - " octetsReceived = " << octetsReceived << "\n" - " packetsLost = " << packetsLost << "\n" - " packetsTooLate = " << GetPacketsTooLate() << "\n" - " packetsOutOfOrder = " << packetsOutOfOrder << "\n" - " averageReceiveTime= " << averageReceiveTime << "\n" - " maximumReceiveTime= " << maximumReceiveTime << "\n" - " minimumReceiveTime= " << minimumReceiveTime << "\n" - " averageJitter = " << (jitterLevel >> 7) << "\n" - " maximumJitter = " << (maximumJitterLevel >> 7) - ); + "RTP\tFinal statistics:\n" + " packetsSent = " << packetsSent << "\n" + " octetsSent = " << octetsSent << "\n" + " averageSendTime = " << averageSendTime << "\n" + " maximumSendTime = " << maximumSendTime << "\n" + " minimumSendTime = " << minimumSendTime << "\n" + " packetsReceived = " << packetsReceived << "\n" + " octetsReceived = " << octetsReceived << "\n" + " packetsLost = " << packetsLost << "\n" + " packetsTooLate = " << GetPacketsTooLate() << "\n" + " packetsOutOfOrder = " << packetsOutOfOrder << "\n" + " averageReceiveTime= " << averageReceiveTime << "\n" + " maximumReceiveTime= " << maximumReceiveTime << "\n" + " minimumReceiveTime= " << minimumReceiveTime << "\n" + " averageJitter = " << (jitterLevel >> 7) << "\n" + " maximumJitter = " << (maximumJitterLevel >> 7) + ); delete jitter; if (autoDeleteUserData) delete userData; @@ -1069,9 +1073,9 @@ void RTP_Session::SetUserData(RTP_UserData * data, BOOL autoDelete) void RTP_Session::SetJitterBufferSize(unsigned minJitterDelay, - unsigned maxJitterDelay, - unsigned timeUnits, - PINDEX stackSize) + unsigned maxJitterDelay, + unsigned timeUnits, + PINDEX stackSize) { if (minJitterDelay == 0 && maxJitterDelay == 0) { delete jitter; @@ -1148,13 +1152,13 @@ void RTP_Session::AddReceiverReport(RTP_ControlFrame::ReceiverReport & receiver) receiver.dlsr = 0; PTRACE(3, "RTP\tSentReceiverReport:" - " ssrc=" << receiver.ssrc - << " fraction=" << (unsigned)receiver.fraction - << " lost=" << receiver.GetLostPackets() - << " last_seq=" << receiver.last_seq - << " jitter=" << receiver.jitter - << " lsr=" << receiver.lsr - << " dlsr=" << receiver.dlsr); + " ssrc=" << receiver.ssrc + << " fraction=" << (unsigned)receiver.fraction + << " lost=" << receiver.GetLostPackets() + << " last_seq=" << receiver.last_seq + << " jitter=" << receiver.jitter + << " lsr=" << receiver.lsr + << " dlsr=" << receiver.dlsr); } @@ -1166,15 +1170,15 @@ RTP_Session::SendReceiveStatus RTP_Session::OnSendData(RTP_DataFrame & frame) frame.SetSyncSource(syncSourceOut); PTRACE_IF(2, packetsSent == 0, "RTP\tFirst sent data:" - " ver=" << frame.GetVersion() - << " pt=" << frame.GetPayloadType() - << " psz=" << frame.GetPayloadSize() - << " m=" << frame.GetMarker() - << " x=" << frame.GetExtension() - << " seq=" << frame.GetSequenceNumber() - << " ts=" << frame.GetTimestamp() - << " src=" << frame.GetSyncSource() - << " ccnt=" << frame.GetContribSrcCount()); + " ver=" << frame.GetVersion() + << " pt=" << frame.GetPayloadType() + << " psz=" << frame.GetPayloadSize() + << " m=" << frame.GetMarker() + << " x=" << frame.GetExtension() + << " seq=" << frame.GetSequenceNumber() + << " ts=" << frame.GetTimestamp() + << " src=" << frame.GetSyncSource() + << " ccnt=" << frame.GetContribSrcCount()); if (packetsSent != 0 && !frame.GetMarker()) { // Only do statistics on subsequent packets @@ -1214,13 +1218,13 @@ RTP_Session::SendReceiveStatus RTP_Session::OnSendData(RTP_DataFrame & frame) maximumSendTimeAccum = 0; minimumSendTimeAccum = 0xffffffff; - PTRACE(2, "RTP\tTransmit statistics: " - " packets=" << packetsSent << - " octets=" << octetsSent << - " avgTime=" << averageSendTime << - " maxTime=" << maximumSendTime << - " minTime=" << minimumSendTime - ); + PTRACE(3, "RTP\tTransmit statistics: " + " packets=" << packetsSent << + " octets=" << octetsSent << + " avgTime=" << averageSendTime << + " maxTime=" << maximumSendTime << + " minTime=" << minimumSendTime + ); if (userData != NULL) userData->OnTxStatistics(*this); @@ -1263,26 +1267,26 @@ RTP_Session::SendReceiveStatus RTP_Session::OnReceiveData(RTP_DataFrame & frame) // Check packet sequence numbers if (packetsReceived == 0) { expectedSequenceNumber = (WORD)(frame.GetSequenceNumber() + 1); - PTRACE(2, "RTP\tFirst receive data:" - " ver=" << frame.GetVersion() - << " pt=" << frame.GetPayloadType() - << " psz=" << frame.GetPayloadSize() - << " m=" << frame.GetMarker() - << " x=" << frame.GetExtension() - << " seq=" << frame.GetSequenceNumber() - << " ts=" << frame.GetTimestamp() - << " src=" << frame.GetSyncSource() - << " ccnt=" << frame.GetContribSrcCount()); + PTRACE(3, "RTP\tFirst receive data:" + " ver=" << frame.GetVersion() + << " pt=" << frame.GetPayloadType() + << " psz=" << frame.GetPayloadSize() + << " m=" << frame.GetMarker() + << " x=" << frame.GetExtension() + << " seq=" << frame.GetSequenceNumber() + << " ts=" << frame.GetTimestamp() + << " src=" << frame.GetSyncSource() + << " ccnt=" << frame.GetContribSrcCount()); } else { if (!ignoreOtherSources && frame.GetSyncSource() != syncSourceIn) { if (allowSyncSourceInChange) { - syncSourceIn = frame.GetSyncSource(); - allowSyncSourceInChange = FALSE; + syncSourceIn = frame.GetSyncSource(); + allowSyncSourceInChange = FALSE; } else { - PTRACE(2, "RTP\tPacket from SSRC=" << frame.GetSyncSource() << " ignored, expecting SSRC=" << syncSourceIn); - return e_IgnorePacket; // Non fatal error, just ignore + PTRACE(2, "RTP\tPacket from SSRC=" << frame.GetSyncSource() << " ignored, expecting SSRC=" << syncSourceIn); + return e_IgnorePacket; // Non fatal error, just ignore } } @@ -1292,25 +1296,25 @@ RTP_Session::SendReceiveStatus RTP_Session::OnReceiveData(RTP_DataFrame & frame) consecutiveOutOfOrderPackets = 0; // Only do statistics on packets after first received in talk burst if (!frame.GetMarker()) { - DWORD diff = (tick - lastReceivedPacketTime).GetInterval(); - - averageReceiveTimeAccum += diff; - if (diff > maximumReceiveTimeAccum) - maximumReceiveTimeAccum = diff; - if (diff < minimumReceiveTimeAccum) - minimumReceiveTimeAccum = diff; - rxStatisticsCount++; - - // The following has the implicit assumption that something that has jitter - // is an audio codec and thus is in 8kHz timestamp units. - diff *= 8; - long variance = diff - lastTransitTime; - lastTransitTime = diff; - if (variance < 0) - variance = -variance; - jitterLevel += variance - ((jitterLevel+8) >> 4); - if (jitterLevel > maximumJitterLevel) - maximumJitterLevel = jitterLevel; + DWORD diff = (tick - lastReceivedPacketTime).GetInterval(); + + averageReceiveTimeAccum += diff; + if (diff > maximumReceiveTimeAccum) + maximumReceiveTimeAccum = diff; + if (diff < minimumReceiveTimeAccum) + minimumReceiveTimeAccum = diff; + rxStatisticsCount++; + + // The following has the implicit assumption that something that has jitter + // is an audio codec and thus is in 8kHz timestamp units. + diff *= 8; + long variance = diff - lastTransitTime; + lastTransitTime = diff; + if (variance < 0) + variance = -variance; + jitterLevel += variance - ((jitterLevel+8) >> 4); + if (jitterLevel > maximumJitterLevel) + maximumJitterLevel = jitterLevel; } } else if (allowSequenceChange) { @@ -1318,27 +1322,27 @@ RTP_Session::SendReceiveStatus RTP_Session::OnReceiveData(RTP_DataFrame & frame) allowSequenceChange = FALSE; } else if (sequenceNumber < expectedSequenceNumber) { - PTRACE(3, "RTP\tOut of order packet, received " - << sequenceNumber << " expected " << expectedSequenceNumber - << " ssrc=" << syncSourceIn); + PTRACE(2, "RTP\tOut of order packet, received " + << sequenceNumber << " expected " << expectedSequenceNumber + << " ssrc=" << syncSourceIn); packetsOutOfOrder++; // Check for Cisco bug where sequence numbers suddenly start incrementing // from a different base. if (++consecutiveOutOfOrderPackets > 10) { expectedSequenceNumber = (WORD)(sequenceNumber + 1); - PTRACE(1, "RTP\tAbnormal change of sequence numbers, adjusting to expect " << expectedSequenceNumber << " ssrc=" << syncSourceIn); + PTRACE(2, "RTP\tAbnormal change of sequence numbers, adjusting to expect " << expectedSequenceNumber << " ssrc=" << syncSourceIn); } if (ignoreOutOfOrderPackets) - return e_IgnorePacket; // Non fatal error, just ignore + return e_IgnorePacket; // Non fatal error, just ignore } else { unsigned dropped = sequenceNumber - expectedSequenceNumber; packetsLost += dropped; packetsLostSinceLastRR += dropped; - PTRACE(3, "RTP\tDropped " << dropped << " packet(s) at " << sequenceNumber - << ", ssrc=" << syncSourceIn); + PTRACE(2, "RTP\tDropped " << dropped << " packet(s) at " << sequenceNumber + << ", ssrc=" << syncSourceIn); expectedSequenceNumber = (WORD)(sequenceNumber + 1); consecutiveOutOfOrderPackets = 0; } @@ -1370,17 +1374,17 @@ RTP_Session::SendReceiveStatus RTP_Session::OnReceiveData(RTP_DataFrame & frame) minimumReceiveTimeAccum = 0xffffffff; PTRACE(4, "RTP\tReceive statistics: " - " packets=" << packetsReceived << - " octets=" << octetsReceived << - " lost=" << packetsLost << - " tooLate=" << GetPacketsTooLate() << - " order=" << packetsOutOfOrder << - " avgTime=" << averageReceiveTime << - " maxTime=" << maximumReceiveTime << - " minTime=" << minimumReceiveTime << - " jitter=" << (jitterLevel >> 7) << - " maxJitter=" << (maximumJitterLevel >> 7) - ); + " packets=" << packetsReceived << + " octets=" << octetsReceived << + " lost=" << packetsLost << + " tooLate=" << GetPacketsTooLate() << + " order=" << packetsOutOfOrder << + " avgTime=" << averageReceiveTime << + " maxTime=" << maximumReceiveTime << + " minTime=" << minimumReceiveTime << + " jitter=" << (jitterLevel >> 7) << + " maxJitter=" << (maximumJitterLevel >> 7) + ); if (userData != NULL) userData->OnRxStatistics(*this); @@ -1428,11 +1432,11 @@ BOOL RTP_Session::InsertReportPacket(RTP_ControlFrame & report) sender->osent = octetsSent; PTRACE(3, "RTP\tSentSenderReport: " - " ssrc=" << syncSourceOut - << " ntp=" << sender->ntp_sec << '.' << sender->ntp_frac - << " rtp=" << sender->rtp_ts - << " psent=" << sender->psent - << " osent=" << sender->osent); + " ssrc=" << syncSourceOut + << " ntp=" << sender->ntp_sec << '.' << sender->ntp_frac + << " rtp=" << sender->rtp_ts + << " psent=" << sender->psent + << " osent=" << sender->osent); if (syncSourceIn != 0) { report.SetPayloadSize(4 + sizeof(RTP_ControlFrame::SenderReport) + sizeof(RTP_ControlFrame::ReceiverReport)); @@ -1471,7 +1475,7 @@ BOOL RTP_Session::SendReport() InsertReportPacket(report); // Add the SDES part to compound RTCP packet - PTRACE(2, "RTP\tSending SDES: " << canonicalName); + PTRACE(3, "RTP\tSending SDES: " << canonicalName); report.StartNewPacket(); report.SetCount(0); // will be incremented automatically @@ -1524,65 +1528,64 @@ RTP_Session::SendReceiveStatus RTP_Session::OnReceiveControl(RTP_ControlFrame & switch (frame.GetPayloadType()) { case RTP_ControlFrame::e_SenderReport : if (size >= sizeof(RTP_ControlFrame::SenderReport)) { - SenderReport sender; - sender.sourceIdentifier = *(const PUInt32b *)payload; - const RTP_ControlFrame::SenderReport & sr = *(const RTP_ControlFrame::SenderReport *)(payload+4); - sender.realTimestamp = PTime(sr.ntp_sec-SecondsFrom1900to1970, sr.ntp_frac/4294); - sender.rtpTimestamp = sr.rtp_ts; - sender.packetsSent = sr.psent; - sender.octetsSent = sr.osent; - OnRxSenderReport(sender, - BuildReceiverReportArray(frame, sizeof(RTP_ControlFrame::SenderReport))); + SenderReport sender; + sender.sourceIdentifier = *(const PUInt32b *)payload; + const RTP_ControlFrame::SenderReport & sr = *(const RTP_ControlFrame::SenderReport *)(payload+4); + sender.realTimestamp = PTime(sr.ntp_sec-SecondsFrom1900to1970, sr.ntp_frac/4294); + sender.rtpTimestamp = sr.rtp_ts; + sender.packetsSent = sr.psent; + sender.octetsSent = sr.osent; + OnRxSenderReport(sender, BuildReceiverReportArray(frame, sizeof(RTP_ControlFrame::SenderReport))); } else { - PTRACE(2, "RTP\tSenderReport packet truncated"); + PTRACE(2, "RTP\tSenderReport packet truncated"); } break; case RTP_ControlFrame::e_ReceiverReport : if (size >= 4) - OnRxReceiverReport(*(const PUInt32b *)payload, - BuildReceiverReportArray(frame, sizeof(PUInt32b))); + OnRxReceiverReport(*(const PUInt32b *)payload, + BuildReceiverReportArray(frame, sizeof(PUInt32b))); else { - PTRACE(2, "RTP\tReceiverReport packet truncated"); + PTRACE(2, "RTP\tReceiverReport packet truncated"); } break; case RTP_ControlFrame::e_SourceDescription : if (size >= frame.GetCount()*sizeof(RTP_ControlFrame::SourceDescription)) { SourceDescriptionArray descriptions; - const RTP_ControlFrame::SourceDescription * sdes = (const RTP_ControlFrame::SourceDescription *)payload; + const RTP_ControlFrame::SourceDescription * sdes = (const RTP_ControlFrame::SourceDescription *)payload; PINDEX srcIdx; - for (srcIdx = 0; srcIdx < (PINDEX)frame.GetCount(); srcIdx++) { - descriptions.SetAt(srcIdx, new SourceDescription(sdes->src)); - const RTP_ControlFrame::SourceDescription::Item * item = sdes->item; + for (srcIdx = 0; srcIdx < (PINDEX)frame.GetCount(); srcIdx++) { + descriptions.SetAt(srcIdx, new SourceDescription(sdes->src)); + const RTP_ControlFrame::SourceDescription::Item * item = sdes->item; unsigned uiSizeCurrent = 0; /* current size of the items already parsed */ - while ((item != NULL) && (item->type != RTP_ControlFrame::e_END)) { - descriptions[srcIdx].items.SetAt(item->type, PString(item->data, item->length)); - uiSizeCurrent += item->GetLengthTotal(); - // PTRACE(2,"RTP\tSourceDescription item " << item << ", current size = " << uiSizeCurrent); + while ((item != NULL) && (item->type != RTP_ControlFrame::e_END)) { + descriptions[srcIdx].items.SetAt(item->type, PString(item->data, item->length)); + uiSizeCurrent += item->GetLengthTotal(); + PTRACE(4,"RTP\tSourceDescription item " << item << ", current size = " << uiSizeCurrent); - /* avoid reading where GetNextItem() shall not */ + /* avoid reading where GetNextItem() shall not */ if (uiSizeCurrent >= size){ - PTRACE(2,"RTP\tSourceDescription end of items"); - item = NULL; - break; - } else { - item = item->GetNextItem(); - } + PTRACE(4,"RTP\tSourceDescription end of items"); + item = NULL; + break; + } else { + item = item->GetNextItem(); + } } /* RTP_ControlFrame::e_END doesn't have a length field, so do NOT call item->GetNextItem() otherwise it reads over the buffer */ - if((item == NULL) || + if((item == NULL) || (item->type == RTP_ControlFrame::e_END) || ((sdes = (const RTP_ControlFrame::SourceDescription *)item->GetNextItem()) == NULL)){ - break; + break; } } - OnRxSourceDescription(descriptions); + OnRxSourceDescription(descriptions); } else { - PTRACE(2, "RTP\tSourceDescription packet truncated"); + PTRACE(2, "RTP\tSourceDescription packet truncated"); } break; @@ -1606,10 +1609,10 @@ RTP_Session::SendReceiveStatus RTP_Session::OnReceiveControl(RTP_ControlFrame & OnRxGoodbye(sources, str); } else { - PTRACE(2, "RTP\tGoodbye packet truncated"); + PTRACE(2, "RTP\tGoodbye packet truncated"); } if (closeOnBye) { - PTRACE(2, "RTP\tGoodbye packet closing transport"); + PTRACE(3, "RTP\tGoodbye packet closing transport"); return e_AbortTransport; } break; @@ -1617,12 +1620,12 @@ RTP_Session::SendReceiveStatus RTP_Session::OnReceiveControl(RTP_ControlFrame & } case RTP_ControlFrame::e_ApplDefined : if (size >= 4) { - PString str((const char *)(payload+4), 4); - OnRxApplDefined(str, frame.GetCount(), *(const PUInt32b *)payload, - payload+8, frame.GetPayloadSize()-8); + PString str((const char *)(payload+4), 4); + OnRxApplDefined(str, frame.GetCount(), *(const PUInt32b *)payload, + payload+8, frame.GetPayloadSize()-8); } else { - PTRACE(2, "RTP\tApplDefined packet truncated"); + PTRACE(2, "RTP\tApplDefined packet truncated"); } break; @@ -1636,23 +1639,31 @@ RTP_Session::SendReceiveStatus RTP_Session::OnReceiveControl(RTP_ControlFrame & void RTP_Session::OnRxSenderReport(const SenderReport & PTRACE_PARAM(sender), - const ReceiverReportArray & PTRACE_PARAM(reports)) + const ReceiverReportArray & PTRACE_PARAM(reports)) { #if PTRACING - PTRACE(3, "RTP\tOnRxSenderReport: " << sender); - for (PINDEX i = 0; i < reports.GetSize(); i++) - PTRACE(3, "RTP\tOnRxSenderReport RR: " << reports[i]); + if (PTrace::CanTrace(3)) { + ostream & strm = PTrace::Begin(2, __FILE__, __LINE__); + strm << "RTP\tOnRxSenderReport: " << sender << '\n'; + for (PINDEX i = 0; i < reports.GetSize(); i++) + strm << " RR: " << reports[i] << '\n'; + strm << PTrace::End; + } #endif } void RTP_Session::OnRxReceiverReport(DWORD PTRACE_PARAM(src), - const ReceiverReportArray & PTRACE_PARAM(reports)) + const ReceiverReportArray & PTRACE_PARAM(reports)) { #if PTRACING - PTRACE(3, "RTP\tOnReceiverReport: ssrc=" << src); - for (PINDEX i = 0; i < reports.GetSize(); i++) - PTRACE(3, "RTP\tOnReceiverReport RR: " << reports[i]); + if (PTrace::CanTrace(3)) { + ostream & strm = PTrace::Begin(2, __FILE__, __LINE__); + strm << "RTP\tOnReceiverReport: ssrc=" << src << '\n'; + for (PINDEX i = 0; i < reports.GetSize(); i++) + strm << " RR: " << reports[i] << '\n'; + strm << PTrace::End; + } #endif } @@ -1660,8 +1671,13 @@ void RTP_Session::OnRxReceiverReport(DWORD PTRACE_PARAM(src), void RTP_Session::OnRxSourceDescription(const SourceDescriptionArray & PTRACE_PARAM(description)) { #if PTRACING - for (PINDEX i = 0; i < description.GetSize(); i++) - PTRACE(3, "RTP\tOnSourceDescription: " << description[i]); + if (PTrace::CanTrace(3)) { + ostream & strm = PTrace::Begin(2, __FILE__, __LINE__); + strm << "RTP\tOnSourceDescription: " << description.GetSize() << " entries"; + for (PINDEX i = 0; i < description.GetSize(); i++) + strm << "\n " << description[i]; + strm << PTrace::End; + } #endif } @@ -1673,11 +1689,11 @@ void RTP_Session::OnRxGoodbye(const PDWORDArray & PTRACE_PARAM(src), const PStri void RTP_Session::OnRxApplDefined(const PString & PTRACE_PARAM(type), - unsigned PTRACE_PARAM(subtype), DWORD PTRACE_PARAM(src), - const BYTE * /*data*/, PINDEX PTRACE_PARAM(size)) + unsigned PTRACE_PARAM(subtype), DWORD PTRACE_PARAM(src), + const BYTE * /*data*/, PINDEX PTRACE_PARAM(size)) { PTRACE(3, "RTP\tOnApplDefined: \"" << type << "\"-" << subtype - << " " << src << " [" << size << ']'); + << " " << src << " [" << size << ']'); } @@ -1949,7 +1965,7 @@ BOOL RTP_UDP::Open(PIPSocket::Address _localAddress, controlSocket->GetLocalAddress(localAddress, localControlPort); } else { - PTRACE(1, "RTP\tSTUN could not create RTP/RTCP socket pair; trying to create RTP socket anyway."); + PTRACE(2, "RTP\tSTUN could not create RTP/RTCP socket pair; trying to create RTP socket anyway."); if (stun->CreateSocket(dataSocket)) { dataSocket->GetLocalAddress(localAddress, localDataPort); } @@ -1998,7 +2014,7 @@ BOOL RTP_UDP::Open(PIPSocket::Address _localAddress, if (canonicalName.Find('@') == P_MAX_INDEX) canonicalName += '@' + GetLocalHostName(); - PTRACE(2, "RTP_UDP\tSession " << sessionID << " created: " + PTRACE(3, "RTP_UDP\tSession " << sessionID << " created: " << localAddress << ':' << localDataPort << '-' << localControlPort << " ssrc=" << syncSourceOut); @@ -2051,7 +2067,7 @@ PString RTP_UDP::GetLocalHostName() BOOL RTP_UDP::SetRemoteSocketInfo(PIPSocket::Address address, WORD port, BOOL isDataPort) { if (remoteIsNAT) { - PTRACE(3, "RTP_UDP\tIgnoring remote socket info as remote is behind NAT"); + PTRACE(2, "RTP_UDP\tIgnoring remote socket info as remote is behind NAT"); return TRUE; } @@ -2128,7 +2144,7 @@ BOOL RTP_UDP::ReadData(RTP_DataFrame & frame, BOOL loop) break; case PSocket::Interrupted: - PTRACE(3, "RTP_UDP\tSession " << sessionID << ", Interrupted."); + PTRACE(2, "RTP_UDP\tSession " << sessionID << ", Interrupted."); return FALSE; default : @@ -2201,16 +2217,16 @@ RTP_Session::SendReceiveStatus RTP_UDP::ReadDataOrControlPDU(PUDPSocket & socket } if (!remoteTransmitAddress.IsValid()) - remoteTransmitAddress = addr; + remoteTransmitAddress = addr; else if (allowRemoteTransmitAddressChange && remoteAddress == addr) { - remoteTransmitAddress = addr; - allowRemoteTransmitAddressChange = FALSE; + remoteTransmitAddress = addr; + allowRemoteTransmitAddressChange = FALSE; } else if (remoteTransmitAddress != addr && !allowRemoteTransmitAddressChange && !ignoreOtherSources) { - PTRACE(1, "RTP_UDP\tSession " << sessionID << ", " - << channelName << " PDU from incorrect host, " - " is " << addr << " should be " << remoteTransmitAddress); - return RTP_Session::e_IgnorePacket; + PTRACE(2, "RTP_UDP\tSession " << sessionID << ", " + << channelName << " PDU from incorrect host, " + " is " << addr << " should be " << remoteTransmitAddress); + return RTP_Session::e_IgnorePacket; } } if (remoteAddress.IsValid() && !appliedQOS) diff --git a/src/sip/sdp.cxx b/src/sip/sdp.cxx index 60d466d7..6dccd79d 100644 --- a/src/sip/sdp.cxx +++ b/src/sip/sdp.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.44 2007/04/04 02:12:02 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.43 2007/03/13 02:17:49 csoutheren * Remove warnings/errors when compiling with various turned off * @@ -218,8 +222,8 @@ #define SIP_DEFAULT_SESSION_NAME "Opal SIP Session" -#define SDP_MEDIA_TRANSPORT "RTP/AVP" -#define SDP_MEDIA_TRANSPORT_UDPTL "udptl" +#define SDP_MEDIA_TRANSPORT "RTP/AVP" +#define SDP_MEDIA_TRANSPORT_UDPTL "udptl" #define new PNEW @@ -470,7 +474,7 @@ ostream & operator<<(ostream & out, SDPMediaDescription::MediaType type) SDPMediaDescription::SDPMediaDescription(const OpalTransportAddress & address, MediaType _mediaType) : mediaType(_mediaType), transportAddress(address), - packetTime(0) + packetTime(0) { switch (mediaType) { case Audio: @@ -520,7 +524,7 @@ BOOL SDPMediaDescription::Decode(const PString & str) if (pos == P_MAX_INDEX) portCount = 1; else { - PTRACE(1, "SDP\tMedia header contains port count - " << portStr); + PTRACE(3, "SDP\tMedia header contains port count - " << portStr); portCount = (WORD)portStr.Mid(pos+1).AsUnsigned(); portStr = portStr.Left(pos); } @@ -532,7 +536,7 @@ BOOL SDPMediaDescription::Decode(const PString & str) PTRACE(4, "SDP\tMedia session port=" << port); if ((transport != SDP_MEDIA_TRANSPORT) && (transport != SDP_MEDIA_TRANSPORT_UDPTL)) { - PTRACE(1, "SDP\tMedia session has only " << tokens.GetSize() << " elements"); + PTRACE(2, "SDP\tMedia session has only " << tokens.GetSize() << " elements"); return FALSE; } @@ -751,8 +755,8 @@ OpalMediaFormatList SDPMediaDescription::GetMediaFormats(unsigned sessionID) con if (opalFormat.GetDefaultSessionID() == sessionID && opalFormat.IsValidForProtocol("sip") && opalFormat.GetEncodingName() != NULL) { - PTRACE(2, "SIP\tRTP payload type " << formats[i].GetPayloadType() << " matched to codec " << opalFormat); - list += opalFormat; + PTRACE(3, "SIP\tRTP payload type " << formats[i].GetPayloadType() << " matched to codec " << opalFormat); + list += opalFormat; } } } @@ -771,7 +775,7 @@ void SDPMediaDescription::CreateRTPMap(unsigned sessionID, RTP_DataFrame::Payloa opalFormat.GetDefaultSessionID() == sessionID && opalFormat.GetPayloadType() != formats[i].GetPayloadType()) { map.insert(RTP_DataFrame::PayloadMapType::value_type(opalFormat.GetPayloadType(), formats[i].GetPayloadType())); - PTRACE(2, "SIP\tAdding RTP translation from " << opalFormat.GetPayloadType() << " to " << formats[i].GetPayloadType()); + PTRACE(3, "SDP\tAdding RTP translation from " << opalFormat.GetPayloadType() << " to " << formats[i].GetPayloadType()); } } } @@ -900,8 +904,8 @@ void SDPSessionDescription::PrintOn(ostream & str) const // encode mandatory session information str << "v=" << protocolVersion << "\r\n" "o=" << ownerUsername << ' ' - << ownerSessionId << ' ' - << ownerVersion << ' ' + << ownerSessionId << ' ' + << ownerVersion << ' ' << GetConnectAddressString(ownerAddress) << "\r\n" "s=" << sessionName << "\r\n"; @@ -913,7 +917,7 @@ void SDPSessionDescription::PrintOn(ostream & str) const str << "c=" << GetConnectAddressString(connectionAddress) << "\r\n"; if(bandwidthModifier != "" && bandwidthValue != 0) { - str << "b=" << bandwidthModifier << ":" << bandwidthValue << "\r\n"; + str << "b=" << bandwidthModifier << ":" << bandwidthValue << "\r\n"; } str << "t=" << "0 0" << "\r\n"; @@ -970,7 +974,7 @@ BOOL SDPSessionDescription::Decode(const PString & str) PString value = line.Mid(pos+1).Trim(); if (key.GetLength() == 1) { - // media name and transport address (mandatory) + // media name and transport address (mandatory) if (key[0] == 'm') { currentMedia = new SDPMediaDescription(defaultConnectAddress); if (currentMedia->Decode(value)) { @@ -980,15 +984,15 @@ BOOL SDPSessionDescription::Decode(const PString & str) else delete currentMedia; } - + ///////////////////////////////// // // Session description // ///////////////////////////////// - + else if (currentMedia == NULL) { - PINDEX thePos; + PINDEX thePos; switch (key[0]) { case 'v' : // protocol version (mandatory) protocolVersion = value.AsInteger(); @@ -1011,28 +1015,28 @@ BOOL SDPSessionDescription::Decode(const PString & str) case 'u' : // URI of description case 'e' : // email address case 'p' : // phone number - break; + break; case 'b' : // bandwidth information - thePos = value.Find(':'); - if (thePos != P_MAX_INDEX) { - bandwidthModifier = value.Left(thePos); - bandwidthValue = value.Mid(thePos+1).AsInteger(); - } - break; + thePos = value.Find(':'); + if (thePos != P_MAX_INDEX) { + bandwidthModifier = value.Left(thePos); + bandwidthValue = value.Mid(thePos+1).AsInteger(); + } + break; case 'z' : // time zone adjustments case 'k' : // encryption key case 'r' : // zero or more repeat times break; case 'a' : // zero or more session attribute lines if (value *= "sendonly") - SetDirection (SDPMediaDescription::SendOnly); - else if (value *= "recvonly") - SetDirection (SDPMediaDescription::RecvOnly); - else if (value *= "sendrecv") - SetDirection (SDPMediaDescription::SendRecv); - else if (value *= "inactive") - SetDirection (SDPMediaDescription::Inactive); - break; + SetDirection (SDPMediaDescription::SendOnly); + else if (value *= "recvonly") + SetDirection (SDPMediaDescription::RecvOnly); + else if (value *= "sendrecv") + SetDirection (SDPMediaDescription::SendRecv); + else if (value *= "inactive") + SetDirection (SDPMediaDescription::Inactive); + break; default: PTRACE(1, "SDP\tUnknown session information key " << key[0]); @@ -1044,7 +1048,7 @@ BOOL SDPSessionDescription::Decode(const PString & str) // media information // ///////////////////////////////// - + else { switch (key[0]) { case 'i' : // media title @@ -1056,7 +1060,7 @@ BOOL SDPSessionDescription::Decode(const PString & str) break; case 'a' : // zero or more media attribute lines - currentMedia->SetAttribute(value); + currentMedia->SetAttribute(value); break; default: @@ -1076,7 +1080,7 @@ void SDPSessionDescription::ParseOwner(const PString & str) PStringArray tokens = str.Tokenise(" "); if (tokens.GetSize() != 6) { - PTRACE(1, "SDP\tOrigin has " << tokens.GetSize() << " elements"); + PTRACE(2, "SDP\tOrigin has incorrect number of elements (" << tokens.GetSize() << ')'); } else { ownerUsername = tokens[0]; @@ -1107,9 +1111,9 @@ SDPMediaDescription::Direction SDPSessionDescription::GetDirection(unsigned sess for (i = 0; i < mediaDescriptions.GetSize(); i++) { if ((mediaDescriptions[i].GetMediaType() == SDPMediaDescription::Video && sessionID == OpalMediaFormat::DefaultVideoSessionID) || (mediaDescriptions[i].GetMediaType() == SDPMediaDescription::Audio && sessionID == OpalMediaFormat::DefaultAudioSessionID)) { if (mediaDescriptions[i].GetDirection() != SDPMediaDescription::Undefined) - return mediaDescriptions[i].GetDirection(); + return mediaDescriptions[i].GetDirection(); else - return direction; + return direction; } } diff --git a/src/sip/sipcon.cxx b/src/sip/sipcon.cxx index 2dd02378..e82dd1a2 100644 --- a/src/sip/sipcon.cxx +++ b/src/sip/sipcon.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.213 2007/04/04 02:12:02 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.212 2007/04/03 05:27:30 rjongbloed * Cleaned up somewhat confusing usage of the OnAnswerCall() virtual * function. The name is innaccurate and exists as a legacy from the @@ -934,7 +938,7 @@ SIPConnection::SIPConnection(OpalCall & call, sentTrying = FALSE; - PTRACE(3, "SIP\tCreated connection."); + PTRACE(4, "SIP\tCreated connection."); } @@ -947,7 +951,7 @@ SIPConnection::~SIPConnection() if (pduHandler) delete pduHandler; if (udpTransport) delete udpTransport; - PTRACE(3, "SIP\tDeleted connection."); + PTRACE(4, "SIP\tDeleted connection."); } // @@ -1146,7 +1150,7 @@ BOOL SIPConnection::SetAlerting(const PString & /*calleeName*/, BOOL /*withMedia if (!safeLock.IsLocked()) return FALSE; - PTRACE(2, "SIP\tSetAlerting"); + PTRACE(3, "SIP\tSetAlerting"); if (phase != SetUpPhase) return FALSE; @@ -1184,7 +1188,7 @@ BOOL SIPConnection::SetConnected() return FALSE; } - PTRACE(2, "SIP\tSetConnected"); + PTRACE(3, "SIP\tSetConnected"); SDPSessionDescription sdpOut(GetLocalAddress()); @@ -1374,7 +1378,7 @@ BOOL SIPConnection::OnSendSDPMediaDescription(const SDPSessionDescription & sdpI WORD port; mediaAddress.GetIpAndPort(ip, port); if (rtpSession && !rtpSession->SetRemoteSocketInfo(ip, port, TRUE)) { - PTRACE(1, "SIP\tCannot set remote ports on RTP session"); + PTRACE(2, "SIP\tCannot set remote ports on RTP session"); Release(EndedByTransportFail); delete localMedia; return FALSE; @@ -1604,7 +1608,7 @@ BOOL SIPConnection::SetUpConnection() SIPURL transportAddress = targetAddress; - PTRACE(2, "SIP\tSetUpConnection: " << remotePartyAddress); + PTRACE(3, "SIP\tSetUpConnection: " << remotePartyAddress); // Do a DNS SRV lookup #if P_DNS @@ -1649,7 +1653,7 @@ void SIPConnection::HoldConnection() if (transport == NULL) return; - PTRACE(2, "SIP\tWill put connection on hold"); + PTRACE(3, "SIP\tWill put connection on hold"); SIPTransaction * invite = new SIPInvite(*this, *transport, rtpSessions); if (invite->Start()) { @@ -1676,7 +1680,7 @@ void SIPConnection::RetrieveConnection() if (transport == NULL) return; - PTRACE(2, "SIP\tWill retrieve connection from hold"); + PTRACE(3, "SIP\tWill retrieve connection from hold"); SIPTransaction * invite = new SIPInvite(*this, *transport, rtpSessions); if (invite->Start()) { @@ -1809,7 +1813,7 @@ BOOL SIPConnection::BuildSDP(SDPSessionDescription * & sdp, if (!localAddress.IsEmpty()) localMedia = new SDPMediaDescription(localAddress, SDPMediaDescription::Image); else { - PTRACE(3, "SIP\tRefusing to add SDP media description for session id " << rtpSessionId << " with no transport address"); + PTRACE(2, "SIP\tRefusing to add SDP media description for session id " << rtpSessionId << " with no transport address"); } break; @@ -2169,7 +2173,7 @@ void SIPConnection::OnReceivedINVITE(SIP_PDU & request) if (phase == EstablishedPhase && ((!IsOriginating() && originalInvite != NULL) || (IsOriginating()))) { - PTRACE(2, "SIP\tReceived re-INVITE from " << request.GetURI() << " for " << *this); + PTRACE(3, "SIP\tReceived re-INVITE from " << request.GetURI() << " for " << *this); isReinvite = TRUE; } else @@ -2338,16 +2342,16 @@ void SIPConnection::OnReceivedINVITE(SIP_PDU & request) // indicate the other is to start ringing (but look out for clear calls) if (!OnIncomingConnection(0, NULL)) { - PTRACE(2, "SIP\tOnIncomingConnection failed for INVITE from " << request.GetURI() << " for " << *this); + PTRACE(1, "SIP\tOnIncomingConnection failed for INVITE from " << request.GetURI() << " for " << *this); Release(); return; } - PTRACE(2, "SIP\tOnIncomingConnection succeeded for INVITE from " << request.GetURI() << " for " << *this); + PTRACE(3, "SIP\tOnIncomingConnection succeeded for INVITE from " << request.GetURI() << " for " << *this); SetPhase(SetUpPhase); if (!OnOpenIncomingMediaChannels()) { - PTRACE(2, "SIP\tOnOpenIncomingMediaChannels failed for INVITE from " << request.GetURI() << " for " << *this); + PTRACE(1, "SIP\tOnOpenIncomingMediaChannels failed for INVITE from " << request.GetURI() << " for " << *this); Release(); return; } @@ -2375,7 +2379,7 @@ void SIPConnection::AnsweringCall(AnswerCallResponse response) break; case AnswerCallDenied: - PTRACE(1, "SIP\tApplication has declined to answer incoming call"); + PTRACE(2, "SIP\tApplication has declined to answer incoming call"); Release(EndedByAnswerDenied); break; @@ -2408,7 +2412,7 @@ void SIPConnection::AnsweringCall(AnswerCallResponse response) void SIPConnection::OnReceivedACK(SIP_PDU & response) { - PTRACE(2, "SIP\tACK received: " << phase); + PTRACE(3, "SIP\tACK received: " << phase); OnReceivedSDP(response); @@ -2436,7 +2440,7 @@ void SIPConnection::OnReceivedACK(SIP_PDU & response) void SIPConnection::OnReceivedOPTIONS(SIP_PDU & /*request*/) { - PTRACE(1, "SIP\tOPTIONS not yet supported"); + PTRACE(2, "SIP\tOPTIONS not yet supported"); } @@ -2445,7 +2449,7 @@ void SIPConnection::OnReceivedNOTIFY(SIP_PDU & pdu) PCaselessString event, state; if (referTransaction == NULL){ - PTRACE(1, "SIP\tNOTIFY in a connection only supported for REFER requests"); + PTRACE(2, "SIP\tNOTIFY in a connection only supported for REFER requests"); return; } @@ -2510,12 +2514,12 @@ void SIPConnection::OnReceivedREFER(SIP_PDU & pdu) void SIPConnection::OnReceivedBYE(SIP_PDU & request) { - PTRACE(2, "SIP\tBYE received for call " << request.GetMIME().GetCallID()); + PTRACE(3, "SIP\tBYE received for call " << request.GetMIME().GetCallID()); SIP_PDU response(request, SIP_PDU::Successful_OK); SendPDU(response, request.GetViaAddress(endpoint)); if (phase >= ReleasingPhase) { - PTRACE(3, "SIP\tAlready released " << *this); + PTRACE(2, "SIP\tAlready released " << *this); return; } releaseMethod = ReleaseWithNothing; @@ -2547,13 +2551,13 @@ void SIPConnection::OnReceivedCANCEL(SIP_PDU & request) request.GetMIME().GetTo() != origTo || request.GetMIME().GetFrom() != origFrom || request.GetMIME().GetCSeqIndex() != originalInvite->GetMIME().GetCSeqIndex()) { - PTRACE(1, "SIP\tUnattached " << request << " received for " << *this); + PTRACE(2, "SIP\tUnattached " << request << " received for " << *this); SIP_PDU response(request, SIP_PDU::Failure_TransactionDoesNotExist); SendPDU(response, request.GetViaAddress(endpoint)); return; } - PTRACE(2, "SIP\tCancel received for " << *this); + PTRACE(3, "SIP\tCancel received for " << *this); SIP_PDU response(request, SIP_PDU::Successful_OK); SendPDU(response, request.GetViaAddress(endpoint)); @@ -2565,13 +2569,13 @@ void SIPConnection::OnReceivedCANCEL(SIP_PDU & request) void SIPConnection::OnReceivedTrying(SIP_PDU & /*response*/) { - PTRACE(2, "SIP\tReceived Trying response"); + PTRACE(3, "SIP\tReceived Trying response"); } void SIPConnection::OnReceivedRinging(SIP_PDU & /*response*/) { - PTRACE(2, "SIP\tReceived Ringing response"); + PTRACE(3, "SIP\tReceived Ringing response"); if (phase < AlertingPhase) { @@ -2583,7 +2587,7 @@ void SIPConnection::OnReceivedRinging(SIP_PDU & /*response*/) void SIPConnection::OnReceivedSessionProgress(SIP_PDU & response) { - PTRACE(2, "SIP\tReceived Session Progress response"); + PTRACE(3, "SIP\tReceived Session Progress response"); OnReceivedSDP(response); @@ -2593,7 +2597,7 @@ void SIPConnection::OnReceivedSessionProgress(SIP_PDU & response) OnAlerting(); } - PTRACE(3, "SIP\tStarting receive media to annunciate remote progress tones"); + PTRACE(4, "SIP\tStarting receive media to annunciate remote progress tones"); OnConnected(); // start media streams } @@ -2628,7 +2632,7 @@ void SIPConnection::OnReceivedAuthenticationRequired(SIPTransaction & transactio return; } - PTRACE(2, "SIP\tReceived " << proxyTrace << "Authentication Required response"); + PTRACE(3, "SIP\tReceived " << proxyTrace << "Authentication Required response"); // Received authentication required response, try to find authentication // for the given realm if no proxy @@ -2674,7 +2678,7 @@ void SIPConnection::OnReceivedAuthenticationRequired(SIPTransaction & transactio && lastUsername == authentication.GetUsername () && lastNonce == authentication.GetNonce ())) { - PTRACE(1, "SIP\tAlready done INVITE for " << proxyTrace << "Authentication Required"); + PTRACE(2, "SIP\tAlready done INVITE for " << proxyTrace << "Authentication Required"); releaseMethod = ReleaseWithNothing; Release(EndedBySecurityDenial); return; @@ -2703,7 +2707,7 @@ void SIPConnection::OnReceivedAuthenticationRequired(SIPTransaction & transactio } else { delete invite; - PTRACE(1, "SIP\tCould not restart INVITE for " << proxyTrace << "Authentication Required"); + PTRACE(2, "SIP\tCould not restart INVITE for " << proxyTrace << "Authentication Required"); releaseMethod = ReleaseWithNothing; Release(EndedBySecurityDenial); } @@ -2713,11 +2717,11 @@ void SIPConnection::OnReceivedAuthenticationRequired(SIPTransaction & transactio void SIPConnection::OnReceivedOK(SIPTransaction & transaction, SIP_PDU & response) { if (transaction.GetMethod() != SIP_PDU::Method_INVITE) { - PTRACE(3, "SIP\tReceived OK response for non INVITE"); + PTRACE(2, "SIP\tReceived OK response for non INVITE"); return; } - PTRACE(2, "SIP\tReceived INVITE OK response"); + PTRACE(3, "SIP\tReceived INVITE OK response"); OnReceivedSDP(response); @@ -2833,7 +2837,7 @@ BOOL SIPConnection::OnReceivedSDPMediaDescription(SDPSessionDescription & sdp, void SIPConnection::OnCreatingINVITE(SIP_PDU & /*request*/) { - PTRACE(2, "SIP\tCreating INVITE request"); + PTRACE(3, "SIP\tCreating INVITE request"); } @@ -2872,7 +2876,7 @@ void SIPConnection::QueuePDU(SIP_PDU * pdu) void SIPConnection::HandlePDUsThreadMain(PThread &, INT) { - PTRACE(2, "SIP\tPDU handler thread started."); + PTRACE(4, "SIP\tPDU handler thread started."); while (phase != ReleasedPhase) { PTRACE(4, "SIP\tAwaiting next PDU."); @@ -2895,7 +2899,7 @@ void SIPConnection::HandlePDUsThreadMain(PThread &, INT) SafeDereference(); - PTRACE(2, "SIP\tPDU handler thread finished."); + PTRACE(4, "SIP\tPDU handler thread finished."); } @@ -3048,7 +3052,7 @@ void SIPConnection::OnReceivedINFO(SIP_PDU & pdu) void SIPConnection::OnReceivedPING(SIP_PDU & pdu) { - PTRACE(1, "SIP\tReceived PING"); + PTRACE(3, "SIP\tReceived PING"); SIP_PDU response(pdu, SIP_PDU::Successful_OK); SendPDU(response, pdu.GetViaAddress(endpoint)); } @@ -3071,7 +3075,7 @@ BOOL SIPConnection::SendUserInputTone(char tone, unsigned duration) { SendUserInputModes mode = GetRealSendUserInputMode(); - PTRACE(2, "SIP\tSendUserInputTime('" << tone << "', " << duration << "), using mode " << mode); + PTRACE(3, "SIP\tSendUserInputTone('" << tone << "', " << duration << "), using mode " << mode); switch (mode) { case SendUserInputAsTone: diff --git a/src/sip/sipep.cxx b/src/sip/sipep.cxx index 49f3d23b..5b0a26f1 100644 --- a/src/sip/sipep.cxx +++ b/src/sip/sipep.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.156 2007/04/04 02:12:02 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.155 2007/04/03 07:40:24 rjongbloed * Fixed CreateCall usage so correct function (with userData) is called on * incoming connections. @@ -652,7 +656,7 @@ BOOL SIPInfo::CreateTransport (OpalTransportAddress & transportAddress) } if (registrarTransport == NULL) { - PTRACE(2, "SIP\tUnable to create transport for registrar"); + PTRACE(1, "SIP\tUnable to create transport for registrar"); OnFailed(SIP_PDU::Failure_BadGateway); return FALSE; } @@ -840,7 +844,7 @@ SIPEndPoint::SIPEndPoint(OpalManager & mgr) natMethod = None; - PTRACE(3, "SIP\tCreated endpoint."); + PTRACE(4, "SIP\tCreated endpoint."); } @@ -883,7 +887,7 @@ SIPEndPoint::~SIPEndPoint() activeSIPInfo.DeleteObjectsToBeRemoved(); PWaitAndSignal m(transactionsMutex); - PTRACE(3, "SIP\tDeleted endpoint."); + PTRACE(4, "SIP\tDeleted endpoint."); } @@ -914,14 +918,14 @@ BOOL SIPEndPoint::NewIncomingConnection(OpalTransport * transport) void SIPEndPoint::TransportThreadMain(PThread &, INT param) { - PTRACE(2, "SIP\tRead thread started."); + PTRACE(4, "SIP\tRead thread started."); OpalTransport * transport = (OpalTransport *)param; do { HandlePDU(*transport); } while (transport->IsOpen() && !transport->bad() && !transport->eof()); - PTRACE(2, "SIP\tRead thread finished."); + PTRACE(4, "SIP\tRead thread finished."); } @@ -1038,7 +1042,7 @@ void SIPEndPoint::HandlePDU(OpalTransport & transport) return; } else if (transport.good()) { - PTRACE(1, "SIP\tMalformed request received on " << transport); + PTRACE(2, "SIP\tMalformed request received on " << transport); SIP_PDU response(*pdu, SIP_PDU::Failure_BadRequest); response.Write(transport); } @@ -1301,7 +1305,7 @@ BOOL SIPEndPoint::OnReceivedINVITE(OpalTransport & transport, SIP_PDU * request) // parse the incoming To field, and check if we accept incoming calls for this address SIPURL toAddr(mime.GetTo()); if (!IsAcceptedAddress(toAddr)) { - PTRACE(1, "SIP\tIncoming INVITE from " << request->GetURI() << " for unknown address " << toAddr); + PTRACE(2, "SIP\tIncoming INVITE from " << request->GetURI() << " for unknown address " << toAddr); SIP_PDU response(*request, SIP_PDU::Failure_NotFound); response.Write(transport); return FALSE; @@ -1316,7 +1320,7 @@ BOOL SIPEndPoint::OnReceivedINVITE(OpalTransport & transport, SIP_PDU * request) SIPConnection *connection = CreateConnection(*manager.CreateCall(NULL), mime.GetCallID(), NULL, request->GetURI(), &transport, request); if (!AddConnection(connection)) { - PTRACE(2, "SIP\tFailed to create SIPConnection for INVITE from " << request->GetURI() << " for " << toAddr); + PTRACE(1, "SIP\tFailed to create SIPConnection for INVITE from " << request->GetURI() << " for " << toAddr); SIP_PDU response(*request, SIP_PDU::Failure_NotFound); response.Write(transport); return FALSE; @@ -1324,7 +1328,7 @@ BOOL SIPEndPoint::OnReceivedINVITE(OpalTransport & transport, SIP_PDU * request) if (&connection->GetTransport() == NULL) { delete connection; - PTRACE(2, "SIP\tFailed to create a transport for INVITE from " << request->GetURI() << " for " << toAddr); + PTRACE(1, "SIP\tFailed to create a transport for INVITE from " << request->GetURI() << " for " << toAddr); SIP_PDU response(*request, SIP_PDU::Failure_NotFound); response.Write(transport); return FALSE; @@ -1351,7 +1355,7 @@ void SIPEndPoint::OnReceivedAuthenticationRequired(SIPTransaction & transaction, #if PTRACING const char * proxyTrace = isProxy ? "Proxy " : ""; #endif - PTRACE(2, "SIP\tReceived " << proxyTrace << "Authentication Required response"); + PTRACE(3, "SIP\tReceived " << proxyTrace << "Authentication Required response"); // Only support REGISTER and SUBSCRIBE for now if (transaction.GetMethod() != SIP_PDU::Method_REGISTER @@ -1388,12 +1392,12 @@ void SIPEndPoint::OnReceivedAuthenticationRequired(SIPTransaction & transaction, realm_info = callid_info; if (!auth.GetAuthRealm().IsEmpty()) realm_info->SetAuthRealm(auth.GetAuthRealm()); - PTRACE(2, "SIP\tUpdated realm to " << auth.GetAuthRealm()); + PTRACE(3, "SIP\tUpdated realm to " << auth.GetAuthRealm()); } // No realm info, weird if (realm_info == NULL) { - PTRACE(2, "SIP\tNo Authentication info found for that realm, authentication impossible"); + PTRACE(1, "SIP\tNo Authentication info found for that realm, authentication impossible"); return; } @@ -1416,7 +1420,7 @@ void SIPEndPoint::OnReceivedAuthenticationRequired(SIPTransaction & transaction, && lastUsername == callid_info->GetAuthentication().GetUsername () && lastNonce == callid_info->GetAuthentication().GetNonce () && !callid_info->IsRegistered()) { - PTRACE(1, "SIP\tAlready done REGISTER/SUBSCRIBE for " << proxyTrace << "Authentication Required"); + PTRACE(2, "SIP\tAlready done REGISTER/SUBSCRIBE for " << proxyTrace << "Authentication Required"); callid_info->OnFailed(SIP_PDU::Failure_UnAuthorised); return; } @@ -1534,7 +1538,7 @@ BOOL SIPEndPoint::OnReceivedNOTIFY (OpalTransport & transport, SIP_PDU & pdu) // We should reject the NOTIFY here, but some proxies still use // the old draft for NOTIFY and send unsollicited NOTIFY. - PTRACE(3, "SIP\tCould not find a SUBSCRIBE corresponding to the NOTIFY"); + PTRACE(2, "SIP\tCould not find a SUBSCRIBE corresponding to the NOTIFY"); } else { @@ -1723,7 +1727,7 @@ void SIPEndPoint::RegistrationRefresh(PTimer &, INT) && info->GetTransport() != NULL && info->GetMethod() != SIP_PDU::Method_MESSAGE && info->HasExpired()) { - PTRACE(2, "SIP\tStarting REGISTER/SUBSCRIBE for binding refresh"); + PTRACE(3, "SIP\tStarting REGISTER/SUBSCRIBE for binding refresh"); infoTransport = info->GetTransport(); // Get current transport OpalTransportAddress registrarAddress = infoTransport->GetRemoteAddress(); // Will update the transport if required. For example, if STUN @@ -2009,7 +2013,7 @@ BOOL SIPEndPoint::TransmitSIPUnregistrationInfo(const PString & host, const PStr registrarTransport = info->GetTransport(); if (!info->IsRegistered() || registrarTransport == NULL) { - PTRACE(1, "SIP\tRemoving local registration/subscription info for apparently unregistered/subscribed " << adjustedUsername); + PTRACE(2, "SIP\tRemoving local registration/subscription info for apparently unregistered/subscribed " << adjustedUsername); activeSIPInfo.Remove(info); return FALSE; } diff --git a/src/sip/sippdu.cxx b/src/sip/sippdu.cxx index b799e293..e8e7af65 100644 --- a/src/sip/sippdu.cxx +++ b/src/sip/sippdu.cxx @@ -24,6 +24,10 @@ * Contributor(s): ______________________________________. * * $Log$ + * Revision 2.120 2007/04/04 02:12:02 rjongbloed + * Reviewed and adjusted PTRACE log levels + * Now follows 1=error,2=warn,3=info,4+=debug + * * Revision 2.119 2007/03/30 14:45:32 hfriederich * Reorganization of hte way transactions are handled. Delete transactions * in garbage collector when they're terminated. Update destructor code @@ -1351,12 +1355,12 @@ BOOL SIPAuthentication::Parse(const PCaselessString & auth, BOOL proxy) opaque = GetAuthParam(auth, "opaque"); if (!opaque.IsEmpty()) { - PTRACE(1, "SIP\tAuthentication contains opaque data"); + PTRACE(2, "SIP\tAuthentication contains opaque data"); } PString qopStr = GetAuthParam(auth, "qop-options"); if (!qopStr.IsEmpty()) { - PTRACE(1, "SIP\tAuthentication contains qop-options " << qopStr); + PTRACE(3, "SIP\tAuthentication contains qop-options " << qopStr); PStringList options = qopStr.Tokenise(',', TRUE); qopAuth = options.GetStringsIndex("auth") != P_MAX_INDEX; qopAuthInt = options.GetStringsIndex("auth-int") != P_MAX_INDEX; @@ -1391,7 +1395,7 @@ BOOL SIPAuthentication::Authorise(SIP_PDU & pdu) const return FALSE; } - PTRACE(2, "SIP\tAdding authentication information"); + PTRACE(3, "SIP\tAdding authentication information"); PMessageDigest5 digestor; PMessageDigest5::Code a1, a2, response; @@ -1851,7 +1855,7 @@ BOOL SIP_PDU::Read(OpalTransport & transport) } if (cmd.IsEmpty()) { - PTRACE(1, "SIP\tNo Request-Line or Status-Line received on " << transport); + PTRACE(2, "SIP\tNo Request-Line or Status-Line received on " << transport); return FALSE; } @@ -1859,7 +1863,7 @@ BOOL SIP_PDU::Read(OpalTransport & transport) // parse Response version, code & reason (ie: "SIP/2.0 200 OK") PINDEX space = cmd.Find(' '); if (space == P_MAX_INDEX) { - PTRACE(1, "SIP\tBad Status-Line received on " << transport); + PTRACE(2, "SIP\tBad Status-Line received on " << transport); return FALSE; } @@ -1873,7 +1877,7 @@ BOOL SIP_PDU::Read(OpalTransport & transport) // parse the method, URI and version PStringArray cmds = cmd.Tokenise( ' ', FALSE); if (cmds.GetSize() < 3) { - PTRACE(1, "SIP\tBad Request-Line received on " << transport); + PTRACE(2, "SIP\tBad Request-Line received on " << transport); return FALSE; } @@ -1881,7 +1885,7 @@ BOOL SIP_PDU::Read(OpalTransport & transport) while (!(cmds[0] *= MethodNames[i])) { i++; if (i >= NumMethods) { - PTRACE(1, "SIP\tUnknown method name " << cmds[0] << " received on " << transport); + PTRACE(2, "SIP\tUnknown method name " << cmds[0] << " received on " << transport); return FALSE; } } @@ -1894,7 +1898,7 @@ BOOL SIP_PDU::Read(OpalTransport & transport) } if (versionMajor < 2) { - PTRACE(1, "SIP\tInvalid version received on " << transport); + PTRACE(2, "SIP\tInvalid version received on " << transport); return FALSE; } @@ -2031,7 +2035,7 @@ SIPTransaction::SIPTransaction(SIPConnection & conn, { connection = &conn; Construct(); - PTRACE(3, "SIP\tTransaction " << mime.GetCSeq() << " created."); + PTRACE(4, "SIP\tTransaction " << mime.GetCSeq() << " created."); } @@ -2053,7 +2057,7 @@ SIPTransaction::~SIPTransaction() if (state > NotStarted && state < Terminated_Success) { PAssertAlways("Destroying transaction that is not yet terminated"); } - PTRACE(3, "SIP\tTransaction " << mime.GetCSeq() << " destroyed."); + PTRACE(4, "SIP\tTransaction " << mime.GetCSeq() << " destroyed."); } @@ -2169,7 +2173,7 @@ BOOL SIPTransaction::OnReceivedResponse(SIP_PDU & response) // Something wrong here, response is not for the request we made! if (cseq.Find(MethodNames[method]) == P_MAX_INDEX) { - PTRACE(3, "SIP\tTransaction " << cseq << " response not for " << *this); + PTRACE(2, "SIP\tTransaction " << cseq << " response not for " << *this); return FALSE; } @@ -2240,7 +2244,7 @@ void SIPTransaction::OnRetry(PTimer &, INT) timeout can be safely ignored as the PDU states are already handled. */ if (!mutex.Wait(100)) { - PTRACE(3, "SIP\tTransaction " << mime.GetCSeq() << " timeout ignored."); + PTRACE(2, "SIP\tTransaction " << mime.GetCSeq() << " timeout ignored."); return; } -- 2.11.4.GIT