You need to block some phone
numbers of callers and avoid unwanted calls or simple ban specific
destinations such as premium-rate phone number on your ScopTEL PBX
? The reason for blocking one or more telephone numbers are numerous and
ScopTEL PBX offers simple solutions to block phone numbers with Blacklist.
It is also possible to have a whitelist to allow only some phone
numbers.
ScopTEL PBX lets you block or whitelist a phone number or
multiple numbers from integrated Incoming Lines CallerID management system.
This article will explain how to use
an SQL table to store 1000's of phone numbers and blacklist some
destinations on Outgoing Lines and then explain how to Blacklist Incoming CallerID's.
Telephony|Configuration|Telephony Modules
To enable Blacklisting your must first Edit Telephony Modules to activate the feature.
Locate and enable CallerID Blacklist and Name Lookup : [x]
Then Save your change.
Outgoing Lines|CallerID Lookup
From the CallerID tab click on Add a new CallerID
Choose the Tenant from the Droplist Selector
Set the Type to "External Source"
Enter a label as in this example 'blacklist'
Set the Source to SQL Table (Local)
Set the Table Name to 'blacklist'
Click on the Add button.
Outgoing Lines|Dial String|Call Restrictions|Restrict Disallowed Outgoing Number
On Lines|Outgoing Lines,
click on the Dial String tab and check the option "Restrict
Disallowed Outgoing Numbers" then select the External Source
(blacklist) you created.
Optional: Use the Droplist Selector to select an Unauthorized Destination (default: Congestion)
Create
SQL table
You must now create an SQL table
that will store all phone numbers that you want to blacklist. Go to Tools|Server and click on SQL Shell menu. You must copy the
following content and click on Execute button to create the SQL table.
SQL QueryCREATE
TABLE blacklist (
phone_number varchar(100),
calleridnum varchar(100),
calleridname varchar(100)
)
ENGINE=MyISAM DEFAULT CHARSET=latin1;
Import
Data
We now need to fill the
blacklist SQL table in the ScopServ database. In this example, we will use a
simple text file that contain a single phone number per line. Create a
file named /tmp/blacklist.txt and define all telephone number to
block.
Sample Data
01230126675
01230312624
01230871502
01236161496
01237627016
01234545454
01237741360
01232780766
01235100042
The following simple shell script
allow read the text file, create SQL INSERT query and execute it on MySQL
scopserv database. If you aren't using default MySQL
settings, you will have to manually adapt the script.
Import Shell Command
#
Specify Source file
SRC="/tmp/blacklist.txt"
#
Destination File
DST="/tmp/blacklist.sql"
#
Set SQL database name (default is scopserv)
SQL="scopserv"
awk
'{ print "INSERT INTO blacklist SET phone_number="" $1
"";" }' $SRC > $DST
cat
$DST | grep -v '""' | mysql $SQL
How to Blacklist Incoming Callers
In some case it is necessary to block Incoming Callers by CallerID.
Here is a simple example that uses an internal database to check Incoming Calls to a specific Incoming Line and reject by CallerID Blacklist.
Go to Lines|CallerID tab
Click on Add a new CallerID
Use the Droplist Selector to set type to Blacklisted List
Give the object a name
Enter numbers and names with a carriage return between each entry
Click Save when done
Incoming Lines|Security
Edit or Add an existing Incoming Line and configure the Security tab
Enable 'Blacklist' lookup? : [x]
Use the Droplist Selector to choose Blacklist: and select the required CallerID|Blacklist
Click Save or Add when done.
Usage
Calls matching this Incoming Line rule will be checked for matching CallerID Number and or Name will be blocked.