Introduction
   

As for ripping the name of another sourceforge project, I'm sorry.

 

Requirements
 
My configuration
  And the story behind callblocker.  I needed to block phone calls from a specific phone number based on the caller ID.  I looked around, but the solutions seemed to be about $100, so I decided to make my own (for more than $100).  Some of the features I wanted were:
  • Allow most numbers, but have the ability to block most of an area code
  • Easy to configure- people with less technical experience might want to change the blocking rules
  • Connect to the internet for remote administration
  • More complex interaction with hardware

I already had a Soekris net4501 around, so I designed my box around it.  It has room for a low profile 3.3V PCI card.  These requirements were somewhat strict, so I went with the first card I could find at a reasonable price, the AOpen FM56 PLX.  Although the Linuxant demo drivers only allow 14.4kbs connections, this is acceptable for an interactive SSH connection.

With hardware on hand, I used sample caller ID code from Device::Modem to start writing callblocker.  I quickly learned that the information is transmitted after the first ring.  After seeing that everything would work in theory, I began writing the callblocker parsers.

The hardest and not yet complete part was determining how to deal with blocking.  There are a few approaches:

  • Quickly pick up the phone, then hang it up
  • Pick up the phone and act as a fax machine

My attempts at the former were unsuccessful.  I tried three approaches: ATA+++H, ATH1 ATH0, and voice mode.  The latter failed because either my modem or the drivers didn't support voice mode.  The first approach tries to establish a connection.  Setting register S7 to 1 sec reduces the time until hangup, but hangup still takes some time to complete.  The second approach picks also takes too long to hang up.  \

Sidenote: I recently read that AT! does what I want, but I haven't investigated it yet.

As this was needed quickly, I decided hearing an annoying fax machine like sound would be close enough to blocking the call.  One additional option was to use the general purpose IO on the net4501 (Linux drivers) to control a relay that can disconnect a connected phone from the line.  The wiring would be very simple, as would the implementation.

 

Getting callblocker
  Releases:

Currently, only source and a Debian package are available.

CVS:

The following commands will fetch the latest version of callblocker.  (releases should be more stable)

cvs -d:pserver:anonymous@call-blocker.cvs.sourceforge.net:/cvsroot/call-blocker login
 
cvs -z3 -d:pserver:anonymous@call-blocker.cvs.sourceforge.net:/cvsroot/call-blocker co -P callblocker

 

Configuring callblocker
  Currently, behavior on calls is set in the actual script.

Actual blocking in done in the config file /etc/callblocker.rules

# There are two types of lines: accept and reject. The last matching line is used.

# A default accept policy
accept ..........

# Reject a phone number
reject 1234567890


# Reject an area code
# * reject 999.......

# Whitelist some numbers within that area code
# * accept 9998888888

 What follows accept or reject is actually a perl regular expression (although, only [\d.]{9} is allowed).  Currently, it is in the user friendly mode.  The advanced mode will allow matching the entire caller ID string with a regular expression.

 

Todo:
 
  • Create country profiles
  • Allow simple or advanced call matching (simple, user friendly regular expressions or standard regular expressions)
  • Add configuration file support

 

   

David Ehrmann

<david <a@t> exitrow <d@t> org>SourceForge Logo