Redirects (Call forward) and P-Asserted-Identity

Hi all - I am trying to set up call forward for my endpoints.

Here’s a snippet from my dialplan

exten => call-forward-unconditional,1,NoOp()
 same => n,Set(CHANNEL(accountcode)=${ACCOUNT_CODE})

 same => n,Set(REDIRECTING(count,i)=$[${REDIRECTING(count)} + 1])
 same => n,Set(REDIRECTING(from-num,i)=${NUMBER})
 same => n,Set(REDIRECTING(from-num-pres,i)=allowed)
 same => n,Set(REDIRECTING(to-num,i)=${CFU})
 same => n,Set(REDIRECTING(reason)=cfu)
 same => n,Set(PJSIP_HEADER(update,P-Asserted-Identity)=<sip:${NUMBER}@voip.fqdn.com>)
 same => n,Dial(PJSIP/${CFU}@${TRUNK})

The trunk is configured with

endpoint/send_pai = yes
endpoint/trust_id_outbound = yes

Unfortunately the P-Asserted-Identity header is not being updated. In a SIP trace I still see the original incoming PAI and causes my calls to be rejected by my provider. If anyone could please provide some insight into this I would appreciate it.

Sorry, I forgot to mention I am running Asterisk 14.7.3

chan_pjsip doesn’t really allow headers it generates like that (PAI) to be modified. If you need PAI to change as well then you’d need to change the CONNECTEDLINE information too.

1 Like

Thanks for the hint. Unfortunately I can’t seem to get my use case to work with any combination of CALLERID, REDIRECTING and CONNECTEDLINE. I’d like to preserve the original caller-id in the “From” header but replace the PAI so my provider accepts the call.

If I set CALLERID(all) before dial it replaces the From and PAI
If I set any CALLERID(priv-*), CONNECTEDLINE(priv-*) nothing seems to change

Do you think this is possible? Unfortunately https://tools.ietf.org/html/rfc5359#page-77 doesn’t have any examples with Privacy :frowning: Maybe I’m on the wrong track here

There is no ability to independently set them, the only way to override is explicitly using the from_user option on the endpoint.

1 Like

Hmm OK interesting. I’ll need to rethink this approach. Thanks for your help.