submit.setSourceAddress(command ? new Address(commandSourceTon, commandSourceNpi, commandSourceAddress) : new Address(sourceTon, sourceNpi, sourceAddress)); submit.setDestAddress(new Address(destTon, destNpi, destAddress)); SubmitSmResp submitResponce = getSession().submit(submit, submitTimeout); if (submitResponce.getCommandStatus() == SmppConstants.STATUS_OK) { throw new MessageException(new SmppChannelException("SMPP session is not connected"));
@Override public PduResponse firePduRequestReceived(PduRequest request) { PduResponse response; try { if (request instanceof DeliverSm) { String sourceAddress = ((DeliverSm) request).getSourceAddress().getAddress(); String message = CharsetUtil.decode(((DeliverSm) request).getShortMessage(), smppClient.mapDataCodingToCharset(((DeliverSm) request).getDataCoding())); LOGGER.info("SMS Message Received: " + message.trim() + ", Source Address: " + sourceAddress); boolean isDeliveryReceipt; if (smppClient.getDetectDlrByOpts()) { isDeliveryReceipt = request.getOptionalParameters() != null; } else { isDeliveryReceipt = SmppUtil.isMessageTypeAnyDeliveryReceipt(((DeliverSm) request).getEsmClass()); } if (!isDeliveryReceipt) { TextMessageEventHandler.handleTextMessage(sourceAddress, message); } } response = request.createResponse(); } catch (Exception error) { LOGGER.warn("SMS receiving error", error); response = request.createResponse(); response.setResultMessage(error.getMessage()); response.setCommandStatus(SmppConstants.STATUS_UNKNOWNERR); } return response; }
sessionConfig.setSystemType(Context.getConfig().getString("sms.smpp.systemType", null)); sessionConfig.setPassword(Context.getConfig().getString("sms.smpp.password", "password")); sessionConfig.getLoggingOptions().setLogBytes(false); sessionConfig.getLoggingOptions().setLogPdu(Context.getConfig().getBoolean("sms.smpp.logPdu"));
public void setShortMessage(byte[] value) throws SmppInvalidArgumentException { if (value != null && value.length > 255) { throw new SmppInvalidArgumentException("A short message in a PDU can only be a max of 255 bytes [actual=" + value.length + "]; use optional parameter message_payload as an alternative"); } this.shortMessage = value; }
/** * Creates a new instance with the specified logger name. */ public SmppSessionLogger(String name) { this(name, new LoggingOptions()); }
/** * Calculates the byte size of an Address. Safe to call with nulls as a * parameter since this will then just return the size of an empty address. * @param value * @return */ static public int calculateByteSizeOfAddress(Address value) { if (value == null) { return SmppConstants.EMPTY_ADDRESS.calculateByteSize(); } else { return value.calculateByteSize(); } }
public SmppBindException(BaseBindResp bindResponse) { super(buildErrorMessage(bindResponse)); this.bindResponse = bindResponse; }
public UnexpectedPduResponseException(PduResponse responsePdu) { super(buildErrorMessage(responsePdu)); this.responsePdu = responsePdu; }
public void setShortMessage(byte[] value) throws SmppInvalidArgumentException { if (value != null && value.length > 255) { throw new SmppInvalidArgumentException("A short message in a PDU can only be a max of 255 bytes [actual=" + value.length + "]; use optional parameter message_payload as an alternative"); } this.shortMessage = value; }
/** * Creates a new instance with the specified logger name. */ public SmppSessionLogger(String name) { this(name, new LoggingOptions()); }
/** * Calculates the byte size of an Address. Safe to call with nulls as a * parameter since this will then just return the size of an empty address. * @param value * @return */ static public int calculateByteSizeOfAddress(Address value) { if (value == null) { return SmppConstants.EMPTY_ADDRESS.calculateByteSize(); } else { return value.calculateByteSize(); } }
public void setShortMessage(byte[] value) throws SmppInvalidArgumentException { if (value != null && value.length > 255) { throw new SmppInvalidArgumentException("A short message in a PDU can only be a max of 255 bytes [actual=" + value.length + "]; use optional parameter message_payload as an alternative"); } this.shortMessage = value; }
/** * Creates a new instance with the specified logger name. */ public SmppSessionLogger(String name) { this(name, new LoggingOptions()); }
/** * Calculates the byte size of an Address. Safe to call with nulls as a * parameter since this will then just return the size of an empty address. * @param value * @return */ static public int calculateByteSizeOfAddress(Address value) { if (value == null) { return SmppConstants.EMPTY_ADDRESS.calculateByteSize(); } else { return value.calculateByteSize(); } }
public void setShortMessage(byte[] value) throws SmppInvalidArgumentException { if (value != null && value.length > 255) { throw new SmppInvalidArgumentException("A short message in a PDU can only be a max of 255 bytes [actual=" + value.length + "]; use optional parameter message_payload as an alternative"); } this.shortMessage = value; }
/** * Creates a new instance with the specified logger name. */ public SmppSessionLogger(String name) { this(name, new LoggingOptions()); }
public void setShortMessage(byte[] value) throws SmppInvalidArgumentException { if (value != null && value.length > 255) { throw new SmppInvalidArgumentException("A short message in a PDU can only be a max of 255 bytes [actual=" + value.length + "]; use optional parameter message_payload as an alternative"); } this.shortMessage = value; }
public void setShortMessage(byte[] value) throws SmppInvalidArgumentException { if (value != null && value.length > 255) { throw new SmppInvalidArgumentException("A short message in a PDU can only be a max of 255 bytes [actual=" + value.length + "]; use optional parameter message_payload as an alternative"); } this.shortMessage = value; }
public void setShortMessage(byte[] value) throws SmppInvalidArgumentException { if (value != null && value.length > 255) { throw new SmppInvalidArgumentException("A short message in a PDU can only be a max of 255 bytes [actual=" + value.length + "]; use optional parameter message_payload as an alternative"); } this.shortMessage = value; }
public void setShortMessage(byte[] value) throws SmppInvalidArgumentException { if (value != null && value.length > 255) { throw new SmppInvalidArgumentException("A short message in a PDU can only be a max of 255 bytes [actual=" + value.length + "]; use optional parameter message_payload as an alternative"); } this.shortMessage = value; }