SentryPeer is basically a fraud detection tool. It lets bad actors try to make phone calls and saves the IP address they came from and number they tried to call. Those details are then used to block them at the service providers network and the next time a user/customer tries to call a collected number, it’s blocked.

Traditionally this data is shipped to a central place, so you don’t own the data you’ve collected. This project is all about Peer to Peer sharing of that data. The user owning the data and various Service Provider / Network Provider related feeds of the data is the key bit for me. I’m sick of all the services out there that keep it and sell it. If you’ve collected it, you should have the choice to keep it and/or opt in to share it with other SentryPeer community members via p2p methods.

The sharing part…you only get other users’ data if you share yours. That’s the key. It could be used (the sharing of data logic/feature) in many projects too if I get it right.


Here’s a mockup of the web UI which is subject to change.


  •  All code Free/Libre and Open Source Software
  •  FAST
  •  User owns their data
  •  User can submit their own data if they want to – opt out (default is to submit data)
  •  User gets other users’ data (Tit for tat?) ONLY IF they opt in to submit their data to the pool (DHT? – need to do a PoC)
  •  Embedded Distributed Hash Table (DHT) node using OpenDHT (-p cli option)
  •  Peer to Peer sharing of collected bad_actors using OpenDHT (default on)
  •  Peer to Peer data replication to receive collected bad_actors using OpenDHT (default on)
  •  Multithreaded
  •  UDP transport
  •  TCP transport
  •  TLS transport
  •  JSON logging to a file
  •  Data is max 7(?) days old as useless otherwise
  •  SIP mode can be disabled. This allows you to run SentryPeer in API mode or DHT mode only etc. i.e. not as a honeypot, but as a node in the SentryPeer community or to just serve replicated data
  •  SIP responsive mode can be enabled to collect data – cli / env flag
  •  Local data copy for fast access – cli / env db location flag
  •  Local API for fast access – cli / env flag
  •  Local Web GUI for fast access – cli / env flag
  •  Query API for IP addresses of bad actors
  •  Query API for IPSET of bad actors
  •  Query API for a particular IP address of a bad actor
  •  Query API for attempted phone numbers called by bad actors
  •  Query API for an attempted phone number called by a bad actor
  •  Fail2Ban support via syslog as per feature request
  •  Local sqlite database – feature / cli flag
  •  Analytics – opt in
  •  SDKs/libs for external access – CGRateS to start with or our own firewall with nftables
  •  Small binary size for IoT usage
  •  Cross-platform
  •  Firewall options to use distributed data in real time – DHT?
  •  Container on Docker Hub for latest build
  •  BGP agent to peer with for blackholing collected IP addresses (similar to Team Cymru Bogon Router Server Project)
  •  SIP agent to return 404 or default destination for SIP redirects



I started this because I wanted to do C network programming as all the projects I use daily are in C like PostgreSQL, OpenLDAP, FreeSWITCH, OpenSIPS, Asterisk etc. See Episode 414: Jens Gustedt on Modern C for why C is a good choice. For those interested, see my full podcast show list ( for Software Engineering Radio


  • TADSummit 2021 –
  • CommCon 2021 –


You can run the latest version of SentryPeer with Docker. The latest version is available from Docker Hub. Or build yourself:

sudo docker build -t sentrypeer .
sudo docker run -d -p 5060:5060 -p 8082:8082 sentrypeer:latest

Then you can check at http://localhost:8082/ip-addresses and http://localhost:5060/health-check to see if it’s running.

Environment Variables

ENV SENTRYPEER_DB_FILE=/my/location/sentrypeer.db
ENV SENTRYPEER_JSON_LOG_FILE=/my/location/sentrypeer_json.log

Either set these in the Dockerfile or in your Dockerfile.env file or docker run command.


Debian or Fedora packages are always available from the release page for the current version of SentryPeer:

Ubuntu Package

You can install SentryPeer from our Ubuntu PPD which is currently for Ubuntu 20 LTS (Focal Fossa):

sudo add-apt-repository ppa:gavinhenry/sentrypeer
sudo apt-get update

This PPA can be added to your system manually by copying the lines below and adding them to your system’s software sources:

deb focal main
deb-src focal main

Building from source

You have two options for installation from source. CMake or autotools. Autotools is recommended at the moment. A release is an autotools build.

If you are a Fedora user, you can install this via Fedora copr:

If you are going to build from this repository, you will need to have the following installed:

  • gitautoconfautomake and autoconf-archive (Debian/Ubuntu)
  • libosip2-dev (Debian/Ubuntu) or libosip2-devel (Fedora)
  • libsqlite3-dev (Debian/Ubuntu) or sqlite-devel (Fedora)
  • uuid-dev (Debian/Ubuntu) or libuuid-devel (Fedora)
  • libmicrohttpd-dev (Debian/Ubuntu) or libmicrohttpd-devel (Fedora)
  • libjansson-dev (Debian/Ubuntu) or jansson-devel (Fedora)
  • libpcre2-dev (Debian/Ubuntu) or pcre2-devel (Fedora)
  • libcurl-dev (Debian/Ubuntu) or libcurl-devel (Fedora)
  • libcmocka-dev (Debian/Ubuntu) or libcmocka-devel (Fedora) – for unit tests


sudo apt-get install git build-essential autoconf-archive autoconf automake libosip2-dev libsqlite3-dev \
libcmocka-dev uuid-dev libcurl-dev libpcre2-dev libjansson-dev libmicrohttpd-dev


sudo dnf install git autoconf automake autoconf-archive libosip2-devel libsqlite3-devel libcmocka-devel \
libuuid-devel libmicrohttpd-devel jansson-devel libcurl-devel pcre2-devel

Leave a comment

Your email address will not be published. Required fields are marked *