- /* See GSM 03.40 section 9.2.3.11 (TP-Service-Centre-Time-Stamp) */
-#ifdef DEBUG
- fprintf(stdout, _(" SMSC response date: "));
-#endif
- GSM_DecodeSMSDateTime(&SMS->SMSCTime, ETSI->SMSCDateTime);
-
- if (ETSI->TPStatus < 0x03) {
- strcpy(SMS->MessageText,_("Delivered"));
-
-#ifdef DEBUG
- /* more detailed reason only for debug */
- /* See GSM 03.40 section 9.2.3.15 (TP-Status) */
- switch (ETSI->TPStatus) {
- case 0x00: fprintf(stdout, _(" SM received by the SME"));break;
- case 0x01: fprintf(stdout, _(" SM forwarded by the SC to the SME but the SC is unable to confirm delivery"));break;
- case 0x02: fprintf(stdout, _(" SM replaced by the SC"));break;
- }
-#endif /* DEBUG */
-
- SMS->Length = 10;
-
- } else if (ETSI->TPStatus & 0x40) {
-
- strcpy(SMS->MessageText,_("Failed"));
-
-#ifdef DEBUG
- /* more detailed reason only for debug */
- if (ETSI->TPStatus & 0x20) {
-
- /* See GSM 03.40 section 9.2.3.15 (TP-Status) */
- fprintf(stdout, _(" Temporary error, SC is not making any more transfer attempts\n"));
- switch (ETSI->TPStatus) {
- case 0x60: fprintf(stdout, _(" Congestion"));break;
- case 0x61: fprintf(stdout, _(" SME busy"));break;
- case 0x62: fprintf(stdout, _(" No response from SME"));break;
- case 0x63: fprintf(stdout, _(" Service rejected"));break;
- case 0x64: fprintf(stdout, _(" Quality of service not available"));break;
- case 0x65: fprintf(stdout, _(" Error in SME"));break;
- default : fprintf(stdout, _(" Reserved/Specific to SC: %x"),ETSI->TPStatus);break;
- }
-
- } else {
-
- /* See GSM 03.40 section 9.2.3.15 (TP-Status) */
- fprintf(stdout, _(" Permanent error, SC is not making any more transfer attempts\n"));
- switch (ETSI->TPStatus) {
- case 0x40: fprintf(stdout, _(" Remote procedure error"));break;
- case 0x41: fprintf(stdout, _(" Incompatibile destination"));break;
- case 0x42: fprintf(stdout, _(" Connection rejected by SME"));break;
- case 0x43: fprintf(stdout, _(" Not obtainable"));break;
- case 0x44: fprintf(stdout, _(" Quality of service not available"));break;
- case 0x45: fprintf(stdout, _(" No internetworking available"));break;
- case 0x46: fprintf(stdout, _(" SM Validity Period Expired"));break;
- case 0x47: fprintf(stdout, _(" SM deleted by originating SME"));break;
- case 0x48: fprintf(stdout, _(" SM Deleted by SC Administration"));break;
- case 0x49: fprintf(stdout, _(" SM does not exist"));break;
- default : fprintf(stdout, _(" Reserved/Specific to SC: %x"),ETSI->TPStatus);break;
- }
- }
-#endif /* DEBUG */
-
- SMS->Length = 6;
- } else if (ETSI->TPStatus & 0x20) {
- strcpy(SMS->MessageText,_("Pending"));
-
-#ifdef DEBUG
- /* more detailed reason only for debug */
- /* See GSM 03.40 section 9.2.3.15 (TP-Status) */
- fprintf(stdout, _(" Temporary error, SC still trying to transfer SM\n"));
- switch (ETSI->TPStatus) {
- case 0x20: fprintf(stdout, _(" Congestion"));break;
- case 0x21: fprintf(stdout, _(" SME busy"));break;
- case 0x22: fprintf(stdout, _(" No response from SME"));break;
- case 0x23: fprintf(stdout, _(" Service rejected"));break;
- case 0x24: fprintf(stdout, _(" Quality of service not aviable"));break;
- case 0x25: fprintf(stdout, _(" Error in SME"));break;
- default : fprintf(stdout, _(" Reserved/Specific to SC: %x"),ETSI->TPStatus);break;
- }
-#endif /* DEBUG */
- SMS->Length = 7;
- } else {
- strcpy(SMS->MessageText,_("Unknown"));
-
-#ifdef DEBUG
- /* more detailed reason only for debug */
- fprintf(stdout, _(" Reserved/Specific to SC: %x"),ETSI->TPStatus);
-#endif /* DEBUG */
- SMS->Length = 8;
- }
-
-#ifdef DEBUG
- fprintf(stdout, _("\n"));
-#endif /* DEBUG */
-
- return GE_NONE;