<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">How do you know that the call is a prank call, an not just someone that likes calling your company alot... ?<DIV><BR class="khtml-block-placeholder"></DIV><DIV>If you just want a database of callerid's to block, here is what I have used, I hope it helps some....</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>My SQL table looks has 4 columns id (autoincrement), callerid, blockenabled (to enable or disable the block), and notes.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>[general]</DIV><DIV>realdb_host=localhost</DIV><DIV>realdb_user=asterisk</DIV><DIV>realdb_pass=password</DIV><DIV>realdb_db=asterisk_realtime</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>[pri-in]</DIV><DIV>; Conference Room Number</DIV><DIV>exten =&gt; 193,1,Answer()</DIV><DIV>exten =&gt; 193,2,Macro(checkblacklist,${CALLERID(num)})</DIV><DIV>exten =&gt; 193,3,GoTo(us-conference,s,1)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>[macro-checkblacklist]</DIV><DIV>; This Macro will check the blacklist table to see if the callerid of the</DIV><DIV>; caller exist and blockenabled =1 (TRUE). If the callerid is listed, then</DIV><DIV>; tell the caller they have been blacklisted and politely HangUp()</DIV><DIV>;</DIV><DIV>; ${ARG1} = CallerID of incoming call</DIV><DIV>;</DIV><DIV>exten =&gt; s,1,MYSQL(Connect connid ${realdb_host} ${realdb_user} ${realdb_pass} ${realdb_db})</DIV><DIV>exten =&gt; s,2,MYSQL(Query resultid ${connid} SELECT\ callerid\ from\ blacklist\ where\ callerid=${ARG1} and blockenabled = 1)</DIV><DIV>exten =&gt; s,3,MYSQL(Fetch fetchid ${resultid} blacklistid)</DIV><DIV>exten =&gt; s,4,MYSQL(Clear ${resultid})</DIV><DIV>exten =&gt; s,5,MYSQL(Disconnect ${connid})</DIV><DIV>exten =&gt; s,6,GoToIf($["${blacklistid}" = ""]?7:fail,1)</DIV><DIV>exten =&gt; s,7,NoOp(Not blocked in Blacklist)</DIV><DIV>; If the callerid is listed in the database, then send to blacklistednumber</DIV><DIV>;  context</DIV><DIV>;</DIV><DIV>exten =&gt; fail,1,NoOp(${blacklistid})</DIV><DIV>exten =&gt; fail,2,GoTo(blacklistednumber,s,1)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>[blacklistednumber]</DIV><DIV>; This is where a call will land if the macro-checkblacklist decides that</DIV><DIV>; the number should not be allowed to dial DA</DIV><DIV>exten =&gt; s,1,Wait(2)</DIV><DIV>exten =&gt; s,2,Playback(privacy-you-are-blacklisted)</DIV><DIV>exten =&gt; s,3,HangUp()</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>Forrest Beck</DIV><DIV><A href="mailto:jonforrest.beck@gmail.com">jonforrest.beck@gmail.com</A></DIV><DIV>www.shift8.biz</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR><DIV><DIV>On Oct 18, 2007, at 10:25 AM, Lenz wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">It's not technically complex to do - you can probably use the astdb for <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">that, or store all incoming numbers with timestamp in MySQL and run <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">something like:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">SELECT count(*) &gt; 5 AS blacklisted</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space"> </SPAN>FROM incoming_calls</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">WHERE callerid = "12345"</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">AND timestamp &gt; DATE_SUB( NOW(), INTERVAL 15 MINUTE )</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">you should be very well aware of the risks that can stem from such a <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">program - in case of bugs, or anomalous situations, you might end up <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">blacklisting somebody who actually needs to call in.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I hope this helps</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">l.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On Thu, 18 Oct 2007 15:02:11 +0200, Brian Hutchinson <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&lt;<A href="mailto:b.hutchman@gmail.com">b.hutchman@gmail.com</A>&gt; wrote:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hi,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I've been reading all I can on Google (and Asterisk TFOT book) looking <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">for</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">ideas on how to implement an automated blacklist feature.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I would like to automatically blacklist a incoming number based on <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">timestamp</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">and count information.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">For example, if I get a prank call from the same number 5 times within 15</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">minutes, I want my dialplan to automatically blacklist this number.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Should I be looking at AGI to do something like this?</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Thanks for any ideas or pointers!</DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">--<SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Loway Research - Home of QueueMetrics</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://queuemetrics.com">http://queuemetrics.com</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">--Bandwidth and Colocation Provided by <A href="http://www.api-digital.com--">http://www.api-digital.com--</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">asterisk-users mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">To UNSUBSCRIBE or update options visit:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">   </SPAN><A href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>