<div dir="ltr">I'm a home user (not business), but I implemented a blacklist function too after a harassing call to my wife.<div><br></div><div>Using the Asterisk DB functions, I have a caller ID look-up function before my IVR-tree starts, a simple if then.  Lookup caller ID in blocked-caller DB, if found then I kick them to a short dialplan the plays a message telling them they've been blocked, then lets them record an "appeal" message.  If a user put someone in the Blocked DB, by accident, I'd want to have a way for someone to report it to me via phone.</div><div><br></div><div>To add a number to the Blocked DB, the caller internal user is allowed a hot-key on the phone to block the caller in-call, or with screening they are given an option in the prompt.  When a new number is added to the Blocked DB, the call recording for the session is retained to be able to remember why it was blocked.  The Blocked DB will automatically unblock an entry after a year, to account for number changes, but the entry can be extended before it expires via an email response.</div><div><br></div><div>I did a similar thing for Telemarketers, the phone numbers also automatically unblock, but only after a month, as most of the worst offenders I've come across don't stay with a phone number longer than a few weeks to avoid enforcement by the FTC.  For that I also have a hot key on the phones for "Telemarketer Goodbye", which adds to the DB while playing a "Remove me from your list and stop bothering me" message.  This gives my users a bit of power as they don't have to be polite, or think of an evasion to the sales person, they just need to push a button and hang up the phone when they realize is a sales call.<br></div><div><br></div><div>I didn't want to publish code for this since it's a bit long winded, but it should give you some ideas of things you want to consider.<br></div><div><br></div><div>Best,</div><div><br></div><div>-Tim</div><div><br></div><div><br><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 29, 2016 at 9:20 AM, John Kiniston <span dir="ltr"><<a href="mailto:johnkiniston@gmail.com" target="_blank">johnkiniston@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Here is a quick and dirty bash script to do it that I wrote you.<br><br>#!/bin/bash<br>if ( asterisk -rx "database deltree blacklist")<br>        then<br>                echo "Blacklist Cleared"<br>        else<br>                err "ERROR Failed to clear Blacklist, Exiting."<br>                exit 1;<br>fi<br><br>while IFS=, read TN REASON<br>do<br>if ( asterisk -rx "database put blacklist \"${TN}\" \"${REASON}\"")<br>   then<br>           echo "Inserted $TN $REASON to Blacklist"<br>   else<br>         err "ERROR Insert Failed on $TN."<br>         exit 1;<br>fi<br><br>done < blacklist.csv<br>unset IFS<br><br><br></div>It reads from the file blacklist.csv in the same directory with the format of NUMBER,"DESCRIPTION/REASON"<br><br></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Sat, Aug 27, 2016 at 8:59 AM, tux john <span dir="ltr"><<a href="mailto:atux@null.net" target="_blank">atux@null.net</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">Hi. I would like to blacklist a few callers and I have been using the *CLI> database put blacklist 1234 "annoying callers". Instead of putting the same command for every user is there any way to have a file? Ideally a file in /opt that I would update the blacklisted numbers (add,remove). Is there anything like that, please?<br>

<br></span><span class="">--<br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016<br>
      <a href="http://www.asterisk.org/community/astricon-user-conference" rel="noreferrer" target="_blank">http://www.asterisk.org/commun<wbr>ity/astricon-user-conference</a><br>
<br>
New to Asterisk? Start here:<br>
      <a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/wiki<wbr>/display/AST/Getting+Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/mailm<wbr>an/listinfo/asterisk-users</a><br></span></blockquote></div><span class=""><font color="#888888"><br><br clear="all"><br>-- <br><div data-smartmail="gmail_signature">A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.<br>---Heinlein</div>
</font></span></div>
<br>--<br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016<br>
      <a href="http://www.asterisk.org/community/astricon-user-conference" rel="noreferrer" target="_blank">http://www.asterisk.org/<wbr>community/astricon-user-<wbr>conference</a><br>
<br>
New to Asterisk? Start here:<br>
      <a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/<wbr>wiki/display/AST/Getting+<wbr>Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/<wbr>mailman/listinfo/asterisk-<wbr>users</a><br></blockquote></div><br></div></div></div>