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:
Jorijn van der Graaf 2026-11-22 17:35:12 +01:00
commit 23892e8e81
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
7 changed files with 670 additions and 123 deletions

165
AGENTS.md
View file

@ -43,11 +43,11 @@ PipeWire. The verified device/carrier combinations are in the README.
| `interfaces/Imsd-Util.cppm` | `imsd::util` — SIP tokens, IPv6 host/port formatting, the RFC 5952 §4 IPv6 text (`CanonicalIp6`/`CanonicalAddr`; an IPv4-mapped address spelled in hex stays hex, where §5 and `inet_ntop` write it dotted) and the comma-separated address-list parser (`ParseAddressList`), hex/base64, MD5 (RFC 1321), the fixed protected ports `PortUc`/`PortUs` (45061/45062). |
| `interfaces/Imsd-Sip.cppm` | `imsd::sip` — SIP as a text layer plus TCP framing: header extraction (from the header section only: a read ends at the first empty line after the start line, empty lines before it skipped; a header is asked for by its long name and found under that or its compact form — RFC 3261 7.3.3: the RFC's ten, and `o` for Event and `x` for Session-Expires — with or without white space before the colon; `Unfolded`, by which the framers hand a message on with its folded header lines — 7.3.1 — joined; `HeaderUri`: the party a header names; `Body`, moved here out of `CallMachine`), status codes, the granted lifetime, `ResponseOf` transaction matching (the Call-ID, and the CSeq as its number and its method, whatever spaces or tabs part them and whatever zeros stand before the number), `CutShortRequest`: the header section of a request — any but an ACK or a CANCEL — whose datagram has fewer body bytes than the Content-Length read from it says, which its 400 is built from. Not a full RFC 3261 parser, deliberately. |
| `interfaces/Imsd-Sdp.cppm` | `imsd::sdp` — SDP offer/answer: the AMR-WB + AMR + telephone-event offer (optional IR.92 preconditions; `OfferedTelephoneEventPt` names its telephone-event numbers), the parser the media plane needs (the codec, its payload type and mode, and the telephone-event payload type the m-line lists at that codec's clock), `BuildAnswer` for the terminating side, the `CODECS` override. |
| `interfaces/Imsd-Sms.cppm` | `imsd::sms` — the short message codecs SMS over IP rides on (TS 24.341 carries the bytes a 2G/3G phone puts in an RP-DATA, in a SIP MESSAGE body): the GSM 7-bit default alphabet with its extension table and the septet packing, UCS-2 (TS 23.038); the SM-TL PDUs (TS 23.040: SMS-SUBMIT built, one per segment with the concatenation header when the text needs more than one; SMS-DELIVER, SMS-STATUS-REPORT and SMS-SUBMIT-REPORT parsed; the SMS-DELIVER-REPORT that acknowledges a delivery; the user-data header — concatenation, application ports — and the `Reassembler` of a concatenated message); the SM-RL messages (TS 24.011: RP-DATA, RP-ACK, RP-ERROR in both directions, the cause values); EF_SMSP (TS 31.102 §4.2.27), where the (U)SIM names the service centre, and qmicli's hex dump of it. Byte-level only: no SIP, no clock, no I/O. |
| `interfaces/Imsd-Sms.cppm` | `imsd::sms` — the short message codecs SMS over IP rides on (TS 24.341 carries the bytes a 2G/3G phone puts in an RP-DATA, in a SIP MESSAGE body): the GSM 7-bit default alphabet with its extension table and the septet packing, UCS-2 (TS 23.038); the SM-TL PDUs (TS 23.040: SMS-SUBMIT built, one per segment with the concatenation header when the text needs more than one; SMS-DELIVER, SMS-STATUS-REPORT and SMS-SUBMIT-REPORT parsed; the SMS-DELIVER-REPORT that acknowledges a delivery; the user-data header — concatenation, application ports — and the `Reassembler` of a concatenated message); the SM-RL messages (TS 24.011: RP-DATA, RP-ACK, RP-ERROR in both directions, the cause values) and `RpCauseIsTemporary`, the causes of a submission after which imsd sends the segment again; EF_SMSP (TS 31.102 §4.2.27), where the (U)SIM names the service centre, and qmicli's hex dump of it. Byte-level only: no SIP, no clock, no I/O. |
| `interfaces/Imsd-Aka.cppm` | `imsd::aka` — USIM AKA glue: the AKAv1-MD5 digest (RFC 3310), IMPI/IMPU/realm from IMSI + MCC/MNC, parsers for `qmicli --uim-get-card-status` and `mmcli` output, the AUTHENTICATE APDU and its response. |
| `interfaces/Imsd-Ipsec.cppm` | `imsd::ipsec` — the two ESP SA pairs (TS 33.203) as `ip xfrm` argv lists, the Security-Server mechanism selection, and the reader that reconstructs SPIs/ports from `ip xfrm state`/`policy` text for a warm resume, and (1.0.0) `SaPeer`, the P-CSCF the kernel's pair is to, read from the `dir out` policies that carry imsd's fingerprint, `OwnXfrmDeleteCommands`, the deletes by exact key of what two rules select — the policies carrying imsd's fingerprint and the reqid-1/2 transport-mode ESP states in their direction or on the UE's ims-PDN address, whoever installed them (§12), and `FileNamesAnotherPair`, whether a state file's `spi_uc`/`spi_us` name the kernel's pair (unknown on either side decides nothing). |
| `interfaces/Imsd-Messages.cppm` | `imsd::msg` — every SIP request and response imsd sends, built from an explicit `Context` and per-request variables so the builders are pure functions; `tests/Messages` is their suite. Also `IsEmergency`. Since 1.2.0 the SIP MESSAGE of SMS over IP (`BuildMessageSms`: an RP-DATA to the service centre's PSI, or an RP-ACK/RP-ERROR to the IP-SM-GW with In-Reply-To — TS 24.341 5.3.1.2 and 5.3.2.4), the `+g.3gpp.smsip` Contact tag behind `Context::smsOverIp`, `BuildResponse`, the final for an inbound MESSAGE outside a call's dialog (the 200, the 480, the 488): each Via row echoed in order and the To echoed with a tag added unless it already holds `tag=` (RFC 3261 8.2.6.2); since 1.2.1 `BuildBadRequest`, the 400 to a request cut short of the Content-Length read from it — any but an ACK or a CANCEL, in a call's dialog or not —, in that shape, a To tag it adds made from the request's header section and a secret of the run (RFC 3261 8.2.7); of requests that came whole, in-dialog requests, a MESSAGE among them, and the shell's answers to any other request outside a call — a NOTIFY, an OPTIONS, a method it does not handle; not an INVITE, whose 486 while a call exists is `BuildInviteResponse`'s — keep `BuildResponse200`'s hop-by-hop shape; and `ScPsi`, the service centre's PSI from its international number — never a dialled-number guess. |
| `interfaces/Imsd-Engine.cppm` | `imsd::engine` — the decisions as pure reducers: `CallMachine` (one call's dialog, returning `Action`s for the shell), `RegRecovery` (the registration recovery policy, §7.4) and, since 1.2.0, SMS over IP (§7.9): `SmsOutbound` (one short message of ours on its way to the service centre, segment by segment, returning `SmsAction`s) and `OnSmsMessage` (what an inbound MESSAGE outside a call's dialog leads to: its final, the message or status report it delivered, the delivery report to send), and `RecentTransactions` (an inbound request's retransmission — the same Call-ID, CSeq and Via branch within 32 s (`TimerJ`), the branch being the value of the first `branch=` of its first Via row and a request with none or an empty one never matched — answered with the same final and not handled again) and, since 1.2.1, `RecentSubmissions` (the Call-IDs of the MESSAGEs our submissions went out in, an hour each, by which a submit report for one that is no longer in flight is known for ours — TS 24.341 5.3.1.2); `SameRecipient` and `StatusReportBook`, a status report's match to the message that asked for one — TP-MR and recipient — and its word for the whole message, with `SmsWordOrder`, the order of a message's words: the submission's first, a report's held until then (§7.9); `RunToken`, `SentSmsId` and `ReceivedSmsId`, the ids (§8.4); `StoredSms` with `FormatStoredSms`/`ParseStoredSms`, the record codec of the received-message store, and `StoredSmsBefore`, `List`'s order. |
| `interfaces/Imsd-Engine.cppm` | `imsd::engine` — the decisions as pure reducers: `CallMachine` (one call's dialog, returning `Action`s for the shell), `RegRecovery` (the registration recovery policy, §7.4) and, since 1.2.0, SMS over IP (§7.9): `SmsOutbound` (one short message of ours on its way to the service centre, segment by segment, since 1.2.1 a segment that gets no answer, or an RP-ERROR with cause 41, sent once more with TP-RD set — TS 23.040 9.2.3.6 —, returning `SmsAction`s) and `OnSmsMessage` (what an inbound MESSAGE outside a call's dialog leads to: its final, the message or status report it delivered, the delivery report to send), and `RecentTransactions` (an inbound request's retransmission — the same Call-ID, CSeq and Via branch within 32 s (`TimerJ`), the branch being the value of the first `branch=` of its first Via row and a request with none or an empty one never matched — answered with the same final and not handled again) and, since 1.2.1, `RecentSubmissions` (the Call-IDs of the MESSAGEs our submissions went out in, an hour each, by which a submit report for one that is no longer in flight is known for ours — TS 24.341 5.3.1.2); `SameRecipient` and `StatusReportBook`, a status report's match to the message that asked for one — TP-MR and recipient — and its word for the whole message, with `SmsWordOrder`, the order of a message's words: the submission's first, a report's held until then (§7.9); `RunToken`, `SentSmsId` and `ReceivedSmsId`, the ids (§8.4); `StoredSms` with `FormatStoredSms`/`ParseStoredSms`, the record codec of the received-message store, and `StoredSmsBefore`, `List`'s order. |
| `interfaces/Imsd-Qmi.cppm` | `imsd::qmi` — the QMI WDS request bytes `imsd-pcscf` sends (Bind Mux Data Port, Set IP Family, Get Packet Service Status, Get Current Settings, Get Profile Settings), the message/TLV parser, the P-CSCF list readers (0x22 flag, 0x23 IPv4, 0x24 FQDN, 0x2E IPv6 — the last one libqmi does not model). |
| `interfaces/ImsdBus.cppm` | `imsd::bus` — the polkit gate in front of call control and messaging (`Gated`'s `Action` parameter names the action), shared by imsd and imsd-ofonod. GLib, so outside `imsd-core`. |
| `implementations/main.cpp` | The `imsd` daemon shell: GLib main loop, GDBus service, sockets, subprocesses, the registration sequence and the run loop that pumps the core. |
@ -339,7 +339,8 @@ What the suites pin:
its extension table and the septet packing (the classic "hellohello"
vector), UCS-2 with surrogate pairs (and U+0000 as U+FFFD), the address fields (international,
a short code, `*`/`#`, an alphanumeric sender), SMS-SUBMIT (the classic
tutorial PDU, UCS-2, the concatenated pair for a 161-character text, an
tutorial PDU, UCS-2, one with TP-RD, the concatenated pair for a
161-character text and the one for a 71-character text in UCS-2, an
escape pair and a surrogate pair kept whole at a segment boundary, the
160/70-character fits), SMS-DELIVER (the classic "How are you?" PDU; a
header with fill bits, a 16-bit concatenation reference, class 0,
@ -350,7 +351,8 @@ What the suites pin:
TS 23.040 9.2.3.15 has the MS read it: every reserved value, bit 7 set
among them, as "Service Rejected") and
SMS-SUBMIT-REPORT, RP-DATA / RP-ACK / RP-ERROR both ways (a type read
against its direction refused), EF_SMSP on the KPN SIM's record (dev
against its direction refused), which RP causes of a submission have the
segment sent again (all 128 values), EF_SMSP on the KPN SIM's record (dev
phone, 2026-10-16) straight from qmicli's dump, and the `Reassembler`
(segments out of order, a lone message, a set dropped by `Purge`, a
surrogate pair and an escape pair split across two segments whole
@ -372,9 +374,27 @@ What the suites pin:
network terminated); and SMS over IP (TS 24.341): `SmsOutbound` through a
submission — the MESSAGE with the RP-DATA to the SC's PSI, its 202, the
RP-ACK ending it as sent with the SC's time stamp; a refused final; an
RP-ERROR with its cause and TP-FCS; the final's wait and the report's running out; a
RP-ERROR with its cause and TP-FCS; the final's wait and the report's
running out (128 s and 130 s), each followed by the segment's repeat — the same
SMS-SUBMIT with TP-RD set and no other bit changed, under a Call-ID and
an RP-MR of its own — and the repeat accepted, rejected as a duplicate
(sent, with RP cause 41 as with another) or ended in its turn (failed,
both ends in the reason); a
duplicate rejection of a first attempt, a refusal like any other (RP
cause 21: failed), and one of a repeat whose first attempt an RP-ERROR
had refused, before the repeat went out or after (failed, both refusals
in the reason); the first attempt's
RP-ACK after the repeat went out taken by In-Reply-To and by RP-MR, its
RP-ERROR then — cause 41 or 28 — leaving the segment to the repeat's
answer (sent on its RP-ACK; failed on its wait, that RP-ERROR named as
the first attempt's end); an RP-ERROR with cause 41 repeated, and one
with a cause part 1 does not list (0, 2); one with 38, 42 or 47 failing
at once; a first segment's RP-ERROR not weighing
on the second segment's repeat; a 408 and a 504 final repeated,
a 403, a 480, a 500 and a 503 failing at once; a repeat the flow could
not send; a
failed send; two segments with consecutive RP-MR/TP-MR, the second sent
on the first's RP-ACK; a destination that is no number; no service
on the first's RP-ACK, a repeat under the next RP-MR; a destination that is no number; no service
centre — and `OnSmsMessage`: a delivered message to the bus and its
RP-ACK to the IP-SM-GW with In-Reply-To, a concatenated pair handed over
once whole and each segment acknowledged, a status report, a submit
@ -653,7 +673,7 @@ Rules:
capture, `phone/arms.out` and `phone-form6/arms.out`): a refused final to a submission's MESSAGE, an RP-ERROR this
code sends (the cause-96 unusable-TPDU path; an RP-ERROR that came in was
reached: `smsc-override-2026-10-18-0217`, 02:19:41, RP cause 28 + TP-FCS
0xc1, through `OnReport`), the final's wait running out, the report's wait ending a message as `failed`, a dead flow under a `Send`, a status report (one requested
0xc1, through `OnReport`), the final's wait running out (the report's ran out on the dev phone: the repeat's benches, below), a dead flow under a `Send`, a status report (one requested
at 01:33 with TP-SRR; none came in the following 11 minutes — the
unfiltered journal of 01:33:30–01:45:00,
`r23-phone-journal-2026-10-17-precise-and-modem-sms`; whether KPN's SC
@ -728,6 +748,22 @@ Rules:
`checks.log`: a text sent to the own number over the bus, delivered
back and listed); no capture holds a `Received` with them; the store's
round trip with each is in `tests/Engine`.
A segment's repeat ran on the dev phone against KPN (2026-11-22, the fp6
journal's `2026-11-20-issues-2-5` capture, `phone-form6`,
`repeat-bench.log`, the binary of 1.2.1): with the
phone deaf on its protected server port a text to the own number got
its 202 and no submit report and went out again 130 s after the final,
under RP-MR 178 after 177, with TP-MR 16 and TP-RD; the repeat got an
RP-ACK under a time stamp of its own (`sent`), and once the port was
open again the text came twice, under the two attempts' time stamps;
the message after it took RP-MR 179. The six benches before it went the
same way (`phone-form6/visit1` to `visit5`, 2026-11-21 and 2026-11-22,
on earlier builds; `phone`, 2026-11-20, on one that waited
40 s). Run on no hardware: a repeat after the final's wait,
a 408, a 504 or an RP-ERROR; a repeat rejected as a duplicate, and one
ended in its turn; the first attempt's report after its repeat went
out.
`tests/Engine` pins the reducer for each.
- A request cut short of its Content-Length on the client flow ran on the
workstation's loopback (2026-11-22, the fp6 journal's
`2026-11-20-issues-2-5` capture, `cut-short`: `SipFlow` built around a
@ -1586,14 +1622,28 @@ Lines the operator (and the scripts) look for, all prefixed `imsd: `:
international number (+ and digits); …` and `SMS over IP: on (+g.3gpp.smsip
advertised: …)`; per message of ours `sms <id>: segment i/n to <number>
via <uri>: MESSAGE sent (RP-MR a, TP-MR b, N bytes)`, `sms <id>: segment
i/n -> <code>; awaiting the submit report`, then `sms <id>: sent: …` or
i/n -> <code>; awaiting the submit report`, for a segment's repeat `sms
<id>: <how the first attempt ended>; sending the segment again, TP-RD
set` and `sms <id>: segment i/n to <number> via <uri>: MESSAGE sent again
(RP-MR a, TP-MR b with TP-RD, N bytes)`, and after it `sms <id>: segment
i/n: the repeat was rejected as a duplicate (RP cause N (…), TP-FCS
0xc5 (…)): the first attempt is taken for accepted`, `sms <id>: segment i/n: the first attempt's
submit report came after the repeat went out: accepted` or `sms <id>:
segment i/n refused by the SC: RP cause N (…)[, TP-FCS 0xNN (…)], in the
first attempt's report, which came after the repeat went out: the
repeat's decides`,
then `sms <id>: sent: …` or
`sms <id>: failed: …` (the reason: `'…' is not a number`, `no service
centre …`, `the text does not fit 255 segments`, `imsd is not registered`, `the flow to the P-CSCF is down`,
`segment i/n refused: <status and its Retry-After / Warning / Reason / Server headers>`, `segment i/n refused
by the SC: RP cause N (…)[, TP-FCS 0xNN (…)]`, `no answer to the MESSAGE
of segment i/n within 32 s`, `no submit report for segment i/n within
40 s of the final`, `segment i/n not sent: the flow to the P-CSCF is
down`) and, after a status report, `sms <id>: delivered|delivery-pending|
of segment i/n within 128 s`, `no submit report for segment i/n within
130 s of the final`, `segment i/n not sent: the flow to the P-CSCF is
down`; of a segment that was sent again the reason is the repeat's
followed by `; the first attempt: <that attempt's>` — for a first
attempt that an RP-ERROR answered after the repeat went out, `segment
i/n refused by the SC: RP cause N (…)[, TP-FCS 0xNN (…)], in a report
that came after the repeat went out`) and, after a status report, `sms <id>: delivered|delivery-pending|
delivery-failed: <TP-ST in words>` or `sms <id>: a segment delivered
(TP-MR n); k still to be reported`, and for a report's word on the
message still in flight `sms <id>: delivered|delivery-pending|
@ -1817,21 +1867,88 @@ do that answers without state.
escape or surrogate pair never split), TP-MR counting up per segment from
the one in `/var/lib/imsd/sms-tpmr`, random only when the file gives none (TS 23.040 9.2.3.6's
Last-Used-TP-MR on the (U)SIM is not read or written), RP-MR from a
counter seeded at random at start. One message on the
counter seeded at random at start, the next for every MESSAGE built
for a submission, one the flow could not send too. One message on the
flow at a time, segment by segment: the MESSAGE with the
RP-DATA, its final within 32 s of the MESSAGE or of its latest provisional (a
RP-DATA, its final within 128 s of the MESSAGE or of its latest provisional (a
provisional starts the wait over); the submit report — an
RP-ACK or RP-ERROR in a MESSAGE of its own, matched by In-Reply-To, else
by RP-MR, answered 200 — within 40 s of a 2xx final (a length TS 24.011
10.1 allows TR1M, which 6.3.1 sets when the RP-DATA is transferred); then the
next segment. Every
segment's RP-ACK: `sent`, with the SC's time stamp when its submit
report carries one; a refused final, an RP-ERROR (its cause and the
submit report's TP-FCS), a wait that runs out or a flow that is down:
`failed` with the reason; a wait is judged at the run loop's passes,
by RP-MR, answered 200 — within 130 s of a 2xx final; then the
next segment. The two waits are a UE's (Jorijn, 2026-11-21; 1.2.0 waited
32 s and 40 s): 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 — past the
35 to 45 s of TS 24.011 10.1, and here counted from the final, where
6.3.1 sets TR1M when the RP-DATA is transferred. A segment that gets no answer, or an RP-ERROR with cause 41, is
sent once more, as TS 23.040 9.2.3.6 has the MS "automatically repeat
the SMS-SUBMIT" (one to three times; here once): when the final's wait
or the report's runs out, when the final is a 408 or a 504 — no
response in time (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"), which leaves the MESSAGE's
fate as open as no final — 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" (`RpCauseIsTemporary`; 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", and of 38 that "immediately
reattempting the short message transfer is not likely to be
successful"). The repeat is a MESSAGE of its
own — its Call-ID, the next RP-MR — carrying the same SMS-SUBMIT, the same
TP-MR, with TP-RD set, by which a service centre that has the first
"should discard" it and answer with an RP-ERROR whose TP-FCS is the
duplicate rejection (0xC5), or with an RP-ACK (9.2.3.6): either ends the
segment as accepted, and so does the first attempt's own RP-ACK when
it comes after the repeat went out. The duplicate rejection is taken so
only where no RP-ERROR has answered the first attempt by then — after
one it is a refusal like any other —, and an RP-ERROR to the first
attempt that comes after the repeat went out leaves the segment to the
repeat's answer; one that comes once the rejection has ended the
segment is answered and logged (Receiving, below) and changes
nothing. An RP-ACK to the repeat is an acceptance whatever became
of the first attempt: the clause lets a service centre answer a repeat
it discards with an RP-ACK as well ("for backward compatibility … may
be configured to respond with an RP-ACK"), which nothing tells from an
acceptance. What the rejection does not say is which SMS-SUBMIT the service
centre holds: imsd's TP-MR is its own count (above), so an SMS-SUBMIT
of this subscription that reached the service centre another way — the
modem's own short message stack — under the same TP-MR can draw the same
rejection, and where imsd's first attempt never arrived the message is
then `sent` for a text the service centre does not have (Jorijn,
2026-11-21: taken as the clause has it). KPN's service centre did not discard it in
seven benches of seven (2026-11-20 to 2026-11-22, §5): each time it
took the repeat for a new text — an RP-ACK under a time stamp of its
own — and delivered both. The repeat is
sent all the same (Jorijn, 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 fp6 journal's
`2026-11-20-issues-2-5` capture, `repeat-research`). A status report is
matched by TP-MR, which both copies carry: of two reports under one
TP-MR the first of the completed class, or of one in which the service
centre has stopped trying, is taken, and a report after it is logged as
naming no message of ours — so for a message that ended `sent`, a first
copy reported failed gives `delivery-failed` though the other may
still be delivered. Every segment accepted: `sent`, with the SC's
time stamp from the latest RP-ACK whose submit report carried one; a
final refused with another status, an RP-ERROR with another cause (its
cause and the submit report's TP-FCS), a MESSAGE the flow
cannot send, or a repeat that ends short of an acceptance: `failed` with the
reason — after a repeat the repeat's end and the first attempt's —, at
once: a report that still comes for the first attempt is then answered
and logged (Receiving, below) and changes nothing; a wait is judged at the run loop's passes,
after the server ports are read, so an answer read before that counts
however late. No retransmission (9.2.3.6's repeat with
TP-RD is not done): the sender retries. A `Send` is judged when the engine
however late. Not done of the clause's repeat: it cannot be switched off
("should be capable of being disabled through MMI"), and a failed
message is not kept for the user to send again under its TP-MR — a
`Send` of the same text is a new message with the next TP-MR, which the
service centre cannot tell from a new text; and a final refused with
another status than 408 or 504 is taken for the network's refusal of the
MESSAGE, not for the clause's "no response", though it brings no RP-ACK
or RP-ERROR either. A `Send` is judged when the engine
takes its command up: unregistered or with the flow down at that moment,
it fails with that reason and is not held for a recovery step; otherwise
it starts, or queues behind the message in flight, and a queued message
@ -1885,14 +2002,14 @@ do that answers without state.
status report that does not parse, or one of the submit-report type — is
acknowledged the same way with an RP-ERROR (cause 96, TP-FCS "TPDU not supported"). A submit
report In-Reply-To a MESSAGE of ours that is no longer in flight — its
message has ended (its report's wait run out, judged by the shell; a
message has ended (its waits run out, judged by the shell; a
failure; sent) or its segment was followed by the next — is answered 200
and logged with the message's id and, for an RP-ERROR, its cause, for an
hour after that MESSAGE went out (`RecentSubmissions`: 5.3.1.2's 200 for
a report on "a short message submitted by the SM-over-IP sender", whose
Call-ID its NOTE 3 has the sender store). The bus hears nothing of it:
`failed` is a message's last word (§8.4), so a text the service centre
took after its wait had run out stays `failed` there, and the journal's
took after its waits had run out stays `failed` there, and the journal's
line is the record of it. One In-Reply-To no MESSAGE of ours on record —
a stranger's, ours of more than an hour ago, ours of before a restart —
is answered 488, which for the last two departs from the clause: it has