ArrayList<Sms> al2 = segm.smsList; for (int i2 = 0; i2 < al.size(); i2++) { Sms smsx = smsSet.getSms(i2); if (!this.checkSmsPresent(smsx)) { smsx.setSmsSet(this);
smsSet2.addSms(smsSet.getSms(0)); if (smsSet2.getCorrelationId() == null) {
Sms sms = smsSet.getSms(i1); sms.setInvokedByAlert(true);
public Sms c2_getRecordArchiveForMessageId(long messageId) throws PersistenceException { Sms sms = SmsSetCache.getInstance().getDeliveredMsgValue(messageId); if (sms != null) return sms; SmsSet result = null; try { // first step - today search Date date = new Date(); PreparedStatementCollection psc = getStatementCollection(date); result = this.doGetArchiveMsg(messageId, psc); if (result == null) { // second step - yesterday search Date date2 = new Date(date.getTime() - 1000 * 3600 * 24); psc = getStatementCollection(date2); result = this.doGetArchiveMsg(messageId, psc); } } catch (Exception e1) { String msg = "Failed getRecordArchiveForMessageId()"; throw new PersistenceException(msg, e1); } if (result != null) return result.getSms(0); else return null; }
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); }