public TargetAddress(SmsSet smsSet) { this.addrTon = smsSet.getDestAddrTon(); this.addrNpi = smsSet.getDestAddrNpi(); this.addr = smsSet.getDestAddr(); this.networkId = smsSet.getNetworkId(); this.targetId = formTargetId(); }
@Override public String getDestAddr() { return sms.getSmsSet().getDestAddr(); }
private void doSetDestCluster(SmsSet smsSet) { // Step 1: Check first if this SMS is for SMPP SmsRouteManagement smsRouteManagement = SmsRouteManagement.getInstance(); //Quick and dirty fix for SMSC-171 String orignatingEsmeName = smsSet.getSms(0).getOrigEsmeName(); String destClusterName = smsRouteManagement.getEsmeClusterName(smsSet.getDestAddrTon(), smsSet.getDestAddrNpi(), smsSet.getDestAddr(), orignatingEsmeName, smsSet.getNetworkId()); // Step 2: If no SMPP's found, check if its for SIP // TODO: we possibly do not need to send a SIP-originated message back to SIP if (destClusterName == null) { destClusterName = smsRouteManagement.getSipClusterName(smsSet.getDestAddrTon(), smsSet.getDestAddrNpi(), smsSet.getDestAddr(), smsSet.getNetworkId()); if (destClusterName == null) { // Step 2: If no SIP's found, its for SS7 smsSet.setType(SmType.SMS_FOR_SS7); } else { smsSet.setType(SmType.SMS_FOR_SIP); } } else { // smsSet.setType(destClusterName != null ? SmType.SMS_FOR_ESME // : SmType.SMS_FOR_SS7); smsSet.setType(SmType.SMS_FOR_ESME); } smsSet.setDestClusterName(destClusterName); }
@Override public String getDestAddr() { return sms.getSmsSet().getDestAddr(); }
/** * Creating a new SmsSet for Sms * @param sms */ public static void createNewSmsSetForSms(Sms sms) { SmsSet smsSet = new SmsSet(); smsSet.setDestAddr(sms.getSmsSet().getDestAddr()); smsSet.setDestAddrNpi(sms.getSmsSet().getDestAddrNpi()); smsSet.setDestAddrTon(sms.getSmsSet().getDestAddrTon()); smsSet.setCorrelationId(sms.getSmsSet().getCorrelationId()); smsSet.setNetworkId(sms.getSmsSet().getNetworkId()); smsSet.addSms(sms); }
BoundStatement boundStatement = new BoundStatement(ps); boundStatement.setLong(Schema.COLUMN_MESSAGE_ID, sms.getMessageId()); boundStatement.setString(Schema.COLUMN_ADDR_DST_DIGITS, sms.getSmsSet().getDestAddr()); boundStatement.setUUID(Schema.COLUMN_ID, sms.getDbId()); ResultSet res = session.execute(boundStatement);
public static Sms createReceiptSms(Sms sms, boolean delivered, String extraString, boolean tempFailure) { Sms receipt = new Sms(); receipt.setDbId(UUID.randomUUID()); receipt.setSourceAddr(sms.getSmsSet().getDestAddr()); receipt.setSourceAddrNpi(sms.getSmsSet().getDestAddrNpi()); receipt.setSourceAddrTon(sms.getSmsSet().getDestAddrTon()); receipt.setSubmitDate(sms.getSubmitDate()); receipt.setMessageId(sms.getMessageId()); Date validityPeriod = MessageUtil.addHours(new Date(), 24); receipt.setValidityPeriod(validityPeriod); String rcpt = createDeliveryReceiptMessage(sms.getMessageIdText(), sms.getSubmitDate(), new Timestamp(System.currentTimeMillis()), sms.getSmsSet().getStatus().getCode(), sms.getShortMessageText(), delivered, extraString, tempFailure); // TODO: now we are sending all in GSM7 encoding receipt.setDataCoding(0); receipt.setShortMessageText(rcpt); receipt.setReceiptLocalMessageId(sms.getMessageId()); receipt.setOriginationType(OriginationType.LOCAL_ORIG); receipt.setEsmClass(ESME_DELIVERY_ACK | (sms.getEsmClass() & 0x03)); return receipt; }
.append(smsEvent.getSourceAddrNpi()) .append(CdrGenerator.CDR_SEPARATOR) .append(smsEvent.getSmsSet().getDestAddr()) .append(CdrGenerator.CDR_SEPARATOR) .append(smsEvent.getSmsSet().getDestAddrTon())
public static Sms createSmsStatusReport(Sms sms, boolean delivered, TargetAddress ta, boolean origNetworkIdForReceipts) { Sms smsStatusReport = new Sms(); smsStatusReport.setDbId(UUID.randomUUID()); smsStatusReport.setSourceAddr(sms.getSmsSet().getDestAddr()); smsStatusReport.setSourceAddrNpi(sms.getSmsSet().getDestAddrNpi()); smsStatusReport.setSourceAddrTon(sms.getSmsSet().getDestAddrTon());
sms.setSourceAddr(sms0.getSmsSet().getDestAddr()); sms.setSourceAddrNpi(sms0.getSmsSet().getDestAddrNpi()); sms.setSourceAddrTon(sms0.getSmsSet().getDestAddrTon()); smsSet.setDestAddrTon(sms0.getSourceAddrTon()); } else { smsSet.setDestAddr(sms0.getSmsSet().getDestAddr()); smsSet.setDestAddrNpi(sms0.getSmsSet().getDestAddrNpi()); smsSet.setDestAddrTon(sms0.getSmsSet().getDestAddrTon());
boundStatement.setUUID(Schema.COLUMN_SMSC_UUID, emptyUuid); boundStatement.setString(Schema.COLUMN_ADDR_DST_DIGITS, sms.getSmsSet().getDestAddr()); boundStatement.setInt(Schema.COLUMN_ADDR_DST_TON, sms.getSmsSet().getDestAddrTon()); boundStatement.setInt(Schema.COLUMN_ADDR_DST_NPI, sms.getSmsSet().getDestAddrNpi());