Asterisk: Blacklisting For Multiple Users – June 06, 2009
There are a number of tutorials for people trying to setup blacklisting for their Asterisk server, but they all seem to assume that there is only one user on the server, or at least all users want to share the same blacklist.
Since I host for multiple, unrelated people, they don't necessarily want to share the same blacklist, so I had to come up with a configuration that would work for all customers.
Here are the changes I made (for Asterisk 1.4)
Outgoing dialplan: (custom per user)
Incoming dialplan: (custom per user)
Macros:(shared among all users; I use /etc/asterisk/custom/extensions-default.conf, and have a #include "custom/extensions-*.conf" in the default extensions.conf)
You should replace "<customername>" with the name of the customer, so each customer uses a different database (note you could use the same name for certain customers, if some of them want to share the blacklist, but everyone does not).
Replace <context>, <extension> and <priority> with the appropriate values for where to jump to if a blacklisted number is found. (I find this nicer than the n+100 syntax, particularly since I always use "n" everywhere, rather than actual hard-coded numbers (ah, remember the good old days of basic, where you always numbered your lines: 10, 20, 30, so there was room to add in code later?).
And that's it. You can use "database show" from within the CLI to watch the entries as they are added.
If it isn't clear from the above code and comments:
*32 blacklists the number of the person who called most recently
*31 removes a number from the blacklist (you'll have voice prompts to prompt you to enter and confirm the entry)
*30 adds a number to the blacklist (same voice prompts as with *31)
The only downside of this method is that the *32 requires that there aren't lots of calls per user, so the lastcallerid value is still valid (e.g. if you were at a call center, where you had lots of incoming calls, and didn't have time to dial *32 before the next call came in, you'd have to never use *32, and use *30 and manually enter the number instead).
Comments (rss)
Couldn't verify you're not a robot. Wait a moment and post your comment again.
