Add custom SIP header to PJSIP trunk

Edit: the following no longer works…

Second attempt …

  1. Create a new trunk with the same settings as your existing trunk. Do not populate the registration string. This trunk will be dedicated to private outbound.

  2. Override the trunk dial options and use this instead: Ttb(custom-privacy-header^s^1)

  3. In extensions_custom.conf add lines like this:

    [custom-privacy-header]
    exten => s,1,Set(PJSIP_HEADER(add,Privacy)=id)
    exten => s,n,Return

Use this trunk for your private outbound route then reload the dialplan. Might work, didn’t test