# Redirects (Call forward) and P-Asserted-Identity

**URL:** <https://community.asterisk.org/t/redirects-call-forward-and-p-asserted-identity/72912>\
**Category:** Asterisk Support\
**Created:** [December 13, 2017, 4:02am UTC](https://community.asterisk.org/t/redirects-call-forward-and-p-asserted-identity/72912 "2017-12-13T04:02:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bpbp](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bpbp](https://community.asterisk.org/u/bpbp)\
**Post date:** [December 13, 2017, 4:02am UTC](https://community.asterisk.org/t/redirects-call-forward-and-p-asserted-identity/72912/1 "2017-12-13T04:02:38Z")

</div>

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

Here’s a snippet from my dialplan

```auto
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

```auto
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.

---

<div class="post-metadata">

**Author:** ![bpbp](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bpbp](https://community.asterisk.org/u/bpbp)\
**Post date:** [December 13, 2017, 4:04am UTC](https://community.asterisk.org/t/redirects-call-forward-and-p-asserted-identity/72912/2 "2017-12-13T04:04:23Z")

</div>

Sorry, I forgot to mention I am running Asterisk 14.7.3

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [December 13, 2017, 10:53am UTC](https://community.asterisk.org/t/redirects-call-forward-and-p-asserted-identity/72912/3 "2017-12-13T10:53:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bpbp](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bpbp](https://community.asterisk.org/u/bpbp)\
**Post date:** [December 14, 2017, 12:03am UTC](https://community.asterisk.org/t/redirects-call-forward-and-p-asserted-identity/72912/4 "2017-12-14T00:03:31Z")

</div>

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](https://tools.ietf.org/html/rfc5359#page-77) doesn’t have any examples with Privacy ☹ Maybe I’m on the wrong track here

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [December 14, 2017, 12:12am UTC](https://community.asterisk.org/t/redirects-call-forward-and-p-asserted-identity/72912/5 "2017-12-14T00:12:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bpbp](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bpbp](https://community.asterisk.org/u/bpbp)\
**Post date:** [December 14, 2017, 12:27am UTC](https://community.asterisk.org/t/redirects-call-forward-and-p-asserted-identity/72912/6 "2017-12-14T00:27:00Z")

</div>

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