logger.debug("Bound failed for systemId=" + request.getSystemId()); this.close(); } catch (Exception e) { logger.debug("Exception after bind failed for systemId=" + request.getSystemId());
@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; }
Esme esme = this.esmeManagement.getEsmeByPrimaryKey(bindRequest.getSystemId(), sessionConfiguration.getHost(), sessionConfiguration.getPort(), smppBindType); logger.error(String.format( "Received BIND request but no ESME configured for SystemId=%s Host=%s Port=%d SmppBindType=%s", bindRequest.getSystemId(), sessionConfiguration.getHost(), sessionConfiguration.getPort(), smppBindType)); throw new SmppProcessingException(SmppConstants.STATUS_INVSYSID); logger.error(String.format( "Received BIND request but ESME Already in Bound State Name=%s SystemId=%s Host=%s Port=%d", esme.getName(), bindRequest.getSystemId(), esme.getHost(), esme.getPort())); throw new SmppProcessingException(SmppConstants.STATUS_ALYBND); 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);
Esme esme = this.esmeManagement.getEsmeByPrimaryKey(bindRequest.getSystemId(), sessionConfiguration.getHost(), sessionConfiguration.getPort(), smppBindType); logger.error(String.format( "Received BIND request but no ESME configured for SystemId=%s Host=%s Port=%d SmppBindType=%s", bindRequest.getSystemId(), sessionConfiguration.getHost(), sessionConfiguration.getPort(), smppBindType)); throw new SmppProcessingException(SmppConstants.STATUS_INVSYSID); logger.error(String.format( "Received BIND request but ESME Already in Bound State Name=%s SystemId=%s Host=%s Port=%d", esme.getName(), bindRequest.getSystemId(), esme.getHost(), esme.getPort())); throw new SmppProcessingException(SmppConstants.STATUS_ALYBND); 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);
protected SmppSessionConfiguration createSessionConfiguration(BaseBind bindRequest) { SmppSessionConfiguration sessionConfiguration = new SmppSessionConfiguration(); sessionConfiguration.setName("SmppServerSession." + bindRequest.getSystemId() + "." + bindRequest.getSystemType()); sessionConfiguration.setSystemId(bindRequest.getSystemId()); sessionConfiguration.setPassword(bindRequest.getPassword()); sessionConfiguration.setSystemType(bindRequest.getSystemType());
protected SmppSessionConfiguration createSessionConfiguration(BaseBind bindRequest) { SmppSessionConfiguration sessionConfiguration = new SmppSessionConfiguration(); sessionConfiguration.setName("SmppServerSession." + bindRequest.getSystemId() + "." + bindRequest.getSystemType()); sessionConfiguration.setSystemId(bindRequest.getSystemId()); sessionConfiguration.setPassword(bindRequest.getPassword()); sessionConfiguration.setSystemType(bindRequest.getSystemType());
protected SmppSessionConfiguration createSessionConfiguration(BaseBind bindRequest) { SmppSessionConfiguration sessionConfiguration = new SmppSessionConfiguration(); sessionConfiguration.setName("SmppServerSession." + bindRequest.getSystemId() + "." + bindRequest.getSystemType()); sessionConfiguration.setSystemId(bindRequest.getSystemId()); sessionConfiguration.setPassword(bindRequest.getPassword()); sessionConfiguration.setSystemType(bindRequest.getSystemType());
protected SmppSessionConfiguration createSessionConfiguration(BaseBind bindRequest) { SmppSessionConfiguration sessionConfiguration = new SmppSessionConfiguration(); sessionConfiguration.setName("SmppServerSession." + bindRequest.getSystemId() + "." + bindRequest.getSystemType()); sessionConfiguration.setSystemId(bindRequest.getSystemId()); sessionConfiguration.setPassword(bindRequest.getPassword()); sessionConfiguration.setSystemType(bindRequest.getSystemType());