Blocking Toll Free Numbers

I’ve setup a separate Inbound Route for each of the most popular toll free prefixes, 800, 822, 833, etc. but they’re not working.

I just received a call from a 877 number even though I have one of my Inbound Routes set to CallerID Number _877NXXXXXX and Set Destination is Terminate Call - Play SIT Tone (Zapateller)

Did I forget a setting needed to make this work?


Can you provide a call trace?

If I knew how I could! :grin:

Is it in the CDR reports?

OK, I have it, but before I post it, is there anything in there I should remove for security purposes?


I have the call trace info, it’s really long, should I post all of it here?

Also, today I changed the line from _877NXXXXXX to just 877NXXXXXX and that same telemarketer is still ringing my phone! Do these Inbound Route blocks not work?

About six weeks ago, there was a thread about the things that did and didn’t work in the dial plan for incoming routes. I don’t remember the full solution,but there was something about the way that some of these worked.

If you have access to the /var/log/asterisk/full log file (and since you have the exact time from the call trace), can you look in there and see what CID number the telemarketer is actually using to get past your inbound route? It could be something hinky like they are including an extra digit in their caller ID entry (instead of NXXNXXXXXX, it could be getting passed as NXXXXXXXXX or NXXNXXXXXX X).

Thanks for the reply! The number in the call trace logs is 8772361115

Attached below is a screenshot of my settings, do they look correct?


The way matching works in asterisk is specific, any wild card needs to be prepended with an underscore, so try


If that matches your logs for CALLERID(num)
You should also be very explicit on your DID or you might shortcircuit the match. Use exactly your VERY particular DID , DO NOT try and leave it empty or wild card match yet. . .


For example.


Check using the ‘dialplan show . . .’ To verify.

OK, just now that number dialed me again and my extension rang!

This was AFTER I changed my generic 877 block to the actual Caller ID number that they’re using, which is 8772361115.

So now I just changed it to Terminate Call > Hangup, then I created a new Inbound Route and I used _8772361115 for that one and set it also to Terminate Call > Hangup.

For good measure I rebooted the FreePBX computer. I have zero faith that this is going to stop the calls from getting through to my extension, though.

Why is this so hard? Am I going to be forced to setup IVR and make everyone Press 1 to speak to a human in order to rid myself of telemarketers?


Since you’re having so much trouble with this, why don’t you try testing this with your cell phone, until you figure out what the problem is?

I would point out that


is actually on the fcc “blacklist”, currently with score of 1

OK, so now I know that 8772361115 is on the FCC blacklist, how does that help me?

And if I do this testing using my cellphone, without any ideas on what I need to change, how is that going to help me?

I appreciate that this forum is all volunteers and that FreePBX is free, but I’m here, I’m ready to give any logs or information my system spits out, and I’m ready to change whatever settings you guys suggest…so let’s go!

make sure you set the spam level to 1

I just thought of a dodge that would get them around the block.

If I sent the callerid(NAME) as ‘8771234567’ and the callerid(NUM) as “1”, the current matching system would probably not catch the call, since the CallerID Number doesn’t actually match.

If I was a crook, I’d try that first just to mess with us.

No idea what you’re talking about.

I just set an Inbound Route to block my cell phone number and it lets it ring right through.

Tried adding 1 to the front of the CID and to the DID, makes no difference, it lets all calls come through.

Do any of you guys actually use this Inbound Route feature to block callers or are you just throwing ideas at me?

Don’t worry, I’ll stop throwing either ideas or possible solutions at you.

Thanks, you’ve been no help.

Yes, I do. It works flawlessly. Over half of my inbound routes are based on Caller ID. For example, when I call my PBX from my cell phone, it skips over the IVR for the business and rings the “FMFM” for my wife. Her cell phone works the same way. I’m part of an emergency calling tree that does the same thing (they call me, the system routes the call to everyone I’m supposed to call and conferences me in).

As long as the Caller ID Priority route flag is set and you don’t get carried away with the inbound DID numbers, it works every time for me.