Freeze one request and its channel graph
Record timestamp and timezone, full Asterisk version, package source, loaded modules, dialplan revision, source channel and unique ID, linked ID, every callee channel, endpoint or contact, handler option, expected header name and value, emitted request, next hop and response. Classify the first mismatch as unavailable function, failed add or update, wrong source channel, missing inheritance, per-leg handler error, duplicate store, later overwrite, intermediary rewrite or peer rejection.
Do not begin by adding the same field through PJSIP_HEADER(). That can create a second independently owned header and hide the original inheritance failure.
Prove branch and module availability first
Confirm a documented supporting release: 20.19.0 or later on branch 20, 22.9.0 or later on branch 22, or 23.3.0 or later on branch 23. Do not infer support from the major number alone; Asterisk 21 documentation does not list the function. Confirm res_pjsip_header_funcs is loaded and the active dialplan actually contains the intended priorities.
A parse error, unknown function or stale dialplan is earlier evidence than a missing packet field. Preserve the error and correct that boundary before changing endpoint or carrier settings.
Check operation preconditions without inventing a read
Verify that add executes before update, because update requires the named inheritable header to exist and can fail the call otherwise. Confirm the instance number when duplicate names are intentional. When removing, record exact-name or wildcard scope and the returned count.
There is no documented read action for this function. Use controlled inputs, dialplan execution evidence and sanitized outbound signaling. An empty attempted read is not proof that inheritance failed.
Follow the value from caller to every callee
Identify the channel where the inheritable header was added and each outbound PJSIP child created afterward. For parallel contacts or endpoints, compare every fork. If a lowercase b() handler is present, prove one execution on each callee, its update or remove result and its required Return().
A value added after the relevant child was created, on a Local-channel sibling, in uppercase B() when per-callee mutation was intended, or on a branch that never sent the request cannot establish the affected leg. Keep call forwarding and nested Dial boundaries visible rather than treating linkedid as shared header state.
Inventory both header stores and the wire result
Search the dialplan and generated logic for both PJSIP_INHERITABLE_HEADER() and PJSIP_HEADER() using the same name. Because each function owns only its own additions, an ordinary remove does not clear an inheritable copy and an inheritable remove does not clear an ordinary copy. Compare the complete sanitized outbound header list before and after the pre-dial handler.
Then compare Asterisk output with the SBC or carrier-facing message. A duplicate can originate in separate dialplan stores or be added by an intermediary; a missing far-side field can be removed after Asterisk emitted it.
Correct one boundary and repeat positive and negative controls
Correct only the demonstrated owner: supporting maintenance release, loaded module, dialplan order, source channel, add-before-update sequence, handler option, per-callee logic, duplicate store or intermediary policy. Repeat the same request, one expected fork and one nearby case that must not receive the header. Confirm the source state, callee mutation, emitted syntax, peer response and final outcome separately.
Remove temporary protocol logging and retain only redacted evidence. Do not broaden identity or routing permissions to make the field appear. No PBX, module, dialplan, channel, endpoint, header, request, response, packet or call was inspected or tested for this diagnostic.
Sources & applicability
Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.
- Asterisk PJSIP_INHERITABLE_HEADER dialplan function ↗
- Asterisk 20 PJSIP_INHERITABLE_HEADER reference ↗
- Asterisk 22 PJSIP_INHERITABLE_HEADER reference ↗
- Asterisk 23 PJSIP_INHERITABLE_HEADER reference ↗
- Asterisk PJSIP_HEADER dialplan function ↗
- Asterisk pre-dial handlers ↗
- Asterisk Dial application ↗
Examples require adaptation to your topology. No live PBX or hardware testing is claimed.