Fixed debug.

git-svn-id: http://voip.null.ro/svn/yate@3131 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2010-03-18 14:32:37 +00:00
parent 925f4b7038
commit 52d07b557d
8 changed files with 99 additions and 99 deletions

View File

@ -818,7 +818,7 @@ bool JBEngine::acceptConn(Socket* sock, SocketAddr& remote, JBStream::Type t, bo
return false;
}
if (ssl && t != JBStream::c2s) {
Debug(this,DebugStub,"SSL connection on non c2s stream");
Debug(this,DebugNote,"SSL connection on non c2s stream");
return false;
}
JBStream* s = 0;
@ -1324,7 +1324,7 @@ void JBServerEngine::addStream(JBStream* stream)
process->add(stream);
}
else
Debug(this,DebugStub,"JBServerEngine::addStream() type='%s' not handled!",
DDebug(this,DebugStub,"JBServerEngine::addStream() type='%s' not handled!",
stream->typeName());
recv = 0;
process = 0;
@ -1461,7 +1461,7 @@ void JBClientEngine::addStream(JBStream* stream)
process->add(stream);
}
else
Debug(this,DebugStub,"JBClientEngine::addStream() type='%s' not handled!",
DDebug(this,DebugStub,"JBClientEngine::addStream() type='%s' not handled!",
stream->typeName());
recv = 0;
process = 0;

View File

@ -738,7 +738,7 @@ bool JBStream::canProcess(u_int64_t time)
m_timeToFillRestart = time + m_engine->m_restartUpdInterval;
if (m_restart < m_engine->m_restartMax) {
m_restart++;
Debug(this,DebugAll,"Restart count set to %u max=%u [%p]",
DDebug(this,DebugAll,"Restart count set to %u max=%u [%p]",
m_restart,m_engine->m_restartMax,this);
}
}
@ -822,7 +822,7 @@ void JBStream::process(u_int64_t time)
// No (more) children: check termination
if (root->completed()) {
lockDoc.drop();
Debug(this,DebugAll,"Remote closed the stream in state %s [%p]",
DDebug(this,DebugAll,"Remote closed the stream in state %s [%p]",
stateName(),this);
terminate(1,false,0);
}
@ -1117,11 +1117,8 @@ bool JBStream::processStreamStart(const XmlElement* xml)
// Accept invalid/unsupported version only if TLS is not required
if (!flag(TlsRequired)) {
// Check dialback
if (!xml->hasAttribute("xmlns:db",XMPPUtils::s_ns[XMPPNamespace::Dialback])) {
Debug(this,DebugNote,"Received non dialback '%s' [%p]",
xml->tag(),this);
if (!xml->hasAttribute("xmlns:db",XMPPUtils::s_ns[XMPPNamespace::Dialback]))
error = XMPPError::InvalidNamespace;
}
}
else
error = XMPPError::EncryptionRequired;
@ -1132,8 +1129,8 @@ bool JBStream::processStreamStart(const XmlElement* xml)
else if (remoteVersion > 1)
error = XMPPError::UnsupportedVersion;
if (error != XMPPError::NoError) {
Debug(this,DebugNote,"Received '%s' with unacceptable version='%s' [%p]",
xml->tag(),ver.c_str(),this);
Debug(this,DebugNote,"Unacceptable '%s' version='%s' error=%s [%p]",
xml->tag(),ver.c_str(),XMPPUtils::s_error[error].c_str(),this);
break;
}
// Set stream id: generate one for incoming, get it from xml if outgoing
@ -1147,8 +1144,8 @@ bool JBStream::processStreamStart(const XmlElement* xml)
else {
m_id = xml->getAttribute("id");
if (!m_id) {
Debug(this,DebugNote,"Received '%s' with invalid stream id='%s' [%p]",
xml->tag(),m_id.c_str(),this);
Debug(this,DebugNote,"Received '%s' with empty stream id [%p]",
xml->tag(),this);
reason = "Missing stream id";
error = XMPPError::InvalidId;
break;
@ -1543,7 +1540,7 @@ bool JBStream::dropXml(XmlElement*& xml, const char* reason)
{
if (!xml)
return true;
Debug(this,DebugStub,"Dropping xml=(%p,%s) ns=%s in state=%s reason='%s' [%p]",
Debug(this,DebugNote,"Dropping xml=(%p,%s) ns=%s in state=%s reason='%s' [%p]",
xml,xml->tag(),TelEngine::c_safe(xml->xmlns()),stateName(),reason,this);
TelEngine::destruct(xml);
return true;
@ -1576,9 +1573,7 @@ bool JBStream::processChallenge(XmlElement* xml, const JabberID& from, const Jab
return true;
}
if (t != XmlTag::Response) {
Debug(this,DebugStub,"Unhandled SASL '%s' in %s state [%p]",
xml->tag(),stateName(),this);
TelEngine::destruct(xml);
dropXml(xml,"expecting sasl response");
return true;
}
XMPPError::Type error = XMPPError::NoError;
@ -1606,7 +1601,7 @@ bool JBStream::processChallenge(XmlElement* xml, const JabberID& from, const Jab
m_events.append(new JBEvent(JBEvent::Auth,this,xml,from,to));
}
else {
Debug(this,DebugNote,"Received challenge response error='%s' [%p]",
Debug(this,DebugNote,"Received bad challenge response error='%s' [%p]",
XMPPUtils::s_error[error].c_str(),this);
XmlElement* failure = XMPPUtils::createFailure(XMPPNamespace::Sasl,error);
sendStreamXml(Features,failure);
@ -2168,7 +2163,7 @@ bool JBClientStream::processStart(const XmlElement* xml, const JabberID& from,
m_events.append(new JBEvent(JBEvent::Start,this,0,from,to));
return true;
}
Debug(this,DebugStub,"Outgoing client stream: unsupported remote version (expecting 1.x)");
Debug(this,DebugNote,"Outgoing client stream: unsupported remote version (expecting 1.x)");
terminate(0,true,0,XMPPError::Internal,"Unsupported version");
return false;
}
@ -2567,7 +2562,7 @@ bool JBServerStream::sendDialback()
}
else if (!m_dbKey) {
// Dialback only with no key?
Debug(this,DebugGoOn,"Outgoing dialback stream with no key! [%p]",this);
Debug(this,DebugNote,"Outgoing dialback stream with no key! [%p]",this);
terminate(0,true,0,XMPPError::Internal);
return false;
}
@ -2759,7 +2754,7 @@ bool JBServerStream::processDbResult(XmlElement* xml, const JabberID& from,
return false;
}
m_remoteDomains.addParam(from,key);
Debug(this,DebugAll,"Added db:result request from %s [%p]",from.c_str(),this);
DDebug(this,DebugAll,"Added db:result request from %s [%p]",from.c_str(),this);
// Notify the upper layer of incoming request
JBEvent* ev = new JBEvent(JBEvent::DbResult,this,xml,from,to);
ev->m_text = key;

View File

@ -96,7 +96,8 @@ JGSession* JGEngine::call(JGSession::Version ver, const JabberID& caller,
session = new JGSession0(this,caller,called);
break;
case JGSession::VersionUnknown:
Debug(this,DebugNote,"Unhandled session version %d in call()",ver);
Debug(this,DebugNote,"Outgoing call from '%s' to '%s' failed: unknown version %d",
caller.c_str(),called.c_str(),ver);
return 0;
}
if (session) {
@ -237,7 +238,9 @@ bool JGEngine::acceptIq(XMPPUtils::IqType type, const JabberID& from, const Jabb
break;
default:
error = XMPPError::ServiceUnavailable;
Debug(this,DebugStub,"JGEngine::accept(): unhandled session version %d",ver);
Debug(this,DebugNote,
"Can't accept xml child=%s sid=%s with unhandled version %d",
child->tag(),sid.c_str(),ver);
}
}
else {
@ -250,6 +253,8 @@ bool JGEngine::acceptIq(XMPPUtils::IqType type, const JabberID& from, const Jabb
}
return error == XMPPError::NoError;
}
Debug(this,DebugNote,"Can't accept xml child=%s sid=%s with unknown version %d",
child->tag(),sid.c_str(),ver);
return false;
}

View File

@ -158,7 +158,7 @@ const TokenDict JGSession::s_actions1[] = {
static void unhandledAction(JGSession* sess, XmlElement*& xml, int act,
XmlElement* ch = 0)
{
Debug(sess->engine(),DebugStub,
Debug(sess->engine(),DebugNote,
"Call(%s). Unhandled action '%s' child=(%p,%s,%s) [%p]",
sess->sid().c_str(),JGSession::lookupAction(act,sess->version()),
ch,ch ? ch->tag() : 0,ch ? TelEngine::c_safe(ch->xmlns()) : 0,sess);
@ -2108,7 +2108,7 @@ JGEvent* JGSession1::decodeJingle(XmlElement*& xml, XmlElement* child)
continue;
}
if (err == XMPPError::NoError) {
DDebug(m_engine,DebugAll,
Debug(m_engine,DebugInfo,
"Call(%s). Ignoring content='%s' in '%s' stanza [%p]",
m_sid.c_str(),c->attribute("name"),event->actionName(),this);
continue;

View File

@ -638,7 +638,7 @@ XMPPFeature* XMPPFeature::fromStreamFeature(XmlElement& xml)
if (m)
mech |= m;
else
Debug(DebugStub,"XMPPFeature::fromStreamFeature() Unhandled mechanism '%s'",
DDebug(DebugStub,"XMPPFeature::fromStreamFeature() Unhandled mechanism '%s'",
n.c_str());
}
f = new XMPPFeatureSasl(mech,required);
@ -1182,7 +1182,7 @@ unsigned int XMPPUtils::decodeDateTimeSec(const String& time, unsigned int* frac
"XMPPUtils::decodeDateTimeSec() decoded year=%d month=%u day=%u from '%s'",
year,month,day,time.c_str());
else {
DDebug(DebugNote,
Debug(DebugNote,
"XMPPUtils::decodeDateTimeSec() incorrect date=%s in '%s'",
date.c_str(),time.c_str());
break;
@ -1206,7 +1206,7 @@ unsigned int XMPPUtils::decodeDateTimeSec(const String& time, unsigned int* frac
}
TelEngine::destruct(list);
if (!valid) {
DDebug(DebugNote,
Debug(DebugNote,
"XMPPUtils::decodeDateTimeSec() incorrect time=%s in '%s'",
t.c_str(),time.c_str());
break;
@ -1238,7 +1238,7 @@ unsigned int XMPPUtils::decodeDateTimeSec(const String& time, unsigned int* frac
"XMPPUtils::decodeDateTimeSec() decoded fractions=%u from '%s'",
timeFractions,time.c_str());
else {
DDebug(DebugNote,
Debug(DebugNote,
"XMPPUtils::decodeDateTimeSec() incorrect fractions=%s in '%s'",
fr.c_str(),time.c_str());
break;
@ -1258,7 +1258,7 @@ unsigned int XMPPUtils::decodeDateTimeSec(const String& time, unsigned int* frac
String offs(buf,5);
// We should have at least 5 bytes: hh:ss
if (len < 5 || buf[2] != ':') {
DDebug(DebugNote,
Debug(DebugNote,
"XMPPUtils::decodeDateTimeSec() incorrect time offset=%s in '%s'",
offs.c_str(),time.c_str());
break;
@ -1267,7 +1267,7 @@ unsigned int XMPPUtils::decodeDateTimeSec(const String& time, unsigned int* frac
unsigned int mmOffs = (unsigned int)offs.substr(3,2).toInteger(-1,10);
// XML Schema Part 2 3.2.7.3: the hour may be 0..13. It can be 14 if minute is 0
if (mmOffs > 59 || (hhOffs > 13 && !mmOffs)) {
DDebug(DebugNote,
Debug(DebugNote,
"XMPPUtils::decodeDateTimeSec() incorrect time offset values hour=%u minute=%u in '%s'",
hhOffs,mmOffs,time.c_str());
break;
@ -1288,12 +1288,9 @@ unsigned int XMPPUtils::decodeDateTimeSec(const String& time, unsigned int* frac
break;
}
ret = Time::toEpoch(year,month,day,hh,mm,ss,offsetSec);
#ifdef DEBUG
if (ret == (unsigned int)-1)
Debug(DebugNote,
"XMPPUtils::decodeDateTimeSec() failed to convert '%s'",
Debug(DebugNote,"XMPPUtils::decodeDateTimeSec() failed to convert '%s'",
time.c_str());
#endif
break;
}
@ -1322,7 +1319,7 @@ void XMPPUtils::print(String& xmlStr, XmlChild& xml, bool verbose)
xml.xmlDeclaration()->toString(xmlStr,false);
}
else
Debug(DebugStub,"XMPPUtils::print() not implemented for this type!");
DDebug(DebugStub,"XMPPUtils::print() not implemented for this type!");
}
// Put an element's name, text and attributes to a list of parameters

View File

@ -857,7 +857,7 @@ void YJBEngine::initialize(const NamedList* params, bool first)
}
}
else
Debug(this,DebugGoOn,"No domains configured");
Debug(this,DebugNote,"No domains configured");
// Restricted resources
String* res = params->getParam("restricted_resources");
@ -915,7 +915,7 @@ void YJBEngine::processEvent(JBEvent* ev)
{
if (!(ev && ev->stream())) {
if (ev && !ev->stream())
Debug(this,DebugStub,"Event (%p,'%s') without stream",ev,ev->name());
DDebug(this,DebugStub,"Event (%p,'%s') without stream",ev,ev->name());
TelEngine::destruct(ev);
return;
}
@ -1152,8 +1152,8 @@ void YJBEngine::handleUserRoster(Message& msg)
if (!to.node())
return;
const char* contact = msg.getValue("contact");
Debug(this,DebugAll,"handleUserRoster(%s,%s) notify=%s",
to.c_str(),contact,what->c_str());
Debug(this,DebugAll,"Processing %s from=%s to=%s notify=%s",
msg.c_str(),to.c_str(),contact,what->c_str());
XmlElement* item = 0;
if (*what == "update")
item = buildRosterItem(msg,1);
@ -1202,7 +1202,8 @@ bool YJBEngine::handleJabberIq(Message& msg)
to.resource(msg.getValue("to_instance"));
if (!(from && to))
return false;
DDebug(this,DebugAll,"YJBEngine::handleJabberIq() from=%s to=%s",from.c_str(),to.c_str());
Debug(this,DebugAll,"Processing %s from=%s to=%s",
msg.c_str(),from.c_str(),to.c_str());
JBStream* stream = 0;
if (hasDomain(to.domain()) && !hasComponent(to.domain())) {
stream = findClientStream(true,to);
@ -1360,7 +1361,8 @@ bool YJBEngine::handleMsgExecute(Message& msg)
JabberID called(msg.getValue("called"));
if (!caller.resource())
caller.resource(msg.getValue("caller_instance"));
DDebug(this,DebugAll,"handleMsgExecute() caller=%s called=%s",caller.c_str(),called.c_str());
Debug(this,DebugAll,"Processing %s caller=%s called=%s",
msg.c_str(),caller.c_str(),called.c_str());
if (hasDomain(called.domain()) && !hasComponent(called.domain())) {
// RFC 3921 11.1: Broadcast chat only to clients with non-negative resource priority
bool ok = false;
@ -1454,7 +1456,7 @@ bool YJBEngine::handleJabberItem(Message& msg)
return true;
}
if (dynamic && hasComponent(jid.domain())) {
Debug(this,DebugMild,
Debug(this,DebugNote,
"Request to add server item '%s' while already having a component",
jid.c_str());
return false;
@ -1473,19 +1475,19 @@ bool YJBEngine::handleJabberItem(Message& msg)
// The given event is always valid and carry a valid stream and xml element
void YJBEngine::processPresenceStanza(JBEvent* ev)
{
Debug(this,DebugAll,"Processing presence type=%s from=%s to=%s stream=%s",
ev->stanzaType().c_str(),ev->from().c_str(),ev->to().c_str(),
ev->stream()->typeName());
Debug(this,DebugAll,"Processing (%p,%s) type=%s from=%s to=%s stream=%s",
ev->element(),ev->element()->tag(),ev->stanzaType().c_str(),
ev->from().c_str(),ev->to().c_str(),ev->stream()->typeName());
JBServerStream* s2s = ev->serverStream();
JBClientStream* c2s = ev->clientStream();
if (!(c2s || s2s)) {
Debug(this,DebugStub,
"processPresenceStanza(%s) not implemented for stream type '%s'",
Debug(this,DebugNote,
"processPresenceStanza(%s) not handled for stream type '%s'",
ev->stanzaType().c_str(),lookup(ev->stream()->type(),JBStream::s_typeName));
return;
}
if (c2s && c2s->outgoing()) {
Debug(this,DebugStub,
DDebug(this,DebugStub,
"processPresenceStanza(%s) not implemented for outgoing client streams",
ev->stanzaType().c_str());
ev->sendStanzaError(XMPPError::ServiceUnavailable);
@ -1615,7 +1617,7 @@ void YJBEngine::processStartIn(JBEvent* ev)
bool isItem = isServerItemDomain(ev->from().domain());
if (isItem || findServerStream(local,ev->from(),false)) {
if (isItem)
Debug(this,DebugMild,"Component request for server item domain '%s'",
Debug(this,DebugNote,"Component request for server item domain '%s'",
ev->from().domain().c_str());
comp->terminate(-1,true,0,XMPPError::Conflict);
return;
@ -1856,7 +1858,7 @@ void YJBEngine::processBind(JBEvent* ev)
// The given event is always valid and carry a valid stream
void YJBEngine::processStreamEvent(JBEvent* ev)
{
XDebug(this,DebugAll,"YJBEngine::processStreamEvent(%p,%s)",ev,ev->name());
XDebug(this,DebugAll,"processStreamEvent(%p,%s)",ev,ev->name());
JBStream* s = ev->stream();
bool in = s->incoming();
bool reg = ev->type() == JBEvent::Running;
@ -1931,7 +1933,7 @@ void YJBEngine::processDbResult(JBEvent* ev)
return;
}
}
Debug(this,DebugWarn,
Debug(this,DebugNote,
"Failed to authenticate dialback request from=%s to=%s id=%s key=%s",
ev->from().c_str(),ev->to().c_str(),id,ev->text().c_str());
if (stream)
@ -2605,7 +2607,7 @@ void JBPendingWorker::run()
processIq(*job);
break;
default:
Debug(&__plugin,DebugStub,
DDebug(&__plugin,DebugStub,
"JBPendingWorker unhandled xml tag '%s' [%p]",
job->m_event->element()->tag(),this);
}
@ -2710,8 +2712,10 @@ bool JBPendingWorker::add(JBEvent* ev)
void JBPendingWorker::processChat(JBPendingJob& job)
{
JBEvent* ev = job.m_event;
XDebug(&__plugin,DebugAll,"JBPendingWorker(%u) processChat xml=%p from=%s to=%s [%p]",
m_index,ev->element(),ev->from().c_str(),ev->to().c_str(),this);
Debug(&__plugin,DebugAll,
"JBPendingWorker(%u) processing (%p,%s) from=%s to=%s [%p]",
m_index,ev->element(),ev->element()->tag(),ev->from().c_str(),
ev->to().c_str(),this);
int mType = XMPPUtils::msgType(ev->stanzaType());
if (!ev->to()) {
if (mType != XMPPUtils::MsgError)
@ -2844,12 +2848,11 @@ void JBPendingWorker::processIq(JBPendingJob& job)
if (xmlns)
ns = XMPPUtils::s_ns[*xmlns];
}
XDebug(&__plugin,DebugAll,
"JBPendingWorker(%u) processing iq type=%s from=%s to=%s child=%s xmlns=%s stream=%s [%p]",
m_index,ev->stanzaType().c_str(),ev->from().c_str(),ev->to().c_str(),
service ? service->tag() : "",TelEngine::c_safe(xmlns),
lookup(job.m_streamType,JBStream::s_typeName),this);
Debug(&__plugin,DebugAll,
"JBPendingWorker(%u) processing (%p,%s) type=%s from=%s to=%s child=(%s,%s) stream=%s [%p]",
m_index,ev->element(),ev->element()->tag(),ev->stanzaType().c_str(),
ev->from().c_str(),ev->to().c_str(),service ? service->tag() : "",
TelEngine::c_safe(xmlns),lookup(job.m_streamType,JBStream::s_typeName),this);
// Server entity caps responses
if (ns == XMPPNamespace::DiscoInfo &&
(t == XMPPUtils::IqResult || t == XMPPUtils::IqError) &&
@ -3143,7 +3146,7 @@ bool JBMessageHandler::received(Message& msg)
case JabberItem:
return s_jabber->handleJabberItem(msg);
default:
Debug(&__plugin,DebugStub,"JBMessageHandler(%s) not handled!",msg.c_str());
DDebug(&__plugin,DebugStub,"JBMessageHandler(%s) not handled!",msg.c_str());
}
return false;
}
@ -3183,8 +3186,8 @@ private:
void TcpListener::run()
{
__plugin.listener(this,true);
DDebug(&__plugin,DebugAll,
"TcpListener(%s) '%s:%d' type='%s' context=%s start running [%p]",
Debug(&__plugin,DebugInfo,
"Listener(%s) '%s:%d' type='%s' context=%s start running [%p]",
c_str(),m_address.safe(),m_port,lookup(m_type,JBStream::s_typeName),
m_sslContext.c_str(),this);
// Create the socket
@ -3241,7 +3244,7 @@ void TcpListener::run()
Thread::idle();
}
terminateSocket();
DDebug(&__plugin,DebugAll,"Listener(%s) '%s:%d' terminated [%p]",c_str(),
Debug(&__plugin,DebugInfo,"Listener(%s) '%s:%d' terminated [%p]",c_str(),
m_address.safe(),m_port,this);
__plugin.listener(this,false);
}
@ -3658,7 +3661,7 @@ bool JBModule::buildListener(const String& name, NamedList& p)
const char* stype = p.getValue("type");
JBStream::Type t = JBStream::lookupType(stype);
if (t == JBStream::TypeCount) {
Debug(this,DebugWarn,"Can't build listener='%s' with invalid type='%s'",
Debug(this,DebugNote,"Can't build listener='%s' with invalid type='%s'",
name.c_str(),stype);
return false;
}
@ -3675,7 +3678,7 @@ bool JBModule::buildListener(const String& name, NamedList& p)
port = XMPP_C2S_PORT;
}
if (!port) {
Debug(this,DebugWarn,"Can't build listener='%s' with invalid port='%s'",
Debug(this,DebugNote,"Can't build listener='%s' with invalid port='%s'",
name.c_str(),c_safe(sport));
return false;
}
@ -3688,7 +3691,7 @@ bool JBModule::buildListener(const String& name, NamedList& p)
l = new TcpListener(name,s_jabber,context,addr,port,backlog);
if (l->startup())
return true;
Debug(this,DebugWarn,"Failed to start listener='%s' type='%s' addr='%s' port=%d",
Debug(this,DebugNote,"Failed to start listener='%s' type='%s' addr='%s' port=%d",
name.c_str(),stype,p.getValue("address"),port);
TelEngine::destruct(l);
return false;
@ -3707,7 +3710,7 @@ void JBModule::listener(TcpListener* l, bool add)
m_streamListeners.append(l)->setDelete(false);
else
found->remove(false);
Debug(this,DebugAll,"%s listener (%p,'%s')",add ? "Added" : "Removed",
DDebug(this,DebugAll,"%s listener (%p,'%s')",add ? "Added" : "Removed",
l,l->toString().c_str());
}

View File

@ -425,7 +425,7 @@ bool JBFeaturesModule::handleFeaturePrivateData(JabberID& from, Message& msg)
if (pdata) {
// Avoid sending inconsistent tag or namespace
if (tag != pdata->toString() || *ns != pdata->xmlns()) {
Debug(this,DebugMild,
Debug(this,DebugNote,
"User %s got invalid private data tag/ns='%s'/'%s' instead of '%s'/'%s'",
from.bare().c_str(),pdata->tag(),
TelEngine::c_safe(pdata->xmlns()),tag.c_str(),ns->c_str());
@ -433,7 +433,7 @@ bool JBFeaturesModule::handleFeaturePrivateData(JabberID& from, Message& msg)
}
}
else if (data)
Debug(this,DebugMild,"User %s got invalid xml private data",from.bare().c_str());
Debug(this,DebugNote,"User %s got invalid xml private data",from.bare().c_str());
TelEngine::destruct(m);
}
if (!pdata)
@ -519,13 +519,13 @@ bool JBFeaturesModule::handleFeatureVCard(JabberID& from, Message& msg)
if (vcard) {
// Avoid sending inconsistent tag
if (!XMPPUtils::isTag(*vcard,XmlTag::VCard,XMPPNamespace::VCard)) {
Debug(this,DebugMild,"Wrong vcard tag='%s' or ns='%s' for '%s'",
Debug(this,DebugNote,"Wrong vcard tag='%s' or ns='%s' for '%s'",
vcard->tag(),TelEngine::c_safe(vcard->xmlns()),p.getValue("username"));
TelEngine::destruct(vcard);
}
}
else
Debug(this,DebugMild,"Failed to parse vcard for '%s'",p.getValue("username"));
Debug(this,DebugNote,"Failed to parse vcard for '%s'",p.getValue("username"));
}
}
}
@ -618,7 +618,7 @@ bool JBFeaturesModule::handleFeatureMsgOffline(JabberID& from, Message& msg)
msg.addParam(new NamedPointer("xml",xml));
continue;
}
Debug(this,DebugMild,"Invalid database offline chat xml for user=%s",
Debug(this,DebugNote,"Invalid database offline chat xml for user=%s",
from.bare().c_str());
}
return true;

View File

@ -622,7 +622,7 @@ void YJGEngine::processEvent(JGEvent* event)
JGSession* session = event->session();
// This should never happen !!!
if (!session) {
Debug(this,DebugWarn,"Received event without session");
DDebug(this,DebugStub,"Received event without session");
delete event;
return;
}
@ -831,7 +831,7 @@ YJGConnection::YJGConnection(JGEvent* event)
default:
// processContentAdd() should return only known content types in ok list
// This a safeguard if we add new content type(s) and forget to process them
Debug(this,DebugStub,
Debug(this,DebugNote,
"Can't process incoming content '%s' of type %u [%p]",
c->toString().c_str(),c->type(),this);
// Append this content to 'remove' list
@ -869,7 +869,7 @@ YJGConnection::YJGConnection(JGEvent* event)
// We don't support mixed sessions for now
// Remove file transfer contents if we have an audio session request
if (m_audioContents.skipNull() && m_ftContents.skipNull()) {
Debug(this,DebugMild,"Denying file transfer in audio session [%p]",this);
Debug(this,DebugNote,"Denying file transfer in audio session [%p]",this);
m_session->sendContent(JGSession::ActContentRemove,m_ftContents);
m_ftContents.clear();
}
@ -1329,7 +1329,7 @@ bool YJGConnection::handleEvent(JGEvent* event)
response = true;
break;
default:
Debug(this,DebugStub,"Unhandled event (%p,%u) [%p]",
DDebug(this,DebugStub,"Unhandled event (%p,%u) [%p]",
event,event->type(),this);
return true;
}
@ -1360,7 +1360,7 @@ bool YJGConnection::handleEvent(JGEvent* event)
m_ftStatus = FTIdle;
clearEndpoint("data");
}
Debug(this,rspOk ? DebugAll : DebugMild,
Debug(this,rspOk ? DebugAll : DebugInfo,
"Received result=%s to streamhost used=%s [%p]",
event->name(),usedHost.c_str(),this);
return ok;
@ -1369,7 +1369,7 @@ bool YJGConnection::handleEvent(JGEvent* event)
// Hold/active result
bool hold = (m_onHoldOutId && m_onHoldOutId == event->id());
if (hold || (m_activeOutId && m_activeOutId == event->id())) {
Debug(this,rspOk ? DebugAll : DebugMild,
Debug(this,rspOk ? DebugAll : DebugInfo,
"Received result=%s to %s request [%p]",
event->name(),hold ? "hold" : "active",this);
@ -1403,7 +1403,7 @@ bool YJGConnection::handleEvent(JGEvent* event)
// TODO: implement
}
else {
Debug(this,DebugMild,"Transfer failed error=%s [%p]",
Debug(this,DebugNote,"Transfer failed error=%s [%p]",
event->text().c_str(),this);
}
return true;
@ -1416,7 +1416,7 @@ bool YJGConnection::handleEvent(JGEvent* event)
switch (event->action()) {
case JGSession::ActDtmf:
event->confirmElement();
Debug(this,DebugInfo,"Received dtmf(%s) '%s' [%p]",
Debug(this,DebugAll,"Received dtmf(%s) '%s' [%p]",
event->reason().c_str(),event->text().c_str(),this);
if (event->text()) {
Message* m = message("chan.dtmf");
@ -2202,7 +2202,7 @@ bool YJGConnection::processContentAdd(const JGEvent& event, ObjList& ok, ObjList
// File transfer contents can be added only in session initiate
if (event.action() != JGSession::ActInitiate) {
Debug(this,DebugInfo,
"Event(%s) content='%s': [%p]",
"Event(%s) file transfer content='%s' in non initiate event [%p]",
event.actionName(),c->toString().c_str(),this);
remove.append(c)->setDelete(false);
continue;
@ -2211,7 +2211,7 @@ bool YJGConnection::processContentAdd(const JGEvent& event, ObjList& ok, ObjList
break;
case JGSessionContent::Unknown:
case JGSessionContent::UnknownFileTransfer:
Debug(this,DebugInfo,
Debug(this,DebugNote,
"Event(%s) with unknown (unsupported) content '%s' [%p]",
event.actionName(),c->toString().c_str(),this);
remove.append(c)->setDelete(false);
@ -2221,7 +2221,7 @@ bool YJGConnection::processContentAdd(const JGEvent& event, ObjList& ok, ObjList
// Check creator
if ((isOutgoing() && c->creator() == JGSessionContent::CreatorInitiator) ||
(isIncoming() && c->creator() == JGSessionContent::CreatorResponder)) {
Debug(this,DebugInfo,
Debug(this,DebugNote,
"Event(%s) content='%s' has invalid creator [%p]",
event.actionName(),c->toString().c_str(),this);
remove.append(c)->setDelete(false);
@ -2236,7 +2236,7 @@ bool YJGConnection::processContentAdd(const JGEvent& event, ObjList& ok, ObjList
// Check if we already have an audio content with the same name and creator
if (findContent(*c,m_audioContents)) {
Debug(this,DebugInfo,
Debug(this,DebugNote,
"Event(%s) content='%s' is already added [%p]",
event.actionName(),c->toString().c_str(),this);
return false;
@ -2244,7 +2244,7 @@ bool YJGConnection::processContentAdd(const JGEvent& event, ObjList& ok, ObjList
// Check transport type
if (c->m_rtpRemoteCandidates.m_type == JGRtpCandidates::Unknown) {
Debug(this,DebugInfo,
Debug(this,DebugNote,
"Event(%s) content='%s' has unknown transport type [%p]",
event.actionName(),c->toString().c_str(),this);
remove.append(c)->setDelete(false);
@ -2256,7 +2256,7 @@ bool YJGConnection::processContentAdd(const JGEvent& event, ObjList& ok, ObjList
JGRtpCandidate* rtp = c->m_rtpRemoteCandidates.findByComponent(1);
if (rtp) {
if (!checkRecvCandidate(*c,*rtp)) {
Debug(this,DebugInfo,
Debug(this,DebugNote,
"Event(%s) content='%s' has invalid RTP candidate [%p]",
event.actionName(),c->toString().c_str(),this);
remove.append(c)->setDelete(false);
@ -2264,7 +2264,7 @@ bool YJGConnection::processContentAdd(const JGEvent& event, ObjList& ok, ObjList
}
}
else if (c->m_rtpRemoteCandidates.m_type == JGRtpCandidates::RtpRawUdp) {
Debug(this,DebugInfo,
Debug(this,DebugNote,
"Event(%s) raw udp content='%s' without RTP candidate [%p]",
event.actionName(),c->toString().c_str(),this);
remove.append(c)->setDelete(false);
@ -2272,7 +2272,7 @@ bool YJGConnection::processContentAdd(const JGEvent& event, ObjList& ok, ObjList
}
JGRtpCandidate* rtcp = c->m_rtpRemoteCandidates.findByComponent(2);
if (rtcp && !checkRecvCandidate(*c,*rtcp)) {
Debug(this,DebugInfo,
Debug(this,DebugNote,
"Event(%s) content='%s' has invalid RTCP candidate [%p]",
event.actionName(),c->toString().c_str(),this);
remove.append(c)->setDelete(false);
@ -2303,7 +2303,7 @@ bool YJGConnection::processContentAdd(const JGEvent& event, ObjList& ok, ObjList
if (debugAt(DebugInfo)) {
String localCaps;
s_usedCodecs.createList(localCaps,false);
Debug(this,DebugInfo,
Debug(this,DebugNote,
"Event(%s) no common media for content='%s' local='%s' remote='%s' [%p]",
event.actionName(),c->toString().c_str(),localCaps.c_str(),
remoteCaps.c_str(),this);
@ -2324,7 +2324,7 @@ bool YJGConnection::processContentAdd(const JGEvent& event, ObjList& ok, ObjList
}
}
if (error) {
Debug(this,DebugInfo,
Debug(this,DebugNote,
"Event(%s) content=%s with invalid crypto [%p]",
event.actionName(),c->toString().c_str(),this);
remove.append(c)->setDelete(false);
@ -2716,7 +2716,7 @@ bool YJGConnection::changeFTHostDir()
return true;
}
if (m_ftHostDirection != FTHostNone)
Debug(this,DebugNote,"No more host available [%p]",this);
Debug(this,DebugNote,"No more hosts available [%p]",this);
m_ftHostDirection = FTHostNone;
return false;
}
@ -2883,7 +2883,7 @@ void YJGConnection::overrideJingleVersion(const NamedList& list, bool caps)
return;
JGSession::Version v = JGSession::lookupVersion(*ver);
if (v != JGSession::VersionUnknown && v != m_sessVersion) {
DDebug(this,DebugInfo,"Jingle version set to %s from %s",
Debug(this,DebugAll,"Jingle version set to %s from %s",
ver->c_str(),caps ? "resource caps" : "routing");
m_sessVersion = v;
}
@ -2981,8 +2981,8 @@ void YJGTransfer::run()
conn->transferTerminated(!error,error);
#ifdef DEBUG
else
Debug(&plugin,DebugInfo,
"%s thread transfer terminated trans=%s error=%s [%p]",
Debug(&plugin,DebugNote,
"%s thread transfer terminated trans=%s error=%s (transferor not found) [%p]",
name(),m_transferredID.c_str(),error.c_str(),this);
#endif
plugin.unlock();
@ -3015,7 +3015,7 @@ bool YJGMessageHandler::received(Message& msg)
case UserNotify:
return !plugin.isModule(msg) && plugin.handleUserNotify(msg);
default:
Debug(&plugin,DebugStub,"YJGMessageHandler(%s) not handled!",msg.c_str());
DDebug(&plugin,DebugStub,"YJGMessageHandler(%s) not handled!",msg.c_str());
}
return false;
}
@ -3354,7 +3354,7 @@ bool YJGDriver::msgExecute(Message& msg, String& dest)
bool ok = Engine::dispatch(m);
if (ok) {
int n = m->getIntValue("instance.count");
Debug(this,DebugAll,"Checking %d instances for call from %s to %s",
DDebug(this,DebugAll,"Checking %d instances for call from %s to %s",
n,caller.c_str(),called.c_str());
String prefix("instance.");
for (int i = 1; i <= n; i++) {
@ -3492,7 +3492,7 @@ bool YJGDriver::handleJabberIq(Message& msg)
XmlElement* xml = XMPPUtils::getXml(msg,"xml",0);
if (!xml) {
DDebug(this,DebugAll,"YJGDriver::handleJabberIq() no xml element");
DDebug(this,DebugAll,"handleJabberIq() no xml element");
return false;
}
JabberID from(msg.getValue("from"));