diff --git a/lib/installer-exclude/ice4j.jar b/lib/installer-exclude/ice4j.jar index fc587fbcd..8806069d1 100644 Binary files a/lib/installer-exclude/ice4j.jar and b/lib/installer-exclude/ice4j.jar differ diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesCandidateDatagramSocket.java b/src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesCandidateDatagramSocket.java index 95fa709a7..54b6ba699 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesCandidateDatagramSocket.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/JingleNodesCandidateDatagramSocket.java @@ -10,6 +10,7 @@ import java.net.*; import org.ice4j.*; +import org.ice4j.stack.*; /** * Represents an application-purposed (as opposed to an ICE-specific) @@ -70,12 +71,56 @@ public void send(DatagramPacket p) int dataOffset = p.getOffset(); /* send to Jingle Nodes relay address on local port */ - DatagramPacket packet = new DatagramPacket(data, dataOffset, dataLen, - new InetSocketAddress(localEndPoint.getAddress(), - localEndPoint.getPort())); + DatagramPacket packet = new DatagramPacket( + data, + dataOffset, + dataLen, + new InetSocketAddress( + localEndPoint.getAddress(), + localEndPoint.getPort())); //XXX reuse an existing DatagramPacket ? super.send(packet); + + // no exception packet is successfully sent, log it + if(StunStack.isPacketLoggerEnabled()) + { + StunStack.getPacketLogger().logPacket( + super.getLocalAddress().getAddress(), + super.getLocalPort(), + packet.getAddress().getAddress(), + packet.getPort(), + packet.getData(), + true); + } + } + + + /** + * Receives a DatagramPacket from this socket. The DatagramSocket + * is overridden to log the received packet into the "pcap" (packet capture) + * log. + * + * @param p DatagramPacket + * @throws IOException if something goes wrong + */ + @Override + public void receive(DatagramPacket p) + throws IOException + { + super.receive(p); + + // no exception packet is successfully received, log it + if(StunStack.isPacketLoggerEnabled()) + { + StunStack.getPacketLogger().logPacket( + p.getAddress().getAddress(), + p.getPort(), + super.getLocalAddress().getAddress(), + super.getLocalPort(), + p.getData(), + false); + } } /**