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

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

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

Address.getAddress介绍

暂无

代码示例

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

@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;
}

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

public boolean isSourceAddressMatching(Address sourceAddress) {
  // Check sourceTon
  if (this.sourceTon != -1 && this.sourceTon != sourceAddress.getTon()) {
    return false;
  }
  // Check sourceNpi
  if (this.sourceNpi != -1 && this.sourceNpi != sourceAddress.getNpi()) {
    return false;
  }
  // Check sourceAddress
  Matcher m = this.sourceAddressRangePattern.matcher(sourceAddress.getAddress());
  if (m.matches()) {
    return true;
  }
  return false;
}

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

public boolean isSourceAddressMatching(Address sourceAddress) {
  // Check sourceTon
  if (this.sourceTon != -1 && this.sourceTon != sourceAddress.getTon()) {
    return false;
  }
  // Check sourceNpi
  if (this.sourceNpi != -1 && this.sourceNpi != sourceAddress.getNpi()) {
    return false;
  }
  // Check sourceAddress
  Matcher m = this.sourceAddressRangePattern.matcher(sourceAddress.getAddress());
  if (m.matches()) {
    return true;
  }
  return false;
}

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

if (bindRequestAddressRange.getAddress() == null || bindRequestAddressRange.getAddress() == "") {
} else if (!bindRequestAddressRange.getAddress().equals(esme.getEsmeAddressRange())) {
  logger.error(String.format(
      "Received BIND request with Address_Range=%s but configured Address_Range=%s",
      bindRequestAddressRange.getAddress(), esme.getEsmeAddressRange()));
  throw new SmppProcessingException(SmppConstants.STATUS_INVBNDSTS);

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

if (bindRequestAddressRange.getAddress() == null || bindRequestAddressRange.getAddress() == "") {
} else if (!bindRequestAddressRange.getAddress().equals(esme.getEsmeAddressRange())) {
  logger.error(String.format(
      "Received BIND request with Address_Range=%s but configured Address_Range=%s",
      bindRequestAddressRange.getAddress(), esme.getEsmeAddressRange()));
  throw new SmppProcessingException(SmppConstants.STATUS_INVBNDSTS);

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

.format("Incoming SUBMIT_SM's sequence_number=%d source_addr_ton=%d source_addr_npi=%d source_addr=%s doesn't match with configured ESME name=%s source_addr_ton=%d source_addr_npi=%d source_addr=%s",
    submitSm.getSequenceNumber(), sourceAddress.getTon(), sourceAddress.getNpi(),
    sourceAddress.getAddress(), this.esme.getName(), this.esme.getSourceTon(),
    this.esme.getSourceNpi(), this.esme.getSourceAddressRange()));
.format("Incoming DATA_SM's sequence_number=%d source_addr_ton=%d source_addr_npi=%d source_addr=%s doesn't match with configured ESME name=%s source_addr_ton=%d source_addr_npi=%d source_addr=%s",
    dataSm.getSequenceNumber(), sourceAddress.getTon(), sourceAddress.getNpi(),
    sourceAddress.getAddress(), this.esme.getName(), this.esme.getSourceTon(),
    this.esme.getSourceNpi(), this.esme.getSourceAddressRange()));
.format("Incoming DELIVER_SM's sequence_number=%d source_addr_ton=%d source_addr_npi=%d source_addr=%s doesn't match with configured ESME name=%s source_addr_ton=%d source_addr_npi=%d source_addr=%s",
    deliverSm.getSequenceNumber(), sourceAddress.getTon(), sourceAddress.getNpi(),
    sourceAddress.getAddress(), this.esme.getName(), this.esme.getSourceTon(),
    this.esme.getSourceNpi(), this.esme.getSourceAddressRange()));
.format("Incoming SUBMIT_MULTI's sequence_number=%d source_addr_ton=%d source_addr_npi=%d source_addr=%s doesn't match with configured ESME name=%s source_addr_ton=%d source_addr_npi=%d source_addr=%s",
    submitMulti.getSequenceNumber(), sourceAddress.getTon(), sourceAddress.getNpi(),
    sourceAddress.getAddress(), this.esme.getName(), this.esme.getSourceTon(),
    this.esme.getSourceNpi(), this.esme.getSourceAddressRange()));

相关文章