//Judge the client is behind NAT device
String contentType = getContentType();
if (contentType != null
&& contentType.startsWith(MessageConstants.CT_PROFILE)) {
MsnConnectionImpl connectin = (MsnConnectionImpl) session
.getMessenger().getConnection();
connectin.setExternalIP(headers.getProperty("ClientIP"));
connectin.setExternalPort(headers.getIntProperty("ClientPort", -1));
if (connectin.getInternalIP().equals(connectin.getExternalIP())
&& connectin.getInternalPort() == connectin
.getExternalPort())
connectin.setConnectionType(MsnConnectionType.DIRECT);
else
connectin.setConnectionType(MsnConnectionType.NAT);
//TODO to check the NAT device supports UPnP
}
((AbstractMessenger) session.getMessenger())
.fireSystemMessageReceived(this);