Custom SIP headers not appearing in participant attributes

This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.

I’ve configured my outbound trunk with attributesToHeaders to pass custom SIP headers, but I can’t see them in the call logs or participant attributes.

The configuration:

{
  "headersToAttributes": {
    "xCompanyId": "company_id"
  },
  "attributesToHeaders": {
    "companyId": "X-CompanyId"
  },
  "includeHeaders": "SIP_ALL_HEADERS"
}

Is there something I’m missing?

For outbound calls, passing custom SIP headers works by including them directly in the CreateSIPParticipantRequest headers field.

The trunk-level attributesToHeaders may not work as expected due to a known issue:

Pass the headers manually in the CreateSIPParticipantRequest to work around this.