The PDU string contains not only the message, but also a lot of meta-information about the sender, his SMS service center, the time stamp etc.
It is all in the form of hexa-decimal octets or decimal semi-octets.
Example of PDU:
This octet sequence consists of three parts:
- An initial octet indicating the length of the SMSC (Short Message Service Center) information ("07"),
- the SMSC (Short Message Service Center) information itself ("917283010010F5"),
- the SMS_DELIVER part (specified by ETSI in GSM 03.40).
||Length of the SMSC (Short Message Service Center) information (in this case 7 octets)
||Type-of-address of the SMSC (Short Message Service Center). (91 means international format of the phone number)
|72 83 01 00 10 F5
||Service center number(in decimal semi-octets). The length of the phone number is odd (11), so a trailing F has been added to form proper octets. The phone number of this service center is "+27381000015". See below.
||First octet of this SMS-DELIVER message.
||Address-Length. Length of the sender number (0B hex = 11 dec)
||Type-of-address of the sender number
|72 38 88 09 00 F1
||Sender number (decimal semi-octets), with a trailing F
||TP-PID. Protocol identifier.
||TP-DCS Data coding scheme
|99 30 92 51 61 95 80
||TP-SCTS. Time stamp (semi-octets)
||TP-UDL. User data length, length of message. The TP-DCS field indicated 7-bit data, so the length here is the number of septets (10). If the TP-DCS field were set to indicate 8-bit data or Unicode, the length would be the number of octets (9).
||TP-UD. Message itself, 8-bit octets representing 7-bit data.
All the octets above are hexa-decimal 8-bit octets, except the Service center number, the sender number and the timestamp; they are decimal semi-octets.
The message part in the end of the PDU string consists of hexa-decimal 8-bit octets, but these octets represent 7-bit data (see below).
The semi-octets are decimal, and e.g. the sender number is obtained by performing internal swapping within the semi-octets from "72 38 88 09 00 F1" to "27 83 88 90 00 1F".
The length of the phone number is odd, so a proper octet sequence cannot be formed by this number. This is the reason why the trailing F has been added.
The time stamp, when parsed, equals "99 03 29 15 16 59 08", where the 6 first characters represent date, the following 6 represents time, and the last two represents time-zone related to GMT.