Re: [asterisk-users] Automating blacklists

2007-10-18 Thread Steve Murphy
On Thu, 2007-10-18 at 16:02 +0300, Brian Hutchinson wrote:
> Hi,
> 
> I've been reading all I can on Google (and Asterisk TFOT book) looking
> for ideas on how to implement an automated blacklist feature.
> 
> I would like to automatically blacklist a incoming number based on
> timestamp and count information. 
> 
> For example, if I get a prank call from the same number 5 times within
> 15 minutes, I want my dialplan to automatically blacklist this number.
> 
> Should I be looking at AGI to do something like this?
> 
> Thanks for any ideas or pointers! 

I hate telemarketers.

And at ***least*** one calls every day.

But I rarely have to talk to them.

Using AstDB, and dialplan programming in AEL, I have implemented some
measures
that cut the number of telemarketers who "make it through" to only maybe
1 per year.

All my stuff is in AEL. Along this line, my home phone system records
all CID's coming in, and counts each incoming call for each CID.
Telemarketer autodialers tend to call in without any CID. So, I play
anonymous callers the telezapper tri-tones. It's kinda irritating to
callers to get this, so I only play it to eligible callers. Autodialers
usually immediately hang up, and because they usually interpret
tri-tones as "wrong number", they remove me from their db, and I don't
hear from them again... But there is a growing number of telemarketers
who actually supply some sort of CID info for the call. I count how many
times they call, but get filtered out. After I get the same party
calling in 4 times or more in row, that don't actually end up talking to
anyone, I start playing them the tri-tones. That usually is the end of
that sequence.

All this is done with simple dialplan statements and the use of AstDB
(see the DB() function).

I also whitelist, and route certain callers directly to particular
extensions, bypassing all filters.

I also have DB entries that will override the default MOH for some
callers, based either on CID, or who they are calling. For instance, one
of my sons preferred his callers got rock music instead of the normal
elevator stuff.

Also available to those who prefer not to be bothered continuously by
charity seekers, political pollsters, long-distance dialing hawkers,
septic-tank bacteria salesmen, etc, are the privacy related options to
the Dial() app. You can do call screening, and route unwanted incoming
calls to voicemail. Might even help with debt collectors, etc.


murf



-- 
Steve Murphy
Software Developer
Digium


smime.p7s
Description: S/MIME cryptographic signature
___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Automating blacklists

2007-10-18 Thread Tilghman Lesher
On Thursday 18 October 2007 09:49:48 Brian Hutchinson wrote:
> I feel more comfortable with MySQL ... just need to learn how to get the
> dialplan to use it.

See func_odbc.conf.

-- 
Tilghman

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Automating blacklists

2007-10-18 Thread Lenz

Yeah I would use MySQL as well for more or less the same reasons. Using  
MySQL right from the dialplan is not very elegant but it's pretty simple -  
see http://www.voip-info.org/tiki-index.php?page=Asterisk%20cmd%20MYSQL
Thanks
l.



On Thu, 18 Oct 2007 16:49:48 +0200, Brian Hutchinson  
<[EMAIL PROTECTED]> wrote:

> I feel more comfortable with MySQL ... just need to learn how to get the
> dialplan to use it.
>
> Also figure out the pro's/con's to MySQL vs AstDB.  If I used MySQL then  
> I
> could put myphpadmin and get a pseudo GUI to manipulate the blacklist
> database for almost no effort so that is another reason for leaning  
> towards
> MySQL.
>
> Thanks for the nudge toward MySQL.
>
>
> On 10/18/07, Lenz <[EMAIL PROTECTED]> wrote:
>>
>>
>> It's not technically complex to do - you can probably use the astdb for
>> that, or store all incoming numbers with timestamp in MySQL and run
>> something like:
>>
>> SELECT count(*) > 5 AS blacklisted
>> FROM incoming_calls
>> WHERE callerid = "12345"
>> AND timestamp > DATE_SUB( NOW(), INTERVAL 15 MINUTE )
>>
>> you should be very well aware of the risks that can stem from such a
>> program - in case of bugs, or anomalous situations, you might end up
>> blacklisting somebody who actually needs to call in.
>>
>> I hope this helps
>> l.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Thu, 18 Oct 2007 15:02:11 +0200, Brian Hutchinson
>> <[EMAIL PROTECTED]> wrote:
>>
>> > Hi,
>> >
>> > I've been reading all I can on Google (and Asterisk TFOT book) looking
>> > for
>> > ideas on how to implement an automated blacklist feature.
>> >
>> > I would like to automatically blacklist a incoming number based on
>> > timestamp
>> > and count information.
>> >
>> > For example, if I get a prank call from the same number 5 times within
>> 15
>> > minutes, I want my dialplan to automatically blacklist this number.
>> >
>> > Should I be looking at AGI to do something like this?
>> >
>> > Thanks for any ideas or pointers!
>>
>>
>>
>> --
>> Loway Research - Home of QueueMetrics
>> http://queuemetrics.com
>>
>> ___
>> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>http://lists.digium.com/mailman/listinfo/asterisk-users
>>



-- 
Loway Research - Home of QueueMetrics
http://queuemetrics.com

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Automating blacklists

2007-10-18 Thread Forrest Beck
How do you know that the call is a prank call, an not just someone  
that likes calling your company alot... ?


If you just want a database of callerid's to block, here is what I  
have used, I hope it helps some


My SQL table looks has 4 columns id (autoincrement), callerid,  
blockenabled (to enable or disable the block), and notes.


[general]
realdb_host=localhost
realdb_user=asterisk
realdb_pass=password
realdb_db=asterisk_realtime

[pri-in]
; Conference Room Number
exten => 193,1,Answer()
exten => 193,2,Macro(checkblacklist,${CALLERID(num)})
exten => 193,3,GoTo(us-conference,s,1)

[macro-checkblacklist]
; This Macro will check the blacklist table to see if the callerid of  
the
; caller exist and blockenabled =1 (TRUE). If the callerid is listed,  
then

; tell the caller they have been blacklisted and politely HangUp()
;
; ${ARG1} = CallerID of incoming call
;
exten => s,1,MYSQL(Connect connid ${realdb_host} ${realdb_user} $ 
{realdb_pass} ${realdb_db})
exten => s,2,MYSQL(Query resultid ${connid} SELECT\ callerid\ from\  
blacklist\ where\ callerid=${ARG1} and blockenabled = 1)

exten => s,3,MYSQL(Fetch fetchid ${resultid} blacklistid)
exten => s,4,MYSQL(Clear ${resultid})
exten => s,5,MYSQL(Disconnect ${connid})
exten => s,6,GoToIf($["${blacklistid}" = ""]?7:fail,1)
exten => s,7,NoOp(Not blocked in Blacklist)
; If the callerid is listed in the database, then send to  
blacklistednumber

;  context
;
exten => fail,1,NoOp(${blacklistid})
exten => fail,2,GoTo(blacklistednumber,s,1)

[blacklistednumber]
; This is where a call will land if the macro-checkblacklist decides  
that

; the number should not be allowed to dial DA
exten => s,1,Wait(2)
exten => s,2,Playback(privacy-you-are-blacklisted)
exten => s,3,HangUp()


Forrest Beck
[EMAIL PROTECTED]
www.shift8.biz



On Oct 18, 2007, at 10:25 AM, Lenz wrote:



It's not technically complex to do - you can probably use the astdb  
for

that, or store all incoming numbers with timestamp in MySQL and run
something like:

SELECT count(*) > 5 AS blacklisted
 FROM incoming_calls
WHERE callerid = "12345"
AND timestamp > DATE_SUB( NOW(), INTERVAL 15 MINUTE )

you should be very well aware of the risks that can stem from such a
program - in case of bugs, or anomalous situations, you might end up
blacklisting somebody who actually needs to call in.

I hope this helps
l.










On Thu, 18 Oct 2007 15:02:11 +0200, Brian Hutchinson
<[EMAIL PROTECTED]> wrote:


Hi,

I've been reading all I can on Google (and Asterisk TFOT book)  
looking

for
ideas on how to implement an automated blacklist feature.

I would like to automatically blacklist a incoming number based on
timestamp
and count information.

For example, if I get a prank call from the same number 5 times  
within 15

minutes, I want my dialplan to automatically blacklist this number.

Should I be looking at AGI to do something like this?

Thanks for any ideas or pointers!




--
Loway Research - Home of QueueMetrics
http://queuemetrics.com

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Automating blacklists

2007-10-18 Thread Brian Hutchinson
I feel more comfortable with MySQL ... just need to learn how to get the
dialplan to use it.

Also figure out the pro's/con's to MySQL vs AstDB.  If I used MySQL then I
could put myphpadmin and get a pseudo GUI to manipulate the blacklist
database for almost no effort so that is another reason for leaning towards
MySQL.

Thanks for the nudge toward MySQL.


On 10/18/07, Lenz <[EMAIL PROTECTED]> wrote:
>
>
> It's not technically complex to do - you can probably use the astdb for
> that, or store all incoming numbers with timestamp in MySQL and run
> something like:
>
> SELECT count(*) > 5 AS blacklisted
> FROM incoming_calls
> WHERE callerid = "12345"
> AND timestamp > DATE_SUB( NOW(), INTERVAL 15 MINUTE )
>
> you should be very well aware of the risks that can stem from such a
> program - in case of bugs, or anomalous situations, you might end up
> blacklisting somebody who actually needs to call in.
>
> I hope this helps
> l.
>
>
>
>
>
>
>
>
>
>
> On Thu, 18 Oct 2007 15:02:11 +0200, Brian Hutchinson
> <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > I've been reading all I can on Google (and Asterisk TFOT book) looking
> > for
> > ideas on how to implement an automated blacklist feature.
> >
> > I would like to automatically blacklist a incoming number based on
> > timestamp
> > and count information.
> >
> > For example, if I get a prank call from the same number 5 times within
> 15
> > minutes, I want my dialplan to automatically blacklist this number.
> >
> > Should I be looking at AGI to do something like this?
> >
> > Thanks for any ideas or pointers!
>
>
>
> --
> Loway Research - Home of QueueMetrics
> http://queuemetrics.com
>
> ___
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Automating blacklists

2007-10-18 Thread Lenz

It's not technically complex to do - you can probably use the astdb for  
that, or store all incoming numbers with timestamp in MySQL and run  
something like:

SELECT count(*) > 5 AS blacklisted
 FROM incoming_calls
WHERE callerid = "12345"
AND timestamp > DATE_SUB( NOW(), INTERVAL 15 MINUTE )

you should be very well aware of the risks that can stem from such a  
program - in case of bugs, or anomalous situations, you might end up  
blacklisting somebody who actually needs to call in.

I hope this helps
l.










On Thu, 18 Oct 2007 15:02:11 +0200, Brian Hutchinson  
<[EMAIL PROTECTED]> wrote:

> Hi,
>
> I've been reading all I can on Google (and Asterisk TFOT book) looking  
> for
> ideas on how to implement an automated blacklist feature.
>
> I would like to automatically blacklist a incoming number based on  
> timestamp
> and count information.
>
> For example, if I get a prank call from the same number 5 times within 15
> minutes, I want my dialplan to automatically blacklist this number.
>
> Should I be looking at AGI to do something like this?
>
> Thanks for any ideas or pointers!



-- 
Loway Research - Home of QueueMetrics
http://queuemetrics.com

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Automating blacklists

2007-10-18 Thread Jared Smith
On Thu, 2007-10-18 at 16:51 +0300, Brian Hutchinson wrote:
> Is there a function to write the timestamp of the first call?

You can use the built-in channel variable ${EPOCH}, which will give you
the current time in Unix timestamp format (number of seconds since Jan
1, 1970).  Then you can do something like:

exten => 123,n,Set(DB(myblacklist/${CALLERID(num)}/lastcall)=${EPOCH}))

This obviously doesn't solve the entire problem for you, but should at
least help you get moving in the right direction.

-- 
Jared Smith
Community Relations Manager
Digium, Inc.


___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Automating blacklists

2007-10-18 Thread Brian Hutchinson
Is there a function to write the timestamp of the first call?  I started
thinking about AGI and PHP/MySQL since that is what I'm familiar with.  I
couldn't find methods to write timestamp info to AstDB or if I could ... how
to read it back and compare it to "time now" to decide to increment my
counter and have the dial plan decide to allow the call or not.

On 10/18/07, Jared Smith <[EMAIL PROTECTED]> wrote:
>
> On Thu, 2007-10-18 at 16:02 +0300, Brian Hutchinson wrote:
> > I would like to automatically blacklist a incoming number based on
> > timestamp and count information.
> >
> > For example, if I get a prank call from the same number 5 times within
> > 15 minutes, I want my dialplan to automatically blacklist this number.
> >
> > Should I be looking at AGI to do something like this?
>
> You could do it with an AGI, or with dialplan logic and the AstDB
> database.  If you use the AstDB database to store blacklisted numbers,
> you can also use the BLACKLIST dialplan function to check to see if a
> given number is blacklisted or not.
>
>
> --
> Jared Smith
> Community Relations Manager
> Digium, Inc.
>
>
> ___
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Automating blacklists

2007-10-18 Thread Jared Smith
On Thu, 2007-10-18 at 16:02 +0300, Brian Hutchinson wrote:
> I would like to automatically blacklist a incoming number based on
> timestamp and count information. 
> 
> For example, if I get a prank call from the same number 5 times within
> 15 minutes, I want my dialplan to automatically blacklist this number.
> 
> Should I be looking at AGI to do something like this?

You could do it with an AGI, or with dialplan logic and the AstDB
database.  If you use the AstDB database to store blacklisted numbers,
you can also use the BLACKLIST dialplan function to check to see if a
given number is blacklisted or not.


-- 
Jared Smith
Community Relations Manager
Digium, Inc.


___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Automating blacklists

2007-10-18 Thread Brian Hutchinson
Hi,

I've been reading all I can on Google (and Asterisk TFOT book) looking for
ideas on how to implement an automated blacklist feature.

I would like to automatically blacklist a incoming number based on timestamp
and count information.

For example, if I get a prank call from the same number 5 times within 15
minutes, I want my dialplan to automatically blacklist this number.

Should I be looking at AGI to do something like this?

Thanks for any ideas or pointers!
___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users