Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a couple of SIP phones and use callcentric. I get a lot of junk calls. I'd like to implement the following feature and would like some suggestions on how to do this:

Once I get a junk call, I typically hang up. I want to dial some number (like *23 or something) and I'd like the last number that was received to be put in a database. Any future call from that number will be directed to VM or a busy tone.

I'd appreciate some pointers on how I'd go about doing this.. I prefer an open source solution.

share|improve this question

We use a phone system called Swyx (which is similar in functionality to Asterisk, but runs on Windows).

As a part of the call route scripts, we can execute external scripts. We just wrote a very small script on our shitlist extension that puts the phone number of the caller into a special table that gets scanned when a call comes in in our automatic call routing script. It then plays a pre-recorded announcement the caller.

I don't know if Asterisk has something similar, but I'm guessing that it should be able to execute an external script as a part of a call route.

share|improve this answer
Thanks for the info Mark. This is a for-home implementation, and would prefer to get an open source solution. Are you able to say how much this would cost for a 2-4 phone system? – Trewq Jul 4 '12 at 1:56
@Trewq - a lot. But like I said, I'm sure that similar concepts apply to Asterisk. I almost guarantee that it will have a way of triggering an external script as a part of a call route. And then you can do whatever you want in that external script. So you have one script on an extension to put them into your shitlist, and then a 2nd script that is run every time a call comes in to check if the phone number is on your shitlist. – Mark Henderson Jul 4 '12 at 2:13
I didn't realise we were allowed to say "shit" on here now. F**k yeah! – womble Jul 4 '12 at 5:36
@womble - there's never been any filtering, just one rule - "be polite" – Mark Henderson Jul 4 '12 at 5:44
@womble ... well .... ok I hadn't ever read that post. Don't really go to meta.stackoverflow. So I shall consider myself schooled. – Mark Henderson Jul 4 '12 at 5:51

First hit for "asterisk blacklist" on the Googletubes sends me to, which suggests that functionality similar to what you're after is built-in. And, in fact, another few seconds of reading brings me to -- which, while it's purportedly out-of-date with regards to current versions of Asterisk, should get you 90+% of the way to your solution.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.