Incoming route based on callerid name


#1

We are getting a lot of telemarketing calls. A lot of the caller names start with a v followed by a bunch of numbers. Is there a way to route incoming calls based on this, similar to routing calls based on the incoming caller telephone number?


(Communication Technologies) #2

You could put every combination in a BL module:
https://wiki.freepbx.org/display/FPG/Blacklist+Module+User+Guide

Or make a custom context, and point the inbound route at the custom context. The custom context could read the first character of the CIDNAME and if its v do something, otherwise do something else.


(Dave Burgess) #3

You could also explore @lgaetz 's famous Whitelisting Thread. Of Robocalls and Whitelists


#4

Looking at custom contexts. Dont see a way to have it read CIDNAME.


#5

Custom context means you write it yourself; you have a lot of options!

Make a new context in the /etc/asterisk/extensions_custom.conf file (for example, call it [from-pstn-filterspam]) and add some dialplan like this (NOT tested)

[from-pstn-filterspam]
exten => _X.,1,NoOp(Entered pstn custom context)
same => n,ExecIf($[${REGEX("^V[0-9]+" CALLERID(name))} = 1]?Goto(app-blackhole,congestion,1))
same => n,Goto(from-pstn,${EXTEN},1)

(it can be on a single line but I spread it out to make it more readable)

Then for the trunk where you are receiving calls, set the context to from-pstn-filterspam.

You can add more lines if you get additional obvious spam patterns.


Call php file on incoming call (asterisk)
(Lorne Gaetz) #6

Hi Bill

For incoming contexts, I prefer to use an exten of _. instead of _X.
If an INVITE arrives without a DID or with non-numeric DID it can be a problem.


#7

I don’t want those INVITEs :slight_smile: (at least on this context)

I understand your point though.

But those log warnings…!


(system) closed #8

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.