I am dealing with the same issue right now. I have a Grandstream HT503 configured as a trunk with IP auth (no username and password) with inbound and outbounds via HT503. I believe you need to create a custom context in
/etc/asterisk/extensions_custom.conf
I came up with this but have not tested it yet!
[from-pstn-passerted]
exten => _X!,1,Set(CALLERID(num)=${SIP_HEADER(P-Asserted-Identity)})
exten => _X!,n,Goto(from-trunk,${EXTEN},1)
then you send your call must use the context from-pstn-passerted and be passed to from-trunk
likewise if you wanted to prefix say a 1 or a zero you could prefix a 1 like in the example below
[from-pstn-passerted]
exten => _X!,1,Set(CALLERID(num)=1${SIP_HEADER(P-Asserted-Identity)})
exten => _X!,n,Goto(from-trunk,${EXTEN},1)
And last but not least if the header is Remote Party ID
[from-pstn-rpid]
exten => _X!,1,Set(CALLERID(num)=${SIP_HEADER(Remote-Party-Id)})
exten => _X!,n,Goto(from-trunk,${EXTEN},1)
All of this of course assumes we are dealing with a trunk and not an extension because Asterix/FreePBX will overwrite this with extension info based on default contexts