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
|
|
@ -193,6 +193,26 @@ export namespace imsd::sip {
|
|||
return out;
|
||||
}
|
||||
|
||||
// `msg` without its `name:` header lines: every line of the header
|
||||
// section on which Headers would find the name, long or compact
|
||||
// (MatchHeaderLine), is left out, and the other lines and the body stay
|
||||
// as they are. For P-Access-Network-Info as the builders write it, one
|
||||
// line with its value, that is the header whole.
|
||||
std::string WithoutHeader(std::string_view msg, std::string_view name) {
|
||||
std::string out;
|
||||
std::size_t kept = 0;
|
||||
ForEachLine(msg, [&](std::string_view line) {
|
||||
if (MatchHeaderLine(line, name)) {
|
||||
const auto at = static_cast<std::size_t>(line.data() - msg.data());
|
||||
out += msg.substr(kept, at - kept);
|
||||
kept = std::min(at + line.size() + 1, msg.size());
|
||||
}
|
||||
return true;
|
||||
});
|
||||
out += msg.substr(kept);
|
||||
return out;
|
||||
}
|
||||
|
||||
// The 3-digit code of a "SIP/2.0 NNN ..." response start-line; nullopt
|
||||
// for requests / anything else. Only matches at the start of the message.
|
||||
std::optional<int> Status(std::string_view msg) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue