Preserve P-Asserted-Identity as recieved

Is there any way to preserve the incoming PAI? I’m sending it in to Asterisk in e.164 format, and Asterisk is rewriting it to 10 digit. I’d rather it just not touch it.

Has anyone run into and solved this issue before?

I don’t have a version with P-A-I support, but looking at the source code, the shrinkcallerid parameter may control this. The actual routine is in a different source file, as is the documentation of the parameter,and I don’t want to spend any more time looking at the current source code.

I figured out something that works for me.

exten => _1NXXNXXXXXX,1,Set(P-Asserted-Identity=${SIP_HEADER(P-Asserted-Identity)})
exten => _1NXXNXXXXXX,n,Set(PRIVACY=${SIP_HEADER(Privacy)})
exten => _1NXXNXXXXXX,n,SIPAddHeader(P-Asserted-Identity: ${SIP_HEADER(P-Asserted-Identity)})
exten => _1NXXNXXXXXX,n,ExecIf($["${PRIVACY}" = “id”]?SetCallerPres,prohib)
exten => _1NXXNXXXXXX,n,ExecIf($["${PRIVACY}" = “id”]?SIPAddHeader(Privacy:id))
exten => _1NXXNXXXXXX,n,Dial(SIP/${EXTEN}@outbound_carrier)
exten => _1NXXNXXXXXX,n,Hangup