Routing based on Caller ID

I need a little help with the specific definition of a CID, is it the number only or does it include the text description? Can I route based on a name?

I’ve got a nuisance robocall at 2:20PM every day, it’s one of those fake Google calls. My CDR reports list the CID as:

"Alabama "<12054248547>
"V21513513400050 "<12722000310>
"V21414513700050 "<12722000310>
"California "<13109297077>
"Washington "<13607982701>
"Florida "<13218630551>
"V21114134700042 "<13512050293>
"Alabama "<12054802864>

The robocall uses a different spoofed number everyday, I can/do blacklist it but since they don’t seem to reuse the number they have become smarter than a simple blacklist.

I’d like to filter all calls that start with a capital V to an IVR that asks the caller to press 1 to continue but so far I’ve had no luck. I tried creating an inbound route with no DID and a CID of _V21. but the calls still get through.

This makes me think the beginning part V21513513400050 that is listed in the CDR report isn’t really part of the CID.

Any direction on what to read to understand this better would be greatly appreciated.


I don’t know that I have a good / right answer… just wanted to toss out what I do.

On all incoming calls, I send the call to an custom agi script called callscreener.

This agi/php script takes the CID and CNID passed from asterisk and does some custom lookups.

I return whitelist, blacklist, vm, or IVR

For CID/CNID that are the same ( no name… or the phone number repeated as the name) I send them to my IVR.

For robo calls that have Vxxxxxxxxxx as the CNAM I blacklist those which does a SIT ( no longer in service ) tone and hangs up.

So … if you can’t do it via the normal FreePBX GUI… you can do a custome agi script to handle this.

  • jack

There’s people here who created some custom rules to enhance their blacklist, like importing from public spam lists etc.

Regarding routing based on CID, see this post.
Also, Lorne’s post seems more elegant.
We wanted to route calls if it has “AA:” to a different destination (We added the “AA:” as a prefix)

Your “V” calls seems all to start with “V21” is thats the case then maybe you should to something like [${check} != "V21"]

Routing these calls to a IVR rather than a blacklist would be a good idea, in case there’s a human at the other end… (You can maybe set the timeout destination in the IVR to blacklist…)

Much luck.

Thanks Jack and Pitz.

I’m not a noobie, I have read the Asterisk the Definitive Guide and my installation has been running for years but I’m not experienced and was hoping to get a GIU solution using the Inbound routes page. I guess the robocallers are a step or two ahead of the GUI. :frowning:

Maybe I’ll have time over Christmas to haul the book out and try to write a script, if I get one to work I’ll post it here for others.


Did you see this? Maybe it will help as you develop?

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