[asterisk-users] Manipulating the Blacklist database

Steve Edwards asterisk.org at sedwards.com
Mon May 10 13:47:53 CDT 2010


On Mon, 10 May 2010, Myles Wakeham wrote:

> I am running Asterisk 1.4.2 and recently we changed the SIP provider of 
> our main incoming DID number.  The new provider prefixes all CallerID 
> records with a +1 in front of the number, whereas the previous SIP 
> provider did not.
>
> Consequently now all my blacklisted numbers aren't matching in my 
> Dialplan, so I'm getting tele-spammed.

Probably all those left-leaning weenies that think AZ doesn't have the 
right to remove criminals in the face of a disinterested federal 
government :)

> Is there a way that I can work with the blacklist database like a SQL 
> database, and just apply a script to update all numbers and add the 
> prefix to them if they don't have it already?
>
> Myles
> -- 
> -----------------------------
> Myles Wakeham
> Director of Engineering
> Tech Solutions USA, Inc.
> Scottsdale, Arizona USA
> www.techsolusa.com
> Phone +1-480-451-7440

Off the top of my head...

mysql> create table foo as select * from blacklisted_anis;
mysql> update foo set ani = concat('+1', ani) where ani not like '+1%';
mysql> select * from foo limit 10;

If you like what you see, roll the dice with your production database.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-users mailing list