messages: the SIP MESSAGE of SMS over IP, +g.3gpp.smsip behind a context flag
TS 24.341 5.3.1.2 has a submission travel as a SIP MESSAGE to the service centre's PSI with the RP-DATA as an application/vnd.3gpp.sms body, and 5.3.2.4 the delivery report as one to the IP-SM-GW with In-Reply-To naming the delivered MESSAGE: BuildMessageSms builds both, out of dialog over the registration's Route with the same P-Preferred-Identity, P-Access-Network-Info and sec-agree headers as the INVITE and the reg-event SUBSCRIBE, and no Contact (RFC 3428 4). The REGISTER Contact carries +g.3gpp.smsip only when Context::smsOverIp says so — the tag routes terminating short messages to imsd (the 2026-10-17 bench's mt-last-message-in.raw), which at this commit still answers them 200 and logs them — after the ICSI. BuildResponse builds a final for an inbound request outside a call (the 488 of 5.3.1.2 for a report that is not ours, or a 200); the shell does not call it in this commit — it still answers a MESSAGE with BuildResponse200. tests/Messages pins the Contact with the tag, the MESSAGE's headers and body bytes both ways, the absence of Contact, and the 488. BuildResponse echoes each Via: line and the To, with a tag added unless the To already holds `tag=` (RFC 3261 8.2.6.2 has a UAS add a tag to a To that carries none); tests/Messages pins the 488 and a 200. ScPsi gives the service centre's PSI from its international number (5.3.1.2 NOTE 1: the SC's E.164 number as a SIP URI with user=phone, or a tel URI; the home domain is imsd's choice); RuriFor's dialled-number guess, whose trunk 0 is Dutch, has no place there. Pinned in tests/Messages.
This commit is contained in:
parent
89048c3602
commit
0717c3008a
3 changed files with 206 additions and 17 deletions
12
AGENTS.md
12
AGENTS.md
|
|
@ -44,7 +44,7 @@ PipeWire. The verified device/carrier combinations are in the README.
|
|||
| `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-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; byte-pinned by `tests/Messages`. Also `IsEmergency`. |
|
||||
| `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, which calls every builder but `BuildInviteResponse` (`tests/Engine` checks the responses `CallMachine` builds with it). 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`, a final for an inbound request outside a call — each `Via:` line echoed in order (the text layer reads long header names only, not RFC 3261 7.3.3's compact forms) and the To echoed with a tag added unless it already holds `tag=` (RFC 3261 8.2.6.2); the 488 and a 200 pinned — 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) and `RegRecovery` (the registration recovery policy, §7.4). |
|
||||
| `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, shared by imsd and imsd-ofonod. GLib, so outside `imsd-core`. |
|
||||
|
|
@ -277,8 +277,14 @@ What the suites pin:
|
|||
that disagrees with a length, short and overrunning buffers, the
|
||||
packet-service-status and profile PCSCF-via-PCO readers (present and absent
|
||||
TLVs) and the error names (OutOfCall, NoEffect, an unknown code as `?`).
|
||||
- `Messages` — every outgoing SIP message byte-for-byte, cross-generated from
|
||||
the Python reference stack imsd replaced.
|
||||
- `Messages` — the outgoing SIP messages: the initial and the protected
|
||||
REGISTER, the reg-event SUBSCRIBE and the INVITEs byte-for-byte, their
|
||||
variants, the in-dialog requests, the ACKs, the CANCEL and
|
||||
`BuildResponse200` by their lines, `BuildInviteResponse` not there
|
||||
(`tests/Engine` checks the responses `CallMachine` builds with it); the
|
||||
SMS over IP shapes (the
|
||||
`+g.3gpp.smsip` tag, the MESSAGE with an RP-DATA, the delivery report
|
||||
with In-Reply-To, a 488) pinned against TS 24.341's clauses.
|
||||
- `Sip` — the text layer's edge cases (empty header values, line anchoring,
|
||||
keepalive discards, a header read that stops at the first empty line — a
|
||||
body line spelling a header name picks nothing, leading empty lines are
|
||||
|
|
|
|||
Loading…
Reference in a new issue