messages, imsd: P-Access-Network-Info in responses and in requests within a dialog
imsd named the serving cell in its REGISTERs, the reg-event SUBSCRIBE, an INVITE and a MESSAGE. TS 24.229 5.1.2A.1.1 and 5.1.2A.2 have a UE insert the header into a request within a dialog as well, and into a response within a dialog, to a request for a dialog and to a standalone method: not into a CANCEL nor into a response to one, and into an ACK at its choice. A PRACK and a BYE carry it now, and every response imsd builds but a 100 Trying, the 200 to a CANCEL and the transport's 400 to a request cut short. The server ports (the protected ports' TCP listeners and UDP sockets) take a request from any source (AGENTS.md §12), and the header is the phone's cell. What they send in answer keeps it only on the two paths of the SA pair the shell has on record, and loses it anywhere else. Tested: the suites, and the daemon of this commit on the workstation against a stand-in network that asks it from both sides of those paths (the fp6 journal's 2026-12-04-pani-in-dialog capture, bench/), and on the dev phone on KPN, where its answers to a text's two requests and a call's 180 and 200 carried the header inside the SA pair (the journal's 2026-12-04-imsd-1.2.7-range-on-dev-phone capture).
This commit is contained in:
parent
6d05aaed0d
commit
a65724a252
11 changed files with 460 additions and 38 deletions
|
|
@ -11,8 +11,10 @@
|
|||
// (CutShortRequest), a refused final's Retry-After and summary (RetryAfter,
|
||||
// RefusalSummary), the interval a 422's Min-SE names (MinSe), transaction
|
||||
// matching (ResponseOf), our binding in a
|
||||
// reg-event document (RegInfoContactState), and HeaderUri and Body. These pin
|
||||
// the module's edge-case behavior; see the module header before "fixing" one.
|
||||
// reg-event document (RegInfoContactState), HeaderUri and Body, and a
|
||||
// message less every line on which one header is found (WithoutHeader).
|
||||
// These pin the module's edge-case behavior; see the module header before
|
||||
// "fixing" one.
|
||||
import std;
|
||||
import Imsd;
|
||||
|
||||
|
|
@ -569,6 +571,34 @@ int main() {
|
|||
Check(imsd::sip::Body("OPTIONS sip:x SIP/2.0\r\nCSeq: 1 OPTIONS\r\n").empty(), "Body: none without a terminator");
|
||||
}
|
||||
|
||||
// ---- WithoutHeader: a message less every line on which one header is
|
||||
// found
|
||||
{
|
||||
const std::string r =
|
||||
"SIP/2.0 200 OK\r\n"
|
||||
"Via: SIP/2.0/UDP [2001:db8::105]:6000;branch=z9hG4bKnet1\r\n"
|
||||
"P-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=0010112340ABCDE0\r\n"
|
||||
"Content-Type: text/plain\r\n"
|
||||
"Content-Length: 31\r\n"
|
||||
"\r\n"
|
||||
"P-Access-Network-Info: a body\r\n";
|
||||
const std::string bare =
|
||||
"SIP/2.0 200 OK\r\n"
|
||||
"Via: SIP/2.0/UDP [2001:db8::105]:6000;branch=z9hG4bKnet1\r\n"
|
||||
"Content-Type: text/plain\r\n"
|
||||
"Content-Length: 31\r\n"
|
||||
"\r\n"
|
||||
"P-Access-Network-Info: a body\r\n";
|
||||
Check(WithoutHeader(r, "P-Access-Network-Info") == bare, "WithoutHeader: the header's line is gone, the other lines and a body line that spells its name stay");
|
||||
Check(WithoutHeader(bare, "P-Access-Network-Info") == bare, "WithoutHeader: a message without the header comes back as it is");
|
||||
Check(WithoutHeader(r, "p-access-network-info") == bare, "WithoutHeader: the name in another letter case");
|
||||
Check(WithoutHeader(r, "P-Access-Network") == r && WithoutHeader(r, "Access-Network-Info") == r, "WithoutHeader: a name that is only part of a header's name takes nothing");
|
||||
const std::string twice = "BYE sip:a@b SIP/2.0\r\nP-Access-Network-Info: one\r\nCSeq: 2 BYE\r\nP-Access-Network-Info: two\r\n\r\n";
|
||||
Check(WithoutHeader(twice, "P-Access-Network-Info") == "BYE sip:a@b SIP/2.0\r\nCSeq: 2 BYE\r\n\r\n", "WithoutHeader: every line of the name, the last before the empty line too");
|
||||
Check(WithoutHeader("SIP/2.0 200 OK\r\nVia: x\r\nP-Access-Network-Info: v", "P-Access-Network-Info") == "SIP/2.0 200 OK\r\nVia: x\r\n", "WithoutHeader: a last line without its line end");
|
||||
Check(WithoutHeader("SIP/2.0 200 OK\r\nv: x\r\nTo: y\r\nVia: z\r\n\r\n", "Via") == "SIP/2.0 200 OK\r\nTo: y\r\n\r\n", "WithoutHeader: a header under its compact form goes as under its long one");
|
||||
}
|
||||
|
||||
if (Failures == 0) std::println("Sip: all tests passed");
|
||||
return Failures != 0; // not the count: `crafter-build test` takes an exit status of 77 for a skipped suite, and this suite has more checks than that
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue