@Override public boolean process(SmppSimulatorSessionHandler session, Channel channel, Pdu pdu) throws Exception { // anything other than a bind is super bad! if (!(pdu instanceof BaseBind)) { if (pdu instanceof PduRequest) { session.addPduToWriteOnNextPduReceived(((PduRequest)pdu).createGenericNack(SmppConstants.STATUS_INVBNDSTS)); return true; } else { //logger.error("PDU response received, but not bound"); channel.close(); return true; } } BaseBind bind = (BaseBind)pdu; BaseBindResp bindResp = (BaseBindResp)bind.createResponse(); if (!bind.getSystemId().equals(systemId)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVSYSID); } else if (!bind.getPassword().equals(password)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVPASWD); } session.addPduToWriteOnNextPduReceived(bindResp); return true; }
@Override public boolean process(SmppSimulatorSessionHandler session, Channel channel, Pdu pdu) throws Exception { // anything other than a bind is super bad! if (!(pdu instanceof BaseBind)) { if (pdu instanceof PduRequest) { session.addPduToWriteOnNextPduReceived(((PduRequest)pdu).createGenericNack(SmppConstants.STATUS_INVBNDSTS)); return true; } else { //logger.error("PDU response received, but not bound"); channel.close(); return true; } } BaseBind bind = (BaseBind)pdu; BaseBindResp bindResp = (BaseBindResp)bind.createResponse(); if (!bind.getSystemId().equals(systemId)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVSYSID); } else if (!bind.getPassword().equals(password)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVPASWD); } session.addPduToWriteOnNextPduReceived(bindResp); return true; }
@Override public boolean process(SmppSimulatorSessionHandler session, Channel channel, Pdu pdu) throws Exception { // anything other than a bind is super bad! if (!(pdu instanceof BaseBind)) { if (pdu instanceof PduRequest) { session.addPduToWriteOnNextPduReceived(((PduRequest)pdu).createGenericNack(SmppConstants.STATUS_INVBNDSTS)); return true; } else { //logger.error("PDU response received, but not bound"); channel.close(); return true; } } BaseBind bind = (BaseBind)pdu; BaseBindResp bindResp = (BaseBindResp)bind.createResponse(); if (!bind.getSystemId().equals(systemId)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVSYSID); } else if (!bind.getPassword().equals(password)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVPASWD); } session.addPduToWriteOnNextPduReceived(bindResp); return true; }
@Override public boolean process(SmppSimulatorSessionHandler session, Channel channel, Pdu pdu) throws Exception { // anything other than a bind is super bad! if (!(pdu instanceof BaseBind)) { if (pdu instanceof PduRequest) { session.addPduToWriteOnNextPduReceived(((PduRequest)pdu).createGenericNack(SmppConstants.STATUS_INVBNDSTS)); return true; } else { //logger.error("PDU response received, but not bound"); channel.close(); return true; } } BaseBind bind = (BaseBind)pdu; BaseBindResp bindResp = (BaseBindResp)bind.createResponse(); if (!bind.getSystemId().equals(systemId)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVSYSID); } else if (!bind.getPassword().equals(password)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVPASWD); } session.addPduToWriteOnNextPduReceived(bindResp); return true; }
if (esme.getPassword() != null && !(esme.getPassword().equals(bindRequest.getPassword()))) { logger.error(String.format( "Received BIND request with password=%s but password set for ESME=%s for SystemId=%s", bindRequest.getPassword(), esme.getPassword(), bindRequest.getSystemId())); throw new SmppProcessingException(SmppConstants.STATUS_INVPASWD);
if (esme.getPassword() != null && !(esme.getPassword().equals(bindRequest.getPassword()))) { logger.error(String.format( "Received BIND request with password=%s but password set for ESME=%s for SystemId=%s", bindRequest.getPassword(), esme.getPassword(), bindRequest.getSystemId())); throw new SmppProcessingException(SmppConstants.STATUS_INVPASWD);
sessionConfiguration.setName("SmppServerSession." + bindRequest.getSystemId() + "." + bindRequest.getSystemType()); sessionConfiguration.setSystemId(bindRequest.getSystemId()); sessionConfiguration.setPassword(bindRequest.getPassword()); sessionConfiguration.setSystemType(bindRequest.getSystemType()); sessionConfiguration.setBindTimeout(server.getConfiguration().getBindTimeout());
sessionConfiguration.setName("SmppServerSession." + bindRequest.getSystemId() + "." + bindRequest.getSystemType()); sessionConfiguration.setSystemId(bindRequest.getSystemId()); sessionConfiguration.setPassword(bindRequest.getPassword()); sessionConfiguration.setSystemType(bindRequest.getSystemType()); sessionConfiguration.setBindTimeout(server.getConfiguration().getBindTimeout());
sessionConfiguration.setName("SmppServerSession." + bindRequest.getSystemId() + "." + bindRequest.getSystemType()); sessionConfiguration.setSystemId(bindRequest.getSystemId()); sessionConfiguration.setPassword(bindRequest.getPassword()); sessionConfiguration.setSystemType(bindRequest.getSystemType()); sessionConfiguration.setBindTimeout(server.getConfiguration().getBindTimeout());
sessionConfiguration.setName("SmppServerSession." + bindRequest.getSystemId() + "." + bindRequest.getSystemType()); sessionConfiguration.setSystemId(bindRequest.getSystemId()); sessionConfiguration.setPassword(bindRequest.getPassword()); sessionConfiguration.setSystemType(bindRequest.getSystemType()); sessionConfiguration.setBindTimeout(server.getConfiguration().getBindTimeout());