use of com.zx.sms.connect.manager.cmpp.CMPPEndpointEntity in project SMSGate by Lihuanghe.
the class SessionLoginManager method doLogin.
@Override
protected void doLogin(Channel ch) {
CMPPEndpointEntity cliententity = (CMPPEndpointEntity) entity;
CmppConnectRequestMessage req = new CmppConnectRequestMessage();
req.setSourceAddr(cliententity.getUserName());
String timestamp = DateFormatUtils.format(CachedMillisecondClock.INS.now(), "MMddHHmmss");
req.setTimestamp(Long.parseLong(timestamp));
byte[] userBytes = cliententity.getUserName().getBytes(cliententity.getChartset());
byte[] passwdBytes = cliententity.getPassword().getBytes(cliententity.getChartset());
byte[] timestampBytes = timestamp.getBytes(cliententity.getChartset());
req.setAuthenticatorSource(DigestUtils.md5(Bytes.concat(userBytes, new byte[9], passwdBytes, timestampBytes)));
req.setVersion(cliententity.getVersion());
ch.writeAndFlush(req);
logger.info("session Start :Send CmppConnectRequestMessage seq :{}", req.getHeader().getSequenceId());
}
Aggregations