[Asterisk-Users] Blocking the 'Do Not Call" List

Adam Goryachev mailinglists at websitemanagers.com.au
Wed Aug 11 19:37:36 MST 2004


On Thu, 2004-08-12 at 03:35, Steven Critchfield wrote:
> On Wed, 2004-08-11 at 11:32, Chris Shaw wrote:
> > That is a matter of opinion and not in any way factual.... SQL, just as
> > everything else, is as secure as YOU make it... As you said, it's a language
> > for querying relational databases, it has no knowledge of security. That's
> > what firewalls, encryption and strong passwords are for...
> > 
> > However, for the purpose of blocking numbers based on a do-not-call list, it
> > will work perfectly fine. It's lightweight, fast and relatively efficient...
> 
> Of course so is grep on a flat file where you don't need to expend
> memory worring about cache and indexes. Grep also doesn't introduce you
> to outside connections.
> 
> You have no relations, don't use a relational DB just because you don't
> wish to write file routines.

Speaking of which, how about a simple structure of directories, take the
first number for each entry in the dnc, create a directory (dnc/5), then
take the next number (dnc/5/5) and so on. Eventually you get
dnc/5/5/5/1/2/3/4.

When you need to dial the number, you simply check if the directory
exists, if( -d dnc/5/5/5/1/2/3/4)

If it exists, then skip it, if any directory doesn't exist, then call
it.

I am pretty sure that any filesystem should be able to handle 10
directories in a directory, with 10 levels of sub-directory, each with a
maximum of 10 directories.... (How many number do US numbers have??)

Another option would be to just create a file for each full phone number
(dnc/5551234) all in the same directory. Use a filesystem like reiserfs
which does a binary search for the dirents... Well, something like that,
reiserfs seems pretty good to me with a large number of files in a
single directory...

Actually, maybe you should test this yourself before you use the
reiserfs method... (this is my maildir...)
time ls|wc -l
213222

real    0m2.587s
user    0m2.450s
sys     0m0.200s

Although I *think* ls will do a stat on every single file... someone
with more knowledge than me can feel free to comment. At least this
would remove any TCP setup time, plus network dependency etc...

If you have multiple servers, just rsync every hour or whatever...

Just my 0.02c worth...

Regards,
Adam





More information about the asterisk-users mailing list