AGI set CLIR for SIP calls

Hi,

I’m finding a way to set CLIR for SIP calls in PHPAGI. The Asterisk systems are running in Asterisk 14. I tried to use agi->set_callerid(‘anonymous’) but it won’t change to Anonymous sip:anonymous@anonymous.invalid in SIP message from field.

Is there any good way to restrict the caller ID in AGI? Thanks

If you are using the PHPAGI class you can evaluate the Caller ID like this

$cid = $agi->parse_callerid();

if($cid[username) {

code here

}