Freepbx sip custom header P-Preferred-Identity

edit - This method is out of date, and won’t work with pjsip trunks

Thanks @Wanderer for the reminder, I had totally forgotten about that technique when it made the rounds some months back. The following will work for both chan_sip and pjsip trunks:

[custom-sip-header]
; add "B(custom-sip-header^s^1)" (without quotes) to the dial options of a trunk in addition to the defaults already there
; this only affects calls on specific trunks
exten => s,1,Noop(entering user defined context custom-sip-header in extensions_custom.conf)
exten => s,n,Set(HASH(__SIPHEADERS,P-Preferred-Identity)=sip:${CALLERID(number)}@sipconnect.sipgate.de)
exten => s,n,Return
1 Like