Skip to content

Commit

Permalink
Adds COLIBRI logging when connecting as an XMPP client.
Browse files Browse the repository at this point in the history
  • Loading branch information
gpolitis authored and bbaldino committed Feb 7, 2019
1 parent 4bf1524 commit abfa233
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
10 changes: 0 additions & 10 deletions src/main/java/org/jitsi/videobridge/xmpp/ComponentImpl.java
Expand Up @@ -195,11 +195,6 @@ private IQ handleIQ(IQ iq)
{
try
{
if (logger.isDebugEnabled())
{
logger.debug("RECV: " + iq.toXML());
}

org.jivesoftware.smack.packet.IQ smackIQ = IQUtils.convert(iq);
// Failed to convert to Smack IQ ?
if (smackIQ == null)
Expand Down Expand Up @@ -233,11 +228,6 @@ private IQ handleIQ(IQ iq)
else
{
resultIQ = IQUtils.convert(resultSmackIQ);

if (logger.isDebugEnabled())
{
logger.debug("SENT: " + resultIQ.toXML());
}
}

return resultIQ;
Expand Down
25 changes: 24 additions & 1 deletion src/main/java/org/jitsi/videobridge/xmpp/XmppCommon.java
Expand Up @@ -18,6 +18,7 @@
import net.java.sip.communicator.impl.protocol.jabber.*;
import net.java.sip.communicator.impl.protocol.jabber.extensions.colibri.*;
import net.java.sip.communicator.impl.protocol.jabber.extensions.health.*;
import net.java.sip.communicator.util.*;
import org.jitsi.osgi.*;
import org.jitsi.service.version.*;
import org.jitsi.videobridge.*;
Expand All @@ -36,6 +37,12 @@
*/
class XmppCommon
{
/**
* The {@link Logger} used by the {@link XmppCommon} class and its
* instances for logging output.
*/
private static final org.jitsi.util.Logger logger
= org.jitsi.util.Logger.getLogger(XmppCommon.class);

static final String[] FEATURES
= new String[]
Expand Down Expand Up @@ -105,6 +112,22 @@ private VersionService getVersionService()
: null;
}

IQ handleIQ(IQ requestIQ)
{
if (logger.isDebugEnabled() && requestIQ != null)
{
logger.debug("RECV: " + requestIQ.toXML());
}

IQ replyIQ = handleIQInternal(requestIQ);

if (logger.isDebugEnabled() && replyIQ != null)
{
logger.debug("SENT: " + replyIQ.toXML());
}

return replyIQ;
}
/**
* Handles an <tt>org.jivesoftware.smack.packet.IQ</tt> stanza of type
* <tt>get</tt> or <tt>set</tt> which represents a request.
Expand All @@ -115,7 +138,7 @@ private VersionService getVersionService()
* represents the response to the specified request or <tt>null</tt> to
* reply with <tt>feature-not-implemented</tt>
*/
IQ handleIQ(IQ iq)
private IQ handleIQInternal(IQ iq)
{
IQ responseIQ = null;

Expand Down

0 comments on commit abfa233

Please sign in to comment.