com.cloudhopper.smpp.type.Address.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(10.0k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中com.cloudhopper.smpp.type.Address.<init>()方法的一些代码示例,展示了Address.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.<init>()方法的具体详情如下:
包路径:com.cloudhopper.smpp.type.Address
类名称:Address
方法名:<init>

Address.<init>介绍

暂无

代码示例

代码示例来源:origin: traccar/traccar

  1. submit.setSourceAddress(command ? new Address(commandSourceTon, commandSourceNpi, commandSourceAddress)
  2. : new Address(sourceTon, sourceNpi, sourceAddress));
  3. submit.setDestAddress(new Address(destTon, destNpi, destAddress));
  4. SubmitSmResp submitResponce = getSession().submit(submit, submitTimeout);
  5. if (submitResponce.getCommandStatus() == SmppConstants.STATUS_OK) {

代码示例来源:origin: MavoCz/smscsim

  1. @Override
  2. public DeliverSm createMessage() throws Exception {
  3. Address sourceAddress = new Address((byte) sourceAddressTon, (byte) sourceAddressNpi, sourceAddressDigits);
  4. Address destinationAddress = new Address((byte) destAddressTon, (byte) destAddressNpi, destAddressDigits);
  5. DeliverSm pdu = SmppPduUtils.createDeliverSm(sourceAddress, destinationAddress, sessionManager.getNextSequenceNumber());
  6. return pdu;
  7. }

代码示例来源:origin: MavoCz/smscsim

  1. @ManagedOperation
  2. public void sendSegmentedDeliverMsgUdh00(int numberOfSegments) throws Exception {
  3. Address sourceAddress = new Address((byte) 0, (byte) 0, "123456789");
  4. Address destinationAddress = new Address((byte) 0, (byte) 0, "987654321");
  5. int msgRefNum = nextMsgRefNum.incrementAndGet();
  6. for (int i = 1; i <= numberOfSegments; i++) {
  7. String shortMessage = "Segment content " + i + ". ";
  8. DeliverSm pdu = SmppPduUtils.createDeliverSm(sourceAddress, destinationAddress, getSessionManager().getNextSequenceNumber());
  9. SmppPduUtils.setSegmentUdh00AndMessage(pdu, msgRefNum, i, numberOfSegments, shortMessage);
  10. send(pdu);
  11. }
  12. }

代码示例来源:origin: MavoCz/smscsim

  1. @ManagedOperation
  2. public void sendSegmentedDeliverMsgUdh08(int numberOfSegments) throws Exception {
  3. Address sourceAddress = new Address((byte) 0, (byte) 0, "123456789");
  4. Address destinationAddress = new Address((byte) 0, (byte) 0, "987654321");
  5. int msgRefNum = nextMsgRefNum.incrementAndGet();
  6. for (int i = 1; i <= numberOfSegments; i++) {
  7. String shortMessage = "Segment content " + i + ". ";
  8. DeliverSm pdu = SmppPduUtils.createDeliverSm(sourceAddress, destinationAddress, getSessionManager().getNextSequenceNumber());
  9. SmppPduUtils.setSegmentUdh08AndMessage(pdu, msgRefNum, i, numberOfSegments, shortMessage);
  10. send(pdu);
  11. }
  12. }

代码示例来源:origin: MavoCz/smscsim

  1. @ManagedOperation
  2. public void sendSegmentedDeliverLongMsg(int numberOfSegments, int minMsgSize) throws Exception {
  3. Address sourceAddress = new Address((byte) 0, (byte) 0, "123456789");
  4. Address destinationAddress = new Address((byte) 0, (byte) 0, "987654321");
  5. int msgRefNum = nextMsgRefNum.incrementAndGet();
  6. for (int i = 1; i <= numberOfSegments; i++) {
  7. StringBuilder sb = new StringBuilder(255);
  8. sb.append("Segment content ");
  9. sb.append(i);
  10. sb.append(". ");
  11. while (sb.length() < minMsgSize) {
  12. sb.append(".");
  13. }
  14. String shortMessage = sb.toString();
  15. DeliverSm pdu = SmppPduUtils.createDeliverSm(sourceAddress, destinationAddress, getSessionManager().getNextSequenceNumber());
  16. SmppPduUtils.setSegmentOptionalParams(pdu, msgRefNum, i, numberOfSegments);
  17. byte[] body = CharsetUtil.encode(shortMessage, CharsetUtil.CHARSET_GSM);
  18. if (body.length < 256) {
  19. pdu.setShortMessage(body);
  20. } else {
  21. SmppPduUtils.setMessagePayloadOptionalParams(pdu, body);
  22. }
  23. pdu.setDataCoding(SmppConstants.DATA_CODING_8BITA);
  24. send(pdu);
  25. }
  26. }

代码示例来源:origin: MavoCz/smscsim

  1. @ManagedOperation
  2. public void sendSegmentedDeliverMsg(int numberOfSegments) throws Exception {
  3. Address sourceAddress = new Address((byte) 0, (byte) 0, "123456789");
  4. Address destinationAddress = new Address((byte) 0, (byte) 0, "987654321");
  5. int msgRefNum = nextMsgRefNum.incrementAndGet();
  6. for (int i = 1; i <= numberOfSegments; i++) {
  7. String shortMessage = "Segment content " + i + ". ";
  8. DeliverSm pdu = SmppPduUtils.createDeliverSm(sourceAddress, destinationAddress, getSessionManager().getNextSequenceNumber());
  9. SmppPduUtils.setSegmentOptionalParams(pdu, msgRefNum, i, numberOfSegments);
  10. pdu.setShortMessage(CharsetUtil.encode(shortMessage, CharsetUtil.CHARSET_GSM));
  11. send(pdu);
  12. }
  13. }

代码示例来源:origin: MavoCz/smscsim

  1. @ManagedOperation
  2. public void sendSegmentedBinaryDeliverMsg(int numberOfSegments) throws Exception {
  3. Address sourceAddress = new Address((byte) 0, (byte) 0, "123456789");
  4. Address destinationAddress = new Address((byte) 0, (byte) 0, "987654321");
  5. int msgRefNum = nextMsgRefNum.incrementAndGet();
  6. for (int i = 1; i <= numberOfSegments; i++) {
  7. String shortMessage = "Segment content " + i + ". ";
  8. DeliverSm pdu = SmppPduUtils.createDeliverSm(sourceAddress, destinationAddress, getSessionManager().getNextSequenceNumber());
  9. SmppPduUtils.setSegmentOptionalParams(pdu, msgRefNum, i, numberOfSegments);
  10. pdu.setShortMessage(CharsetUtil.encode(shortMessage, CharsetUtil.NAME_GSM));
  11. pdu.setDataCoding((byte) 0x02); // 8 bit binary encoding
  12. send(pdu);
  13. }
  14. }

代码示例来源:origin: twitter-archive/cloudhopper-smpp

  1. /**
  2. * Read and create a new Address from a buffer. Checks if there is
  3. * a minimum number of bytes readable from the buffer.
  4. * @param buffer
  5. * @return
  6. * @throws UnrecoverablePduEncodingException
  7. * @throws RecoverablePduEncodingException
  8. */
  9. static public Address readAddress(ChannelBuffer buffer) throws UnrecoverablePduException, RecoverablePduException {
  10. // an address is at least 3 bytes long (ton, npi, and null byte)
  11. if (buffer.readableBytes() < 3) {
  12. throw new NotEnoughDataInBufferException("Parsing address", buffer.readableBytes(), 3);
  13. }
  14. Address address = new Address();
  15. address.read(buffer);
  16. return address;
  17. }

代码示例来源:origin: org.restcomm.smpp/ch-smpp

  1. /**
  2. * Read and create a new Address from a buffer. Checks if there is
  3. * a minimum number of bytes readable from the buffer.
  4. * @param buffer
  5. * @return
  6. * @throws UnrecoverablePduEncodingException
  7. * @throws RecoverablePduEncodingException
  8. */
  9. static public Address readAddress(ChannelBuffer buffer) throws UnrecoverablePduException, RecoverablePduException {
  10. // an address is at least 3 bytes long (ton, npi, and null byte)
  11. if (buffer.readableBytes() < 3) {
  12. throw new NotEnoughDataInBufferException("Parsing address", buffer.readableBytes(), 3);
  13. }
  14. Address address = new Address();
  15. address.read(buffer);
  16. return address;
  17. }

代码示例来源:origin: com.fizzed/ch-smpp

  1. /**
  2. * Read and create a new Address from a buffer. Checks if there is
  3. * a minimum number of bytes readable from the buffer.
  4. * @param buffer
  5. * @return
  6. * @throws UnrecoverablePduEncodingException
  7. * @throws RecoverablePduEncodingException
  8. */
  9. static public Address readAddress(ChannelBuffer buffer) throws UnrecoverablePduException, RecoverablePduException {
  10. // an address is at least 3 bytes long (ton, npi, and null byte)
  11. if (buffer.readableBytes() < 3) {
  12. throw new NotEnoughDataInBufferException("Parsing address", buffer.readableBytes(), 3);
  13. }
  14. Address address = new Address();
  15. address.read(buffer);
  16. return address;
  17. }

代码示例来源:origin: MavoCz/smscsim

  1. @ManagedOperation
  2. public void sendSegmentedDeliverMsgRandomized(int numberOfMessages, int numberOfSegments) throws Exception {
  3. for (int msgNum = 0; msgNum < numberOfMessages; msgNum++) {
  4. Address sourceAddress = new Address((byte) 0, (byte) 0, "123456789");
  5. Address destinationAddress = new Address((byte) 0, (byte) 0, "987654321");
  6. int msgRefNum = nextMsgRefNum.incrementAndGet();
  7. for (int i = 1; i <= numberOfSegments; i++) {
  8. String shortMessage = "Msg " + msgNum + ". Segment content " + i + ". ";
  9. DeliverSm pdu = SmppPduUtils.createDeliverSm(sourceAddress, destinationAddress, getSessionManager().getNextSequenceNumber());
  10. SmppPduUtils.setSegmentOptionalParams(pdu, msgRefNum, i, numberOfSegments);
  11. pdu.setShortMessage(CharsetUtil.encode(shortMessage, CharsetUtil.CHARSET_GSM));
  12. getDeliverSender().scheduleDelivery(new PduRequestRecord(pdu, 1000, 5000));
  13. }
  14. }
  15. }

代码示例来源:origin: com.cloudhopper/ch-smpp

  1. /**
  2. * Read and create a new Address from a buffer. Checks if there is
  3. * a minimum number of bytes readable from the buffer.
  4. * @param buffer
  5. * @return
  6. * @throws UnrecoverablePduEncodingException
  7. * @throws RecoverablePduEncodingException
  8. */
  9. static public Address readAddress(ChannelBuffer buffer) throws UnrecoverablePduException, RecoverablePduException {
  10. // an address is at least 3 bytes long (ton, npi, and null byte)
  11. if (buffer.readableBytes() < 3) {
  12. throw new NotEnoughDataInBufferException("Parsing address", buffer.readableBytes(), 3);
  13. }
  14. Address address = new Address();
  15. address.read(buffer);
  16. return address;
  17. }

代码示例来源:origin: wizardjedi/my-spring-learning

  1. sm.setSourceAddress(new Address((byte)5, (byte)0, "Test"));
  2. sm.setDestAddress(new Address((byte)1, (byte)1, "79111234567"));

代码示例来源:origin: org.mobicents.smsc/smpp-simulator

  1. pdu = deliverPdu;
  2. pdu.setSourceAddress(new Address((byte) param.getSourceTON().getCode(), (byte) param.getSourceNPI().getCode(),
  3. param.getSourceAddress()));
  4. pdu.setDestAddress(new Address((byte) param.getDestTON().getCode(), (byte) param.getDestNPI().getCode(),
  5. param.getDestAddress()));

代码示例来源:origin: tdelenikas/smslib

  1. submitRequest.setSourceAddress(new Address(getTON(message.getOriginatorAddress()), getNPI(message.getOriginatorAddress()), message.getOriginatorAddress().getAddress()));
  2. submitRequest.setDestAddress(new Address(getTON(message.getRecipientAddress()), getNPI(message.getRecipientAddress()), message.getRecipientAddress().getAddress()));
  3. switch (message.getEncoding())

代码示例来源:origin: org.mobicents.smsc/smpp-simulator

  1. config0.setSystemId(this.param.getSystemId());
  2. config0.setPassword(this.param.getPassword());
  3. config0.setAddressRange(new Address((byte) 1, (byte) 1, this.param.getAddressRange()));
  4. config0.getLoggingOptions().setLogBytes(true);

代码示例来源:origin: org.mobicents.smsc/smpp-simulator

  1. pdu.setSourceAddress(new Address((byte)this.param.getSourceTON().getCode(), (byte)this.param.getSourceNPI().getCode(), this.param.getSourceAddress()));
  2. ((SubmitMulti) pdu).addDestAddresses(new Address((byte) this.param.getDestTON().getCode(), (byte) this.param.getDestNPI().getCode(), String
  3. .valueOf(daOrig + i2)));
  4. pdu.setDestAddress(new Address((byte) this.param.getDestTON().getCode(), (byte) this.param.getDestNPI().getCode(), destAddr));

代码示例来源:origin: org.restcomm.smpp/smpp-extensions

  1. String addressRange = esme.getEsmeAddressRange();
  2. Address addressRangeObj = new Address();
  3. if(addressTon!=-1){
  4. addressRangeObj.setTon((byte)addressTon);

代码示例来源:origin: org.mobicents.smsc/smpp

  1. String addressRange = esme.getEsmeAddressRange();
  2. Address addressRangeObj = new Address();
  3. if(addressTon!=-1){
  4. addressRangeObj.setTon((byte)addressTon);

相关文章