}
}
}
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());
}