diff --git a/.gitignore b/.gitignore index 51b3a5d..37456a2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ imsd-*.tar.gz *.rtp *.stats imsreg.state + +# SMS over IP's state: the next TP-MR (and its .tmp) +sms-tpmr* diff --git a/AGENTS.md b/AGENTS.md index 2e07848..b356948 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,7 +18,9 @@ firmware on such phones brings up the IMS PDN but cannot carry call audio, so imsd does the whole IMS client itself: SIP registration with USIM AKA authentication over kernel IPsec (ESP), call signalling for outgoing and incoming calls, and the RTP media plane (AMR-WB, AMR, G.711) wired into -PipeWire. A stock mobile dialer — Plasma Dialer, or GNOME Calls under Phosh +PipeWire, and since 1.2.0 short messages over IMS (TS 24.341: the SIP MESSAGE +carrying an RP-DATA, the Messaging interface — +§7.9). A stock mobile dialer — Plasma Dialer, or GNOME Calls under Phosh and GNOME Mobile — places and receives real VoLTE calls on a commercial network through it. @@ -44,10 +46,10 @@ 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; `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`, the final `OnSmsMessage` builds for the MESSAGE it is handed (the 200, the 488): 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); 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 (TS 24.341): `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` (the final remembered for an inbound request by Call-ID, CSeq and Via branch — the value of the first `branch=` of its first `Via:` line; nothing is remembered for a request with none or an empty one — for 32 s (`TimerJ`), for a caller to answer a retransmission with it and not handle it again). | +| `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`, the final for an inbound MESSAGE outside a call's dialog (the 200, the 480, the 488): 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); 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 (TS 24.341): `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:` line and a request with none or an empty one never matched — answered with the same final and not handled again); `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). | | `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`. | +| `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. | | `implementations/media.cpp` | `imsd-media`, the per-call RTP leg, DTMF included (RFC 4733 events out, queued by `dtmf ` lines on its stdin; the far end's events in, played as tones). Pure std + POSIX, dlopen's the AMR codecs. | | `implementations/pcscf.cpp` | `imsd-pcscf`, the P-CSCF reader: the AF_QIPCRTR socket, the WDS service lookup and the Bind Mux Data Port / Set IP Family / Get Current Settings sequence around `Imsd:Qmi` (plus Get Profile Settings with `--profile`, Get Packet Service Status with `-v`). std + POSIX + the Linux QRTR UAPI (``), no GLib; never Start/Stop Network. | @@ -60,7 +62,8 @@ PipeWire. The verified device/carrier combinations are in the README. Also ignored by `.gitignore`, and never to be committed: `*.raw`, `*.rtp`, `*.stats`, `imsreg.state`, `imsd-*.tar.gz` — captures and runtime state carry -the subscriber's IMSI/MSISDN and network addresses. +the subscriber's IMSI/MSISDN and network addresses — and, of SMS over IP's +state, `sms-tpmr*` (the next TP-MR). ## 3. Build products @@ -71,7 +74,7 @@ in every source but the re-exporting `Imsd.cppm`, clang + libc++ + lld. |---|---|---|---|---| | `imsd-core` | static library | the `Imsd` module and its nine partitions | — | Pure `import std` C++, no GLib, no I/O side effects: every message, digest, SA command and call-state decision is here and unit-testable on any dev box without a bus, a modem or a phone. | | `imsd` | executable | `implementations/main.cpp` | `imsd-core`, `imsd-bus`, gio-2.0, pthread | The daemon. Default product. | -| `imsd-bus` | static library | `interfaces/ImsdBus.cppm` | gio-2.0 | The polkit gate (`net.catcrafts.IMS1.Voice`) imsd and imsd-ofonod both link. A translation daemon that runs as root on the system bus reaches imsd as root, which polkit always allows, so it gates its own callers through this or it is a bypass. | +| `imsd-bus` | static library | `interfaces/ImsdBus.cppm` | gio-2.0 | The polkit gate (`net.catcrafts.IMS1.Voice`; since 1.2.0 `net.catcrafts.IMS1.Messaging` too) imsd and imsd-ofonod both link. A translation daemon that runs as root on the system bus reaches imsd as root, which polkit always allows, so it gates its own callers through this or it is a bypass. | | `imsd-media` | executable | `implementations/media.cpp` | `-ldl -lpthread` | The RTP/AMR data plane, spawned once per call. No GLib, no core. A separate process for crash isolation and for the far-end-hangup exit-code contract (§7.6). `-- --product=media`. | | `imsd-dialerd` | executable | `implementations/dialerd.cpp` | gio-2.0 | Plasma Mobile integration: a session daemon owning `org.kde.telephony.{CallUtils,DeviceUtils,UssdUtils}`, bridging to imsd. GDBus translation only. A separate process because those are per-user session-bus names a root system daemon cannot own. `-- --product=dialerd`. | | `imsd-ofonod` | executable | `implementations/ofonod.cpp` | `imsd-bus`, gio-2.0 | GNOME Calls integration: a system daemon owning `org.ofono`, presenting imsd as an oFono modem. GDBus translation plus the polkit gate on its own callers. `-- --product=ofonod`. | @@ -82,7 +85,7 @@ that every decision in it has a unit test.** New protocol logic goes into a partition with a test. The shell (`main.cpp`; from 1.0.0 also `pcscf.cpp`'s QRTR control lookup and its matching of answers by type, transaction and message id) holds protocol decisions no -test reaches — some older than 0.3.10, some added by 0.3.10, 0.3.11, 0.3.12 or 1.0.0: the P-CSCF in +test reaches — some older than 0.3.10, some added by a release since: the P-CSCF in use (`pcscf_`: the kernel's SA peer at a resume, `PCSCF=` or the first of `PCSCF_DISCOVERED=` at a fresh registration, the move between them and back — §7.2); the reg-event @@ -135,7 +138,27 @@ both sides (1.0.0) is unbenched: no capture stages a holds file whose `pdn` is spelled unlike `LOCAL`). For the schedule, a reducer next to `RegRecovery`, with a Subscription-State parser in `Imsd:Sip` pinned by `tests/Sip`, is the follow-up that moves it; a pure format/parse pair in -`Imsd:Engine` is the holds file's. +`Imsd:Engine` is the holds file's. SMS over IP (1.2.0, §7.9) keeps in the +shell, among others, the service centre's source (`SMSC=` over EF_SMSP, `LoadSmsParameters`), +the three counters (TP-MR, RP-MR, the concatenation reference), their +seeding and the TP-MR file, the routing of an inbound MESSAGE +(`DispatchRequest`: to the call when it carries the live call's Call-ID, +else through `OnInboundMessage` to `OnSmsMessage`), the one-at-a-time +queue, a `Send` failed when the engine takes it up unregistered or with +the flow down, a queued message started without that check, the +status-report book's entries (made at a message's start, and only for one +that asked for a report: `StartNextSms`), the routing of a MESSAGE +final to the message in flight (`OnSmsResponse` — ahead of the reg-event +subscription's handler in the run loop, after it inside `AwaitFinal`), the +judgement of the final's wait and of the report's after the server ports' drain, the reassembler's +30-minute age-out in the run loop, the retransmission check around +`OnSmsMessage`, the delivery reports' finals (`reportCallIds_`), a send +failure attributed by Call-ID, and the forwarding of a status report's +word to the bus — the transactions themselves are `SmsOutbound` and +`OnSmsMessage` (a submit report's routing to the message in flight, by +In-Reply-To, else RP-MR, is theirs), and the report's match to the message +that asked for one `SameRecipient` +and `StatusReportBook`, all with tests. ## 4. Building @@ -341,12 +364,30 @@ What the suites pin: ended; ours once its segment was superseded), 200 for one without In-Reply-To for no message, an unusable TPDU acknowledged with an RP-ERROR, a body that is no RP message, a page-mode text 200'd and - logged; + logged, a short message while SMS over IP is off refused with 480; a submit report before the MESSAGE's own final taken — the message sent and the late final nobody's; with two segments the second goes out under its own Call-ID — a text past 255 segments failed at once naming the fit, a delivery with no gateway for its report handed over with the absence logged; + `StatusReportBook` and `SameRecipient`: a two-segment message delivered + with its last segment, a delivered TP-MR forgotten, another recipient no + match, a temporary status pending with the entry kept, a permanent + failure the message's last word (a later segment finds nothing), a + reused TP-MR forgetting the older message whole, a message forgotten + whole by its id (`ForgetMessage`) with the other left on record; a number dialled + with a trunk 0, with `00` or — a US number — without its country code + matched against its international form; another number, `+31612345678` + against `+49612345678`, a short code against a longer number that ends in + it and an empty one not; + `SmsWordOrder`: a report on a message whose submission ended posted at + once, one on the message in flight held and posted after `sent`, a + `failed` after a held `delivered` posted as `sent` then `delivered`, any + other `failed` posted alone with the message to forget, another + message's submission leaving the held word alone; the ids (`RunToken`, + `SentSmsId`, `ReceivedSmsId`): eight zero-padded hex digits, the sent + and the received shape, two tokens' ids apart at the same second and + counter; and `RecentTransactions`: a retransmitted request gets its final again, for 32 s (`TimerJ`); no branch, no match. @@ -535,6 +576,84 @@ Rules: clock stands), and an answer that renumbers telephone-event or gives the audio our number (`DTMF_RX_PT` — KPN echoes our numbers; pinned in `tests/Engine` and by the loopback's collision arm). +- SMS over IP (§7.9) ran on the dev phone on KPN on 2026-10-17 (the fp6 + journal's `2026-10-17-sms-over-ip-bench` capture; §13 has the network + facts): the EF_SMSP read at bring-up and the + `+g.3gpp.smsip` tag on a resumed and on a fresh registration (echoed in + the reg-event reginfo); three `Send`s over `busctl` (one segment each: + MESSAGE → 202, the submit report → `sent`; the dump of the 00:53 one shows + a GSM 7-bit RP-DATA, its report's In-Reply-To naming our Call-ID); five + texts received at 01:17 (one segment each, GSM 7-bit: + parsed, the RP-ACK delivery report sent and answered 202); a sixth + (SC time stamp 01:23:10, logged at 01:23:12) that arrived twice within a second + (`journal-0123-duplicate`; the dump that survives, + `mt-0123-duplicate-message-in`, came over UDP from the P-CSCF) and was + handled twice, two delivery reports, one of them refused 488, which is where the retransmission + absorption (`RecentTransactions`) came from; a + 240-character text (01:33) sent as two segments (consecutive + RP-MR/TP-MR, both 202 + RP-ACK) and received back (01:40) as two + segments (set 174, 159 + 102 bytes) reassembled (SC time stamp 01:40:26, the whole logged at 01:40:28: 240 bytes of + text in 2 segments, `journal-0133-mo-benches-and-0140-mt-concat`); a UCS-2 + text with ü and ß, ❤, an emoji (surrogate pair) and Ω sent + (35 units, TP-UDL 70) and received back decoded (DCS 08) — its trailing + ✓ missing in the copy that came back (34 of its 35 units: the text sent, + `r22-sent-texts-2026-10-17-from-the-session-transcript`, against the + MESSAGE dump `mt-0140-last-segment-message-in`; origin open); sent on its + own, a one-character UCS-2 text arrived at 01:44 (3 bytes of text, + `journal-0144-checkmark-and-absorbed-retransmission`); that one-character text's MESSAGE + retransmitted (01:44:24) and absorbed: answered again, not handled again + — one delivery report, 202; a text from the alphanumeric + sender AUTHMSG at 01:47 (55 bytes, its report answered 202; the day's every + arrival and report: `r24-phone-journal-authmsg-status-reports-2306`); and a + text at 23:08 under a build whose 200, by the capture's heading, echoes + every Via and carries a To tag (`mt-2308-new-final-shape`): the + same-second retransmission was answered again and absorbed, the delivery + report answered 202. No capture of the benches on + hardware holds a journal line of one of these arms (each arm's line is searched in them in the + fp6 journal's `2026-11-19-imsd-1.2.0-r32-cut` capture, `searches/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 and the report's + running out, 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 + sends them over this path is unknown), 8-bit data (an MMS + notification), a message while SMS over IP is off (the 480), a submit + report In-Reply-To no MESSAGE of ours in flight (the 488) or one without + In-Reply-To for no message in flight (the 200), a page-mode MESSAGE, a + body that is no RP message, a delivery that names no gateway, a text + past 255 segments, an EF_SMSP + record 1 that cannot be read or holds no service centre, or one whose + service centre is not an international number, a + delivery report the flow could not + send, a concatenated set aged out after its 30 min, a bus object or + interface that does not register (§7.8). Not searched for, as they write no journal line of their own: a submit report without + In-Reply-To taken by its RP-MR (the one dumped carries In-Reply-To) or one whose In-Reply-To + lists ours among several Call-IDs, a delivered MESSAGE whose + Call-ID holds an ASCII control character or a space, or whose P-Asserted-Identity lists several + identities in one row or begins with a quoted display name, a MESSAGE final arriving inside a REGISTER wait + (`AwaitFinal` → `OnSmsResponse`), a queued message started inside a REGISTER wait, a MESSAGE + inside a call's dialog, a stop with a message queued or in flight. The reducers for the arms of both sentences but the shell + paths — the final's routing inside `AwaitFinal`, the delivery report the + flow could not send, `LoadSmsParameters`' refusals, the MESSAGE + inside a call's dialog, the queue's two + and the bus object's registration — are pinned in + `tests/Engine` — but for EF_SMSP's parser and the reassembler's age-out (`Purge`, given an age), which `tests/Sms` pins, and `HeaderUri`'s reading of a header's value, which `tests/Sip` pins; the Messaging + interface's `Send`, `GetStatus`, `Subscribe` and `StateChanged` ran on + the host's session bus in dev mode (2026-10-16: two `Send`s answered + with ids and failed `imsd is not registered`; 2026-10-17: three + connections — a subscriber, a match-rule-only listener, an unsubscribed + sender — where only the subscriber and the sender heard the + `StateChanged`; 2026-11-19, on a private session bus with the setting + off: `enabled` false, `Send` refused with `NotSupported`, `Subscribe` + answered). + Reached from 2026-10-18 02:17 (`smsc-override-2026-10-18-0217`): the + `SMSC=` override — `SMSC=+31653131313` gives `service centre +31653131313 + (SMSC=)` and a `Send` through it reaches `sent`; `SMSC=abc` gives + `SMSC='abc' is not a number` (`ForNumber` dials digits, `*` and `#` only; + the bench's first run, on a build outside this history that dialled a, b + and c, submitted with them and got an RP-ERROR back, RP cause 28). - `imsd-pcscf` ran on the dev phone (KPN) on 2026-10-11 against the live ims bearer: the `--mux 1 --profile 2 -v` sequence, a plain run, and `OutOfCall` on an unbound mux (the fp6 journal's `2026-10-11-pcscf-pco-probe` capture, @@ -609,10 +728,14 @@ Beyond the rules: `/net/catcrafts/IMS1`, interface `net.catcrafts.IMS1`; the frozen ABI, §8). The bus policy `packaging/net.catcrafts.IMS1.conf` lets any local account reach it; placing, answering and ending a call is polkit's -`net.catcrafts.IMS1.Voice` (`packaging/net.catcrafts.IMS1.policy`, shaped like +`net.catcrafts.IMS1.Voice`, sending a short message over IP and subscribing +to the message signals `net.catcrafts.IMS1.Messaging` +(`packaging/net.catcrafts.IMS1.policy`, both +shaped like ModemManager's Voice action: the active local session and root — not an ssh login, an inactive session or a system service account). Reads (`GetStatus`, -`GetCalls`) stay open, as ModemManager's are to every local account: the call +`GetCalls`, the Messaging interface's `GetStatus`) stay open, as +ModemManager's are to every local account: the call signals reach them all anyway, the status (the address, the P-CSCF, the phone number) travels in no signal. @@ -621,7 +744,8 @@ receive on the protected client flow, the protected-port listeners for terminating requests, media reaping, the keepalive refresh); the GLib main loop owns the bus. D-Bus method calls push commands to the engine queue; engine events reach the bus through `g_idle_add`, where the calls table and -the status snapshot live (main thread only). +the status snapshot live (main thread only). The Messaging interface's +`Subscribe` keeps its subscriber set on the main thread as well (§7.9). Per answered call imsd forks `imsd-media` (`IMSD_MEDIA`, default next to the `imsd` binary, else `/usr/libexec/imsd-media`) with the addresses, ports and @@ -690,7 +814,9 @@ The daemon's own bring-up (`BringUp()` in `main.cpp`): 2. `qmicli -d qrtr://0 --uim-get-card-status` finds the ready USIM (slot, AID); `mmcli -m any` gives the primary SIM path and the IMEI (for the `+sip.instance` URN); `mmcli -i ` gives IMSI and MCC/MNC, from which - the IMPI/IMPU/realm are derived. `mmcli --location-get` fills + the IMPI/IMPU/realm are derived; with SMS over IP on and `SMSC=` unset, + `qmicli --uim-read-record` of EF_SMSP record 1 names the service centre + (§7.9). `mmcli --location-get` fills `P-Access-Network-Info`. 3. **Warm resume** when an SA pair is already in the kernel and the state file (`STATE_FILE`, default `/var/lib/imsd/imsreg.state`) describes the @@ -1020,8 +1146,10 @@ When nothing is held the file is removed — when it is a regular file; `/dev/null` switches the knob off and anything that is not a regular file is emptied, never unlinked. The recovery policy's waits and the holds are measured on the boot clock (`CLOCK_BOOTTIME`), so a suspend counts; the -keepalive refresh gate, the CRLF keepalive and the reg-event retry and -renewal timers run on the steady clock and count awake seconds only. +keepalive refresh gate, the CRLF keepalive, the reg-event retry and +renewal timers and the times SMS over IP measures (§7.9: its two waits, +the 30-minute age-out, the retransmission table's 32 s) run on the steady +clock and count awake seconds only. The **reg-event subscription** (RFC 3680; the network's own view of the binding) is one live dialog per registration, subscribed anew ahead of the @@ -1230,6 +1358,7 @@ account `user`, its old default. | `/run/imsd-ofonod.started` | `imsd-ofono-restart-calls.sh` | marker: imsd-ofonod has started once since boot | | `/var/lib/imsd/imsreg.state` (`STATE_FILE`) | imsd | the registration context for a warm resume | | `/var/lib/imsd/*.stats`, `*.rtp`, `*.raw` | imsd, imsd-media | per-call media stats, raw RTP (`RTP_DUMP`), SIP dumps (`DUMP_SIP`; mode 0600 — they carry the IMSI/MSISDN) | +| `/var/lib/imsd/sms-tpmr` | imsd | the next TP-MR, one decimal number, written when a message's segments take their TP-MRs (§7.9) | | `$XDG_STATE_HOME/imsd/` (else `~/.local/state/imsd/`), `$XDG_RUNTIME_DIR/imsd.holds` (else `/tmp/imsd.holds`) | imsd | the same files for a non-root (`--session`) run | ### 7.8 Journal vocabulary @@ -1326,7 +1455,62 @@ Lines the operator (and the scripts) look for, all prefixed `imsd: `: Security-Verify rebuilt from the SA as one mechanism` at every resume. - `connect: no answer from the P-CSCF N times (…)` when the protected connect series ends unanswered. +- SMS over IP (§7.9): `SMS over IP: off (SMS_OVER_IMS=1 enables it)` at + start, or at bring-up `sms: service centre +… (EF_SMSP[ 'alpha'])[, + validity period 0xnn]` / `sms: service centre +… (SMSC=)` / `sms: no + service centre: EF_SMSP record 1 unreadable or without one; …` / `sms: + SMSC='…' is not a number; …` / `sms: SMSC='…' is not an international + number (+ and digits); …` / `sms: EF_SMSP's service centre '…' is not an + international number (+ and digits); …` and `SMS over IP: on (+g.3gpp.smsip + advertised: …)`; per message of ours `sms : segment i/n to + via : MESSAGE sent (RP-MR a, TP-MR b, N bytes)`, `sms : segment + i/n -> ; awaiting the submit report`, then `sms : sent: …` or + `sms : 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: `, `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 : delivered|delivery-pending| + delivery-failed: ` or `sms : a segment delivered + (TP-MR n); k still to be reported`, and for a report's word on the + message still in flight `sms : delivered|delivery-pending| + delivery-failed: — held until the submission ends`; per delivery `short message from + via at