Skip to content

feat(sip): M7 CP2 — apply from_user/from_domain to the origination From - #158

Merged
ryanmurf merged 1 commit into
masterfrom
feat/m7-cp2-from-user-domain
Jul 17, 2026
Merged

feat(sip): M7 CP2 — apply from_user/from_domain to the origination From#158
ryanmurf merged 1 commit into
masterfrom
feat/m7-cp2-from-user-domain

Conversation

@ryanmurf

Copy link
Copy Markdown
Owner

M7 CP2 — apply from_user/from_domain to the origination From

build_invite_with_uri hardcoded sip:asterisk@<bind> in the From. A carrier
that authorizes by caller identity (Chime rejects a From that is not a DID we
own) could never be satisfied. This applies the endpoint's from_user/
from_domain to the outbound From — INVITE and in-dialog BYE — falling back to
asterisk @ the signalling host:port when unset. Contact still advertises the
reachable asterisk@<sig> (reachability, not identity).

Receiver-side proof (isolated offline-carrier harness)

tests/cp2-from-identity/run.sh — the offline carrier captures the outbound
INVITE and the harness asserts its From URI:

expected From URI: sip:+19709601891@carrier.example.net
captured From URI: sip:+19709601891@carrier.example.net
result:            PASS
INVITE-FROM ... from_uri=sip:+19709601891@carrier.example.net raw_from=<sip:+19709601891@carrier.example.net>;tag=...

Decisive RED

Revert the From to sip:asterisk@{sig} → the carrier captures
from_uri=sip:asterisk@0.0.0.0:15060result: FAIL.

Unit tests (RED-capable)

session::cp2_tests: From carries user@domain; user-only keeps the signalling
domain; unset → asterisk; BYE From matches the configured identity.

cargo test --workspace --exclude pjsip-shim + clippy … -D warnings green.
Rust 1.97.0.

`build_invite_with_uri` hardcoded `sip:asterisk@<bind>` in the From, so a
carrier that authorizes by caller identity (Chime rejects a From that is not a
DID we own) could never be satisfied. Apply the endpoint's `from_user`/
`from_domain` to the outbound From (INVITE and in-dialog BYE), falling back to
`asterisk` @ the signalling host:port when unset.

- session: `from_uri()` builds `sip:user@domain`; used by `build_invite_with_uri`
  and `build_bye` so the From identity stays stable across the dialog. New
  `from_user`/`from_domain` session fields. Contact still advertises the reachable
  `asterisk@<sig>` (reachability, not identity).
- channel_driver: resolve the endpoint's from_user/from_domain onto the outbound
  session (mirroring outbound_auth).

Proofs: session cp2_tests (From carries user@domain; user-only keeps the
signalling domain; unset -> asterisk; BYE From matches). RED-capable: revert ->
`sip:asterisk@<bind>`. tests/cp2-from-identity — isolated offline-carrier harness
asserting the captured INVITE From URI is exactly the configured identity
(receiver-side). Captured RED: reverting yields `sip:asterisk@0.0.0.0:15060`.
@ryanmurf
ryanmurf merged commit e131226 into master Jul 17, 2026
3 checks passed
@ryanmurf
ryanmurf deleted the feat/m7-cp2-from-user-domain branch July 17, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant