I have an Asterisk PBX and route incoming calls that are likely to be spam in different ways. Historically I have done this with TrueCNAM's API.
Today I came up with a simple hack to eliminate the API. There's nothing wrong with using the API of course, but since Callcentric already looks up the spam score, me doing it a second time is redundant. Some service providers include the TrueCNAM score in the SIP headers, but Callcentric doesn't. This hack however effectively does the same thing.
For this example, my Callcentric number is 17770000000 and my DID is 134711111111.
Simply create a Call Treatment setting Called Number to 13471111111 and Spam call probability to High. Configure the treatment to redirect the call to This number: 17770000000.
Now, simply inspect ${SIP_HEADER(TO)} in your dial plan. If it contains 17770000000, the spam call probability is high. If it contains 13471111111, the probability is medium or low. For example:
same => n,NoOp(Spam probability is ${IF(${REGEX("17770000000" ${SIP_HEADER(TO)})}?HIGH!:low.)})
↧