Long text message
Ultra-long text message: if the text message contains more than 70 Chinese characters, it must be divided into multiple text messages when submitted to the gateway, but one text message is sent by the user's mobile phone (SP-angle, the concept of long text message sent by the mobile phone is the same ).
In the CMPP protocol, the CMPP-_SUBMIT message definition has the corresponding parameter configuration:
Tp_udhi: 0 indicates that the content body does not contain the protocol header information. 1 indicates that the content contains the protocol header information. (long messages, push messages, and so on all contain header content on the Content body) when the content body contains the protocol header, you need to write the corresponding information according to the protocol. There are two types of long message protocol headers:
6-bit protocol Header Format: 05 00 03 xx mm NN
Byte 1: 05, indicating the length of the remaining protocol header
Byte 2: 00, which is defined in GSM 03.40 specification 9.2.3.24.1, indicates that the identification space length of the subsequent ultra-long messages is 1 (xx value in the format ).
Byte 3: 03. This value indicates the length of the remaining text message identifier.
Byte 4: XX, the unique identifier of this batch of messages (This value must be consistent for multiple split messages). In fact, after SME (mobile phone or SP) merges the messages, record, so is this flag unique?
It is not very important.
Byte 5: Mm, the number of messages in this batch. For a total of five ultra-long text messages, the value here is 5.
Byte 6: NN, number of messages in this batch. If the value of the first text message in this batch is 1, the value of the second text message is 2.
Example: 05 00 03 39 02 01
7-bit protocol Header Format: 06 08 04 xx mm NN
Byte 1: 06, indicating the length of the remaining protocol header
Byte 2: 08, which indicates that the identification space length of the subsequent ultra-long messages is 2 (XX value in the format) according to the GSM 03.40 specification 9.2.3.24.1 ).
Byte 3: 04. This value indicates the length of the remaining text message identifier.
Byte 4-5: XX, the only sign of this batch of text messages. In fact, after SME (mobile phone or SP) merges the messages, record them, therefore, it is not important to determine whether the logo is unique.
Byte 6: Mm, the number of messages in this batch. For a total of five ultra-long text messages, the value here is 5.
Byte 7: NN, the number of messages in this batch. If the value of the first text message in this batch is 1, the value of the second text message is 2.
Example: 06 08 04 00 39 02 01
At this point, the sending setting of long text messages is basically complete, but note that this field in the src_id protocol must be the same in a long text message. Otherwise, the mobile phone will be parsed into three,
And all three are error messages.
For sp, long text messages are uploaded and parsed in reverse order according to the Protocol:
1 byte [] contentbytes = msg. getmsgcontent ();
2int headlen = contentbytes [0]; // The length of the Content Header
3 // The total number of ultra-long text messages
4int pk_total = contentbytes [headlen-1];
5 // The number of ultra-long text messages
6int pk_num = contentbytes [headlen];
7 // long SMS No.
8 byte serial = contentbytes [headlen-2];
One of the long text messages containing the cmpp3.0 Protocol
00 00 00 CF 00 00 00 04 00 00 00 00 00 00 00 00 00 00 03 01 01 4D 53 43 32 31 31 30 35
30 35 00 38 36 31 33 34 38 32 31 37 34 35 00 00 00 00 00 00 00 00 08 00 00 00 00 00
00 00 30 33 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 31 30 36 35 37 33 30 37 30 37 39 00 00 00 00
00 00 00 01 38 36 31 33 34 38 32 31 37 34 35 00 00 00 00 00 00 30 05 00 03 01 03
03 00 32 00 37 00 20 00 31 00 36 00 3A 00 31 00 30 00 3A 00 30 00 30 00 0a 00 5B 79 5E 5d de
65 70 78 01 60 1D 72 79 59 47 00 5d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00