Unless you are creating a call center service, with voip/SIP you can't intercept anything. If you are using some pbx software, like asterisk wich use SIP protocol, you need to look at contact header.
You can also use a cloud communications provider like twillio or plivo which provides an opensource alternative to twillio.