Asterisk – hide caller id – sip.conf

;trustrpid = no                 ; If Remote-Party-ID should be trusted
;sendrpid = yes                 ; If Remote-Party-ID should be sent (defaults to no)
;sendrpid = rpid                ; Use the "Remote-Party-ID" header
                                ; to send the identity of the remote party
                                ; This is identical to sendrpid=yes
sendrpid=yes
sendrpid = pai                 ; Use the "P-Asserted-Identity" header
trustrpid=yes
                // 1.1.1.1, 2.2.2.2
                if ( '${CHANNEL(recvip)}' == '1.1.1.1' || '${CHANNEL(recvip)}' == '2.2.2.2' ) {
                        verbose(UC anonymous check === From header  ${SIP_HEADER(From)});
                        Set(uc_from_all=${SIP_HEADER(From)});
                        Set(uc_from_first=${CUT(uc_from_all,\ ,1)});
                        // uc_from_first="Anonymous" ,
                        verbose(UC from === ${uc_from_all} === ${uc_from_first});
                        if ('${uc_from_first:1:9}' == 'Anonymous') {
                                Set(CALLERID(number)='Anonymous');
                                Set(CALLERID(name)='Anonymous');
                                SIPAddHeader(Privacy: id);
                                SipAddHeader(P-Asserted-Identity: Anonymous);
                        }
                }

https://wiki.kolmisoft.com/index.php/P-Asserted-Identity