The GSM 03.40 specifies a message of type SMS-COMMAND which lets the sender perform operations at the SMSC (e.g. inquiry, delete, etc.) on a previously sent message using its associated TP-MR value.
I have a GSM 2G modem (SIMCom SIM808) that I use for test purposes. It is configured for SMS in PDU mode.
I can successfully send SMS-SUBMIT messages and process SMS-DELIVERY, SMS-SUBMIT-REPORT and SMS-STATUS-REPORT messages \o/
Now, I would like to play with the SMS-COMMAND messages. However, when sending such PDUs, the modem answers with +CMS ERROR: 304 which means "Invalid PDU mode".
My guess is that the SMSC somehow filters out these messages and tells the modem "invalid mode".. But that's just a guess and I hope it is wrong!
Here is my test scenario:
1 - Send a SMS-SUBMIT message
I send a SMS-SUBMIT message with the TP-SRR and TP-MR fields set to the proper value. As the destination device is off-line so the message is expected to be kept pending at SMSC.
PDU dump
PDU: 0031990B913316325476F80000050141
{
.sca_format.raw = 0x00,
.sca = "",
.sca_len = 0,
.type.raw = 0x31,
.submit.mr = 0x99,
.submit.da_format.raw = 0x91,
.submit.da_len = 12,
.submit.da = "+33612345678",
.submit.pid = 0x00,
.submit.dcs = 0x00,
.submit.vp_mn = 30,
.submit.vp_abs = "",
.submit.vp_tz = 0,
.submit.udl = 1,
.submit.udhl = 0,
.submit.udh = NULL,
.submit.ud_len = 1,
.submit.ud = "A",
}
AT command
AT+CMGS=15\r
> 0031990B913316325476F80000050141\x1a
+CMGS: 153
OK
2 - Send a SMS-COMMAND
Then I send a SMS-COMMAND message which is set to inquiry the previously sent message.
Note that an SMS-COMMAND set for deleting the previously sent message answers the same.
PDU dump
PDU: 00229A0000990B913316325476F800
{
.sca_format.raw = 0x00,
.sca = "",
.sca_len = 0,
.type.raw = 0x22,
.command.mr = 0x9a,
.command.pid = 0x00,
.command.ct = 0x00,
.command.mn = 0x99,
.command.da_format.raw = 0x91,
.command.da_len = 12,
.command.da = "+33612345678",
.command.cdl = 0,
.command.cd_len = 0,
.command.cd = "",
}
AT command
AT+CMGS=14\r
> 00229A0000990B913316325476F800\x1a
+CMS ERROR: 304
3 - Bring destination mobile online
Finally I bring the destination device back online and it receives the pending SMS-SUBMIT message. A few seconds after, I receive a SMS-STATUS-REPORT which confirms the successful delivery.
4 - Questions
Q1: Is the SMS-COMMAND message malformed?
Q2: Is the SMS-COMMAND type even supported on the SMSC side?
Q3: Any clue to make this work?