Filter/Route incoming calls based on CID

Although I know this question has been discussed many times, I couldn’t find right answer applicable in my case.

So the situation is like the following:
-I have inbound DID1
-I have inbound DID2

DID1 is for commercial calls and everyone has to be able to call in
DID2 is call center, for support, info etc.

I have a customer (elder one btw) who is apparently veerry bored and calls call center in hunderds times a day “just to ask something” (stupid, of course)

Thus, I want not to block hiim by putting his CID on BlackList (this would block him from calling commercial DID1 as well) but rather to put him (only if he calls DID2-call center) directly to voicemail instead of going to support operator.
I could manage this by simply inserting additional line into
extensions_additional.conf where I say:
exten => myDID1-number,n,GotoIf($["${CALLERID(num)}" = “BoringCustomerCID”]?55) where line 55 is a voicemail

But here I come to 2 probs:

  1. I would like to have a more elegant way to acomplish this, especially if I want to have two or more CIDs “redirected” (btw, you noticed I don’t use the term “blocked”, it is not professional )
    Is there a way to put al those unwanted numbers in a list or even better in a database and force the sistem to read it from that location?

  2. More serious problem is that every time when I change some settings regarding DID2 but via web interface, it overwrites my extra line and extensions_additional.conf is getting predefined shape, therefore my line is gone.

So, how would you guys solve this problem if you are in my shoes?

I would define an inbound route based on caller ID

What SkykingOH said… make another Inbound Route using the Call Center’s DID and the customer’s CID, then make the destination the voicemail box in question.

And keep yer grubby code out of extensions_additional.conf - that’s not fer mere users like you to touch, and FreePBX will punish you by sending your hard-written code to the system’s black hole! :smiley: Seriously, generally speaking, the only files you’re allowed to add dialplan code to are the ones with “custom” or “override” in the name. Use the GUI, that’s what it’s there for.

As for your question, “Is there a way to put al those unwanted numbers in a list or even better in a database and force the sistem to read it from that location?” - the answer is, yes, if you write the code. This is actually the sort of function that could be accomplished using an AGI that does a database lookup. But, there is nothing like that built into FreePBX, outside of the Inbound Routes, which should actually work quite well for your purpose.

OK guys, much clearer situation. At least I know there is no something built in and most probably would have to get my hands dirty.

Making dedicated inbound route could be temporary solution, but at the moment it reaches 3,4,5…10,50… “boring numbers” the list of so many inbound routes would become to difficult to maintain and the only solution will be xlm, txt file or database.

Thanks a lot.

have a look at the cidroute module available in the contributed_modules directory, it may do what you are looking for. It was developed for ‘massive’ cid routing needs but may be closer to what yo are looking for. (However, from you original explanation of a few abusive users, the inbound routing would seem to be the way to go).