Package org.smslib

Examples of org.smslib.StatusReportMessage


            cal2.set(Calendar.DAY_OF_MONTH, Integer.parseInt(dateStr.substring(6, 8)));
            dateStr = tokens.nextToken().replaceAll("\"", "");
            cal2.set(Calendar.HOUR_OF_DAY, Integer.parseInt(dateStr.substring(0, 2)));
            cal2.set(Calendar.MINUTE, Integer.parseInt(dateStr.substring(3, 5)));
            cal2.set(Calendar.SECOND, Integer.parseInt(dateStr.substring(6, 8)));
            msg = new StatusReportMessage(refNo, memIndex, getATHandler().getStorageLocations().substring((ml * 2), (ml * 2) + 2), cal1.getTime(), cal2.getTime());
            msg.setGatewayId(getGatewayId());
            Logger.getInstance().logDebug("IN-DTLS: MI:" + msg.getMemIndex(), null, getGatewayId());
            msgList.add(msg);
            incInboundMessageCount();
          }
View Full Code Here


                }
              }
            }
            else if (pdu instanceof SmsStatusReportPdu)
            {
              StatusReportMessage msg;
              msg = new StatusReportMessage((SmsStatusReportPdu) pdu, memIndex, getATHandler().getStorageLocations().substring((ml * 2), (ml * 2) + 2));
              msg.setGatewayId(getGatewayId());
              msgList.add(msg);
              incInboundMessageCount();
            }
            else
            {
              // this theoretically will never happen, but it occasionally does with phones
              // like some Sony Ericssons (e.g. Z610i, SENT messages are included in this list)
              // instead of throwing a RuntimeException, just ignore any messages that are not of type
              // SmsDeliveryPdu
              // SmsStatusReportPdu
              if (this.displayIllegalReceivedMessages)
              {
                Logger.getInstance().logError("Wrong type of PDU detected: " + pdu.getClass().getName(), null, getGatewayId());
                Logger.getInstance().logError("ERROR PDU: " + pduString, null, getGatewayId());
              }
            }
          }
          catch (Exception e)
          {
            // PduFactory will give an exception
            // for PDUs it can't understand
            UnknownMessage msg;
            msg = new UnknownMessage(pduString, memIndex, getATHandler().getStorageLocations().substring((ml * 2), (ml * 2) + 2));
            msg.setGatewayId(getGatewayId());
            msgList.add(msg);
            incInboundMessageCount();
            Logger.getInstance().logError("Unhandled SMS in inbox, skipping...", e, getGatewayId());
            Logger.getInstance().logError("ERROR PDU: " + pduString, null, getGatewayId());
          }
View Full Code Here

     if (MessageType.SMSC_DEL_RECEIPT.containedIn(deliverSm.getEsmClass())) {
       
         try {
             DeliveryReceipt delReceipt = deliverSm.getShortMessageAsDeliveryReceipt();
      
             StatusReportMessage statusReportMessage=new StatusReportMessage(delReceipt.getId(),deliverSm.getDestAddress(), deliverSm.getSourceAddr(), delReceipt.getText(),  delReceipt.getSubmitDate(),  delReceipt.getDoneDate());
            
             switch(delReceipt.getFinalStatus()){
             case DELIVRD:
               statusReportMessage.setStatus(DeliveryStatuses.DELIVERED);
               break;
             case REJECTD:
             case EXPIRED:
             case UNDELIV:
               statusReportMessage.setStatus(DeliveryStatuses.ABORTED);
               break;
             default:
               statusReportMessage.setStatus(DeliveryStatuses.UNKNOWN);
             }
            
             statusReportMessage.setGatewayId(getGatewayId());
             Service.getInstance().getNotifyQueueManager().getNotifyQueue().add(new InboundMessageNotification(getMyself(), MessageTypes.STATUSREPORT, statusReportMessage));
         } catch (InvalidDeliveryReceiptException e) {
           Logger.getInstance().logError("Failed getting delivery receipt.", e, getGatewayId());
           
         }
View Full Code Here

TOP

Related Classes of org.smslib.StatusReportMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.