How do I modify the P-asserted Identity

The reason why this doesn’t work is because adding custom sip headers to the called channel in pjsip works differently than in chansip. The way you were doing it you were adding the header to the calling channel instead of the called channel.
In pjsip the header has to be added via a predial handler, meaning the header has to be added after the dial application is executed.

FreePBX has a something built in to accomplish that, the func-set-sipheader GoSub that you add to the macro-dialout-trunk-predial-hook in extensions_custom.conf.

Your dialplan would have had to look like this:

[macro-dialout-trunk-predial-hook]
exten => s,1,GoSub(func-set-sipheader,s,1(Diversion,sip:mike(@)192.168.0.253))
exten => s,n,Macroexit()
1 Like