I'm a home user (not business), but I implemented a blacklist function too
after a harassing call to my wife.
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.
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.
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.
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.
Best,
-Tim
On Mon, Aug 29, 2016 at 9:20 AM, John Kiniston <johnkiniston at gmail.com>
wrote:
> Here is a quick and dirty bash script to do it that I wrote you.
>
> #!/bin/bash
> if ( asterisk -rx "database deltree blacklist")
> then
> echo "Blacklist Cleared"
> else
> err "ERROR Failed to clear Blacklist, Exiting."
> exit 1;
> fi
>
> while IFS=, read TN REASON
> do
> if ( asterisk -rx "database put blacklist \"${TN}\"
\"${REASON}\"")
> then
> echo "Inserted $TN $REASON to Blacklist"
> else
> err "ERROR Insert Failed on $TN."
> exit 1;
> fi
>
> done < blacklist.csv
> unset IFS
>
>
> It reads from the file blacklist.csv in the same directory with the format
> of NUMBER,"DESCRIPTION/REASON"
>
>
> On Sat, Aug 27, 2016 at 8:59 AM, tux john <atux at null.net> wrote:
>
>> 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?
>>
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
>> http://www.asterisk.org/community/astricon-user-conference
>>
>> New to Asterisk? Start here:
>> https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
>
>
> --
> 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.
> ---Heinlein
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
> http://www.asterisk.org/community/astricon-user-conference
>
> New to Asterisk? Start here:
> https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.digium.com/pipermail/asterisk-users/attachments/20160829/a653c3b0/attachment.html>