# P-Asserted Identity

**URL:** <https://community.asterisk.org/t/p-asserted-identity/47828>\
**Category:** Asterisk Support\
**Created:** [December 29, 2014, 9:47pm UTC](https://community.asterisk.org/t/p-asserted-identity/47828 "2014-12-29T21:47:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [December 29, 2014, 9:47pm UTC](https://community.asterisk.org/t/p-asserted-identity/47828/1 "2014-12-29T21:47:58Z")

</div>

Complete newbie to Asterisk, it came as part of a Synology box and we needed a web phone system via Gamma SIP trunks. Managed to get extensions and trunk working and the only issue I have been having is with outbound Calling Line Identity over the SIP trunk. I have delved into extensions.conf and from another very useful post in this forum I discovered that I needed to comment out a line at the 7th line below.

This caused CLI to be correctly forwarded but my provide Gamma in the UK does not seem to recognise this. The do however support P-Assisted-Identity and after a lot of searching I came up with the content of line 6. This does work and called id is recognised, however it does not work perfectly as if there is no CLI set for the extension the call fails.

Can anyone help me with the syntax of how to correctly provision the P-Assisted-Identity.

[macro-trunkdial-failover-0.3]  
exten = s,1,GotoIf($[${LEN(${FMCIDNUM})} \> 6]?1-fmsetcid,1)  
exten = s,n,GotoIf($[${LEN(${GLOBAL\_OUTBOUNDCIDNAME})} \> 1]?1-setgbobname,1)  
exten = s,n,Set(CALLERID(num)=${IF($[${LEN(${CID\_${CALLERID(num)}})} \> 2]?${CID\_${CALLERID(num)}}:)})  
exten = s,n,SIPAddHeader(P-Asserted-Identity: sip:${CALLERID(num)}@78.33.233.82)  
;exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${ARG5})} \> 2]?${ARG5}:)})  
exten = s,n,GotoIf($[${LEN(${CALLERID(num)})} \> 6]?1-dial,1)  
exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${CID\_${ARG3}})} \> 6]?${CID\_${ARG3}}:${GLOBAL\_OUTBOUNDCID})})  
exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${ARG5})} \> 2]?${ARG5}:)})  
exten = s,n,Goto(1-dial,1)

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [December 29, 2014, 10:27pm UTC](https://community.asterisk.org/t/p-asserted-identity/47828/2 "2014-12-29T22:27:47Z")

</div>

With a current version of Asterisk:

sendrpid=pai

in sip.conf.

You have already set PAI before line 6, so line 6 will have no effect on the PAI value sent.

Beware that Synology seem to use a discontinued GUI, so any questions about the GUI dialplan code should be addressed to them.
