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
|
|
@ -14,7 +14,11 @@
|
|||
// ring and are answered at the offer's own payload types, ring timeout ->
|
||||
// 480, BYE both ways; an incoming call from an INVITE, and an outgoing
|
||||
// call from responses, whose header names come in compact form (RFC 3261
|
||||
// 7.3.3). DTMF: the tones reach the media leg on an active
|
||||
// 7.3.3); which of a call's messages carry P-Access-Network-Info where
|
||||
// the cell is known (its 180, its 200s but the one to a CANCEL, a 486
|
||||
// and a 487, PRACK and BYE) and which do not (the 100 Trying, the 200 to
|
||||
// a CANCEL, the ACKs, the CANCEL). DTMF: the tones reach the media leg
|
||||
// on an active
|
||||
// call that negotiated telephone-event, and are dropped — with the reason
|
||||
// — before the answer, after the call, without the negotiation or with a
|
||||
// character that is no tone. Then RegRecovery, the registration recovery policy:
|
||||
|
|
@ -917,6 +921,67 @@ int main() {
|
|||
Check(m.Terminated(), "terminated");
|
||||
}
|
||||
|
||||
// ---- P-Access-Network-Info through a call's life, where the cell is
|
||||
// known: in the 180, the 200s but a CANCEL's, a 486 and a 487, and
|
||||
// in PRACK and BYE; in no 100 Trying, no ACK and no CANCEL
|
||||
{
|
||||
Context k = MakeCtx();
|
||||
k.panInfo = "3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=0010112340ABCDE0";
|
||||
const auto with = [](const Action* a) { return a && a->text.contains("\r\nP-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=0010112340ABCDE0\r\n"); };
|
||||
const auto without = [](const Action* a) { return a && !a->text.contains("P-Access-Network-Info"); };
|
||||
const auto inDialog = [](std::string_view method, std::string_view callid, std::string_view extra = "") {
|
||||
return std::format(
|
||||
"{} sip:001010123456789@[2001:db8::db43]:45061 SIP/2.0\r\n"
|
||||
"Via: SIP/2.0/UDP [2001:db8::105]:5100;branch=z9hG4bKpcscf9\r\n"
|
||||
"From: <sip:+31612345678@ims;user=phone>;tag=caller1\r\n"
|
||||
"To: <sip:+31611111111@ims;user=phone>;tag=ours\r\n"
|
||||
"Call-ID: {}\r\nCSeq: 2 {}\r\n{}Content-Length: 0\r\n\r\n", method, callid, method, extra);
|
||||
};
|
||||
{
|
||||
// an incoming call its caller cancels
|
||||
imsd::util::Rng rng(71);
|
||||
CallMachine m(k, rng, "ims-call-80", IncomingInvite{MtInvite("Require: 100rel\r\n")}, 50004);
|
||||
auto ai = m.OnInvite();
|
||||
Check(with(Responded(ai, "SIP/2.0 180 Ringing")) && without(Responded(ai, "SIP/2.0 100 Trying")), "a cell known: the 180 to an incoming INVITE carries P-Access-Network-Info, its 100 Trying does not");
|
||||
Check(with(Responded(m.OnRequest(inDialog("PRACK", m.CallId(), "RAck: 1 1 INVITE\r\n")), "SIP/2.0 200 OK")), "... and the 200 to the PRACK of that 180");
|
||||
auto ac = m.OnRequest(inDialog("CANCEL", m.CallId()));
|
||||
Check(without(Responded(ac, "SIP/2.0 200 OK")) && with(Responded(ac, "SIP/2.0 487 Request Terminated")), "... the 200 to a CANCEL does not, the INVITE's 487 does");
|
||||
}
|
||||
{
|
||||
// an incoming call answered, then refreshed and ended from the far side
|
||||
imsd::util::Rng rng(72);
|
||||
CallMachine m(k, rng, "ims-call-81", IncomingInvite{MtInvite()}, 50004);
|
||||
m.OnInvite();
|
||||
Check(with(Responded(m.OnAccept(), "SIP/2.0 200 OK")), "... the 200 that answers the call");
|
||||
Check(with(Responded(m.OnRequest(inDialog("UPDATE", m.CallId(), "Session-Expires: 1800;refresher=uac\r\n")), "SIP/2.0 200 OK")), "... the 200 to a session refresh");
|
||||
Check(with(Responded(m.OnRequest(inDialog("BYE", m.CallId())), "SIP/2.0 200 OK")), "... and the 200 to the far side's BYE");
|
||||
}
|
||||
{
|
||||
// an incoming call refused, and one answered and ended here
|
||||
imsd::util::Rng rng(73);
|
||||
CallMachine m(k, rng, "ims-call-82", IncomingInvite{MtInvite()}, 50004);
|
||||
m.OnInvite();
|
||||
Check(with(Responded(m.OnHangup(), "SIP/2.0 486 Busy Here")), "... a 486");
|
||||
CallMachine n(k, rng, "ims-call-83", IncomingInvite{MtInvite()}, 50004);
|
||||
n.OnInvite();
|
||||
n.OnAccept();
|
||||
Check(with(Sent(n.OnHangup(), "BYE ")), "... our BYE on a call that came in");
|
||||
}
|
||||
{
|
||||
// a call we place: its PRACK and its BYE carry it, its ACKs and its CANCEL do not
|
||||
imsd::util::Rng rng(74);
|
||||
CallMachine m(k, rng, "ims-call-84", "1233", 50004, false);
|
||||
m.Start();
|
||||
Check(with(Sent(m.OnInviteResponse(R183(m.CallId())), "PRACK ")), "... the PRACK of a call we place");
|
||||
Check(without(Sent(m.OnInviteResponse(R200(m.CallId())), "ACK ")), "... not the ACK of its 200");
|
||||
Check(with(Sent(m.OnHangup(), "BYE ")), "... its BYE");
|
||||
CallMachine n(k, rng, "ims-call-85", "1233", 50004, false);
|
||||
n.Start();
|
||||
Check(without(Sent(n.OnHangup(), "CANCEL ")), "... not a CANCEL");
|
||||
Check(without(Sent(n.OnInviteResponse(Final(n.CallId(), 487, "Request Terminated")), "ACK ")), "... and not the ACK of a refusal");
|
||||
}
|
||||
}
|
||||
|
||||
// ================= emergency (stage 1) ================================
|
||||
|
||||
// ---- emergency dial: the INVITE targets the sos URN over the normal
|
||||
|
|
|
|||
Loading…
Reference in a new issue