Search code examples
loggingasterisksipphone-call

Asterisk and fake number - how to identify ?


With Asterisk, I guess it is possible to make a call with a "fake" number (for example, your phone number in the company is 123456 and the call you make will only show the main number of the company, 123400).

As a normal person, I get spam calls. And it's boring me.

Therefore, I'd like to find a way to identify the true carrier or the true origin for a call.

For example, I get a call from a false number (+33 6 xx xx xx xx) that might be coming from France, but the number is wrong (not given by any phone provider). So, I'd like to know if it's possible to get the origin of the call (the country, the provider or, the real number).

Any help is welcome : solution, conf file, documentation, tips, iso standards.

Thank you.


Solution

  • The short answer is - you can't...

    If someone has access to the PSTN at the SS7 level to set there own (incorrect) caller ID it's down to the Telco who provide the access to the originating party. As the recipient of a call and a normal user you have no way to trace that call back to its origin. You telco may be able to assist if they are threatening or abusive calls, if for example you are in the UK then you can register with the Telephone Preference Service, report your concerns to Ofcom or the Information commissioners office who will investigate - but will not tell you the true origin.

    If the calls come via SIP/AIX/MGCP etc then you may be able to deduce something from the IP address which initiated the call(s) or shows up in the headers, but again there is no 100% way to trace where the calls have come from.

    If you use asterisk and you are receiving calls from 'invalid' caller ID's my best suggestion is to blacklist them in your extensions.conf file.

    This rule for example blocks anyone sending a caller ID starting with 087 and the one below blocks lazy system admins who send unavailable

    exten => s,2,GotoIf($["${CALLERID(num):0:3}" = "087"]?103:3) exten => s,7,GotoIf($["${CALLERID(name):0:11}" = "UNAVAILABLE"]?103:8)

    These have been pulled from a running config - if you need an entire config section post a comment and I'll anonymize a version and update my answer for you.