protected BaseBindResp createBindResponse(BaseBind bindRequest, int statusCode) { BaseBindResp bindResponse = (BaseBindResp)bindRequest.createResponse(); bindResponse.setCommandStatus(statusCode); bindResponse.setSystemId(configuration.getSystemId()); // if the server supports an SMPP server version >= 3.4 AND the bind request // included an interface version >= 3.4, include an optional parameter with configured sc_interface_version TLV if (configuration.getInterfaceVersion() >= SmppConstants.VERSION_3_4 && bindRequest.getInterfaceVersion() >= SmppConstants.VERSION_3_4) { Tlv scInterfaceVersion = new Tlv(SmppConstants.TAG_SC_INTERFACE_VERSION, new byte[] { configuration.getInterfaceVersion() }); bindResponse.addOptionalParameter(scInterfaceVersion); } return bindResponse; }
static public String buildErrorMessage(BaseBindResp bindResponse) { if (bindResponse == null) { return "Bind request failed (response was null)"; } else { return "Unable to bind [error: 0x" + HexUtil.toHexString(bindResponse.getCommandStatus()) + " \"" + bindResponse.getResultMessage() + "\"]"; } }
if (bindResponse == null || bindResponse.getCommandStatus() != SmppConstants.STATUS_OK) { Tlv scInterfaceVersion = bindResponse.getOptionalParameter(SmppConstants.TAG_SC_INTERFACE_VERSION);
@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 (bindResponse == null || bindResponse.getCommandStatus() != SmppConstants.STATUS_OK) { Tlv scInterfaceVersion = bindResponse.getOptionalParameter(SmppConstants.TAG_SC_INTERFACE_VERSION);
@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; }
protected BaseBindResp createBindResponse(BaseBind bindRequest, int statusCode) { BaseBindResp bindResponse = (BaseBindResp)bindRequest.createResponse(); bindResponse.setCommandStatus(statusCode); bindResponse.setSystemId(configuration.getSystemId()); // if the server supports an SMPP server version >= 3.4 AND the bind request // included an interface version >= 3.4, include an optional parameter with configured sc_interface_version TLV if (configuration.getInterfaceVersion() >= SmppConstants.VERSION_3_4 && bindRequest.getInterfaceVersion() >= SmppConstants.VERSION_3_4) { Tlv scInterfaceVersion = new Tlv(SmppConstants.TAG_SC_INTERFACE_VERSION, new byte[] { configuration.getInterfaceVersion() }); bindResponse.addOptionalParameter(scInterfaceVersion); } return bindResponse; }
static public String buildErrorMessage(BaseBindResp bindResponse) { if (bindResponse == null) { return "Bind request failed (response was null)"; } else { return "Unable to bind [error: 0x" + HexUtil.toHexString(bindResponse.getCommandStatus()) + " \"" + bindResponse.getResultMessage() + "\"]"; } }
if (bindResponse == null || bindResponse.getCommandStatus() != SmppConstants.STATUS_OK) { Tlv scInterfaceVersion = bindResponse.getOptionalParameter(SmppConstants.TAG_SC_INTERFACE_VERSION);
@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; }
protected BaseBindResp createBindResponse(BaseBind bindRequest, int statusCode) { BaseBindResp bindResponse = (BaseBindResp)bindRequest.createResponse(); bindResponse.setCommandStatus(statusCode); bindResponse.setSystemId(configuration.getSystemId()); // if the server supports an SMPP server version >= 3.4 AND the bind request // included an interface version >= 3.4, include an optional parameter with configured sc_interface_version TLV if (configuration.getInterfaceVersion() >= SmppConstants.VERSION_3_4 && bindRequest.getInterfaceVersion() >= SmppConstants.VERSION_3_4) { Tlv scInterfaceVersion = new Tlv(SmppConstants.TAG_SC_INTERFACE_VERSION, new byte[] { configuration.getInterfaceVersion() }); bindResponse.addOptionalParameter(scInterfaceVersion); } return bindResponse; }
static public String buildErrorMessage(BaseBindResp bindResponse) { if (bindResponse == null) { return "Bind request failed (response was null)"; } else { return "Unable to bind [error: 0x" + HexUtil.toHexString(bindResponse.getCommandStatus()) + " \"" + bindResponse.getResultMessage() + "\"]"; } }
if (bindResponse == null || bindResponse.getCommandStatus() != SmppConstants.STATUS_OK) { Tlv scInterfaceVersion = bindResponse.getOptionalParameter(SmppConstants.TAG_SC_INTERFACE_VERSION);
@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; }
protected BaseBindResp createBindResponse(BaseBind bindRequest, int statusCode) { BaseBindResp bindResponse = (BaseBindResp)bindRequest.createResponse(); bindResponse.setCommandStatus(statusCode); bindResponse.setSystemId(configuration.getSystemId()); // if the server supports an SMPP server version >= 3.4 AND the bind request // included an interface version >= 3.4, include an optional parameter with configured sc_interface_version TLV if (configuration.getInterfaceVersion() >= SmppConstants.VERSION_3_4 && bindRequest.getInterfaceVersion() >= SmppConstants.VERSION_3_4) { Tlv scInterfaceVersion = new Tlv(SmppConstants.TAG_SC_INTERFACE_VERSION, new byte[] { configuration.getInterfaceVersion() }); bindResponse.addOptionalParameter(scInterfaceVersion); } return bindResponse; }
static public String buildErrorMessage(BaseBindResp bindResponse) { if (bindResponse == null) { return "Bind request failed (response was null)"; } else { return "Unable to bind [error: 0x" + HexUtil.toHexString(bindResponse.getCommandStatus()) + " \"" + bindResponse.getResultMessage() + "\"]"; } }