req.setCSeq(0);
req.setCallId(generateNewCallId());
req.setMaxForwards(0);
req.setContentType("application/x-msnmsgr-sessionreqbody");
StringHolder body = new StringHolder();
body.setProperty(MsnFileInviteMessage.KEY_GUID_EUF,
MsnFileInviteMessage.GUID_EUF);
body.setProperty("SessionID", lastRandomIdentifier);
body.setProperty("AppID", 2);
try
{
body.setProperty(MsnP2PInvitationMessage.KEY_CONTEXT,
MsnFileContextParser.getEncodedContext(file));
}
catch (UnsupportedEncodingException ex)
{
logger.error("", ex);
}
req.setBody(body.toString() +
JmlConstants.LINE_SEPARATOR + "\0");
// Get the size of the message to be setted
int slpMessageLength = Charset.encodeAsByteArray(req.toString()).length;
invite.setTotalLength(slpMessageLength);