sms, engine, imsd: a segment that gets no answer, or an RP-ERROR with cause 41, is sent once more with TP-RD set
A submission whose submit report did not come in time ended as `failed`, and nothing was sent again. The service centre may have the text all the same, and a user who then sends it again delivers it twice: the second submission has a new TP-MR, and the service centre cannot tell that it is a repeat (issue #3, the second of its three cases). TS 23.040 9.2.3.6 has the MS "automatically repeat the SMS-SUBMIT", one to three times, with the same TP-MR and TP-RD set, when no response or an RP-ERROR with an appropriate cause comes, so that the service centre can discard a duplicate. SmsOutbound now sends a segment once more: when either wait runs out, on a final of 408 or 504 (RFC 3261 21.4.9: the server "could not produce a response within a suitable amount of time"; 21.5.5: it "did not receive a timely response from an external server") and on an RP-ERROR with cause 41, temporary failure, or with a value TS 24.011 table 8.4's part 1 does not list, which it has "treated as cause number 41". Of the causes part 1 lists, Annex E-2 says of 41 alone that the MS "may wish to try another short message transfer attempt almost immediately". The repeat is a MESSAGE of its own, under its own Call-ID and the next RP-MR — the shell's counter now goes on after the last RP-MR a message used, one per MESSAGE built — with the same SMS-SUBMIT, TP-RD set by the codec's flag, which nothing set until now. The two waits are longer, so that a repeat does not overtake an answer that is only late: 128 s for the final and 130 s from the final for the report. TS 24.229 table 7.7.1 recommends a UE whose requests name one of the accesses clause 7.7 lists in P-Access-Network-Info a T1 of 2 s and a timer F of 64*T1, and TS 24.341 5.3.1.1 NOTE 1 has an SM-over-IP sender's TR1M set to a value greater than timer F (Jorijn, 2026-11-21). The segment is accepted by an RP-ACK to either attempt — the first attempt's is taken when it comes after the repeat went out — and by the RP-ERROR whose TP-FCS is the duplicate rejection (0xC5) when it answers the repeat and no RP-ERROR has answered the first attempt by then: the service centre is taken to have the first. An RP-ERROR to the first attempt that comes after the repeat went out leaves the segment to the repeat's answer. Any other end of the repeat fails the message, with both attempts' ends in the reason. A final refused with another status and an RP-ERROR with another cause fail the message at once, as before. What the duplicate rejection does not say is which SMS-SUBMIT the service centre holds: one of this subscription's that reached it another way under the same TP-MR can draw the rejection too, and with imsd's first attempt lost the message is then `sent` for a text that never arrived (Jorijn, 2026-11-21: taken as the clause has it). Not done of the clause's repeat: it cannot be switched off, and a failed message is not kept for a user's retransmission under its TP-MR. No member of the Messaging interface changes: `sent` and `failed` come as before, a `failed` later by the waits — with nothing answering, 256 s after the MESSAGE where 1.2.0 said it after 32 s — and texts queued behind the message wait as long. Tested by tests/Engine and tests/Sms (RpCauseIsTemporary over all 128 values; a cross-generated SMS-SUBMIT with TP-RD), and on the dev phone against KPN with the binary of this range's last commit (the fp6 journal's 2026-11-20-issues-2-5 capture, phone-form6, repeat-bench.log): with the phone deaf on its protected server port a text to the own number got its 202 and no submit report, went out again 130 s after the final under the next RP-MR, with the same TP-MR and TP-RD set, and ended `sent`; the message after it took the RP-MR after the repeat's. KPN's service centre did not discard the repeat in that bench, nor in the six before it (one of them with a build that waited 40 s): the repeat got an RP-ACK under a time stamp of its own, and once the port was open again the text came twice, under the two attempts' time stamps: the recipient got the text twice without the user sending it again, and the message was `sent`. 1.2.0 ends a submission whose report does not come as `failed` and sends nothing again. The repeat is sent all the same, on Jorijn's decision of 2026-11-20 with the first of those benches before him: the clause has the MS repeat ("shall") and the service centre discard ("should"), and Android's framework sends its own retries so (AOSP's ImsSmsDispatcher and GsmSMSDispatcher set TP-RD and the earlier TP-MR; the capture's repeat-research).
This commit is contained in:
parent
ef04b473a7
commit
23892e8e81
7 changed files with 670 additions and 123 deletions
|
|
@ -9,8 +9,10 @@
|
|||
// you?" PDU and vectors cross-generated by the fp6 journal's Python
|
||||
// reference: a header with fill bits, a 16-bit concatenation reference, a
|
||||
// class-0 message, port-addressed 8-bit data, an alphanumeric sender, a
|
||||
// negative time zone), SMS-STATUS-REPORT and SMS-SUBMIT-REPORT, the
|
||||
// RP-DATA / RP-ACK / RP-ERROR messages both ways, EF_SMSP with the KPN
|
||||
// negative time zone), SMS-STATUS-REPORT and SMS-SUBMIT-REPORT (the
|
||||
// duplicate rejection's TP-FCS among its causes), the
|
||||
// RP-DATA / RP-ACK / RP-ERROR messages both ways, which RP causes of a
|
||||
// submission invite a repeat, EF_SMSP with the KPN
|
||||
// SIM's record, qmicli's hex dump, and the reassembly of a concatenated
|
||||
// message.
|
||||
import std;
|
||||
|
|
@ -136,6 +138,12 @@ namespace {
|
|||
Check(to.size() == 1, "SUBMIT with a status report requested: one segment");
|
||||
if (!to.empty()) Eq(to[0], "31010A9113163254760000A902C834", "SMS-SUBMIT: status report requested, TP-VP A9, an even number of digits");
|
||||
|
||||
Submit r = o;
|
||||
r.rejectDuplicates = true;
|
||||
auto tr = BuildSubmits(r, "Hi", 0);
|
||||
Check(tr.size() == 1, "SUBMIT with TP-RD: one segment");
|
||||
if (!tr.empty()) Eq(tr[0], "35010A9113163254760000A902C834", "SMS-SUBMIT with TP-RD: bit 2 of the first octet set, the rest as without it");
|
||||
|
||||
Submit c{"+31612345678", 10};
|
||||
std::string longText(153, 'A');
|
||||
longText += std::string(8, 'B');
|
||||
|
|
@ -145,6 +153,12 @@ namespace {
|
|||
Eq(tc[0], "410A0B911316325476F80000A00500032A020182C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683C16030180C0683", "segment 1/2: UDHI, the concatenation header, 153 septets after one fill bit, TP-MR 10");
|
||||
Eq(tc[1], "410B0B911316325476F800000F0500032A02028442A15028140A01", "segment 2/2: TP-MR 11, 8 septets");
|
||||
}
|
||||
auto tw = BuildSubmits(c, Rep("ü", 70) + "❤", 0x2A);
|
||||
Check(tw.size() == 2, "71 UCS-2 characters: two segments");
|
||||
if (tw.size() == 2) {
|
||||
Eq(tw[0], "410A0B911316325476F800088C0500032A0201" + Rep("00FC", 67), "UCS-2 segment 1/2: TP-MR 10, the header and 67 characters in 140 octets");
|
||||
Eq(tw[1], "410B0B911316325476F800080E0500032A020200FC00FC00FC2764", "UCS-2 segment 2/2: TP-MR 11, the header and four characters");
|
||||
}
|
||||
Check(BuildSubmits(c, std::string(160, 'A'), 1).size() == 1, "160 characters fit one message");
|
||||
Check(BuildSubmits(c, std::string(161, 'A'), 1).size() == 2, "161 characters need two");
|
||||
Check(BuildSubmits(c, Rep("ü", 70) + "❤", 1).size() == 2, "71 UCS-2 characters need two");
|
||||
|
|
@ -293,6 +307,8 @@ namespace {
|
|||
Check(udhi && udhi->failureCause == 0xC3, "TP-UDHI (bit 6) is no unused bit: the cause as sent");
|
||||
EqS(ScTimeStamp(Hex("621AF12205A0A0")), "2026-01-10T22:50:00+00:00", "SCTS: a semi-octet that is no digit reads as 0, in the zone too (9.2.3.11)");
|
||||
EqS(FailureCauseText(0xC3), "invalid SME address", "TP-FCS C3");
|
||||
Check(FcsDuplicateRejected == 0xC5, "TP-FCS C5 is the duplicate rejection (9.2.3.22)");
|
||||
EqS(FailureCauseText(FcsDuplicateRejected), "duplicate short message rejected", "TP-FCS C5 in words");
|
||||
Eq(DeliverReportAck(), "0000", "SMS-DELIVER-REPORT for RP-ACK");
|
||||
Eq(DeliverReportError(0xFF), "00FF00", "SMS-DELIVER-REPORT for RP-ERROR");
|
||||
}
|
||||
|
|
@ -317,6 +333,15 @@ namespace {
|
|||
auto errMt = ParseRp(Hex("052A011C410A01C30062016122050080"));
|
||||
Check(errMt && errMt->type == RpType::ErrorMt && errMt->cause == 28 && !errMt->diagnostic && errMt->tpdu.size() == 10, "RP-ERROR network to MS with a submit report");
|
||||
EqS(RpCauseText(28), "unidentified subscriber", "RP cause 28");
|
||||
// a submission's RP-ERROR invites another attempt at once for cause 41 (TS 24.011 Annex E-2) and for a value table 8.4's part 1 does not list (treated as 41)
|
||||
{
|
||||
const std::set<int> listed{1, 8, 10, 11, 21, 27, 28, 29, 30, 38, 41, 42, 47, 50, 69, 81, 95, 96, 97, 98, 99, 111, 127};
|
||||
bool asTabled = true;
|
||||
for (int cause = 0; cause < 128; cause++)
|
||||
if (RpCauseIsTemporary(static_cast<std::uint8_t>(cause)) != (cause == 41 || !listed.contains(cause))) asTabled = false;
|
||||
Check(asTabled && listed.size() == 23, "RpCauseIsTemporary over the 128 cause values: 41, and whatever part 1's 23 do not list");
|
||||
Check(RpCauseIsTemporary(41) && RpCauseIsTemporary(0x80 | 41) && !RpCauseIsTemporary(28) && !RpCauseIsTemporary(0x80 | 28) && RpCauseIsTemporary(2) && !RpCauseIsTemporary(11), "RpCauseIsTemporary: the extension bit is no part of the value; an unlisted 2 invites a repeat, the reserved 11 is listed");
|
||||
}
|
||||
auto diag = ParseRp(Hex("0507022611"));
|
||||
Check(diag && diag->cause == 38 && diag->diagnostic == 0x11 && diag->tpdu.empty(), "RP-ERROR with a diagnostic octet");
|
||||
Check(!ParseRp(Hex("05")), "one byte: nothing");
|
||||
|
|
|
|||
Loading…
Reference in a new issue