Skip to content

vaska94/Kamex

Repository files navigation

Kamex SMS Gateway

Version License Platform Docker

Modern, high-performance SMS gateway with built-in admin panel. Supports SMPP, EMI/UCP, HTTP, and GSM modems.

Kamex is a maintained fork of Kannel with new features and active development. Original Kannel code remains under its original license (see LICENSE.kannel). Configuration files are compatible with Kannel.

What's New in Kamex

  • Prometheus Metrics - Native /metrics endpoint for Prometheus/Grafana monitoring
  • Async Logging - Non-blocking logging with dedicated writer thread (~10x throughput)
  • JSON Logs - Structured JSON logging for ELK, Loki, Splunk integration
  • Web Admin Panel - Built-in dashboard at / with real-time monitoring
  • JSON API - Modern /status.json and /api/sendsms endpoints
  • Health Checks - /health endpoint for load balancers and Kubernetes
  • Environment Variables - Use ${VAR} in config for Docker/K8s secrets
  • Redis/Valkey - Native support for DLR and message store
  • Reproducible Builds - Enterprise-grade build verification with SOURCE_DATE_EPOCH
  • SBOM - CycloneDX 1.7 Software Bill of Materials for supply chain compliance
  • Config Validation - bearerbox -t config.conf to validate without starting
  • Alpine Support - Lightweight ~20MB Docker image alongside UBI
  • Removed Legacy - Dropped RADIUS, WAP, libxml2, and dead SMSC protocols

Features

  • Multi-protocol support: SMPP 3.3/3.4/5.0, EMI/UCP, HTTP, AT modems
  • High performance: 16,000+ messages/sec on commodity hardware
  • HTTP API: Simple REST-like interface for sending/receiving SMS
  • Web Admin Panel: Real-time dashboard, SMSC control, message queue viewer
  • Delivery reports: Configurable DLR with multiple storage backends
  • Database support: MySQL, PostgreSQL, SQLite3, Redis/Valkey, Cassandra, Oracle, MSSQL
  • Health check endpoint: /health for load balancers and Kubernetes
  • Prometheus metrics: /metrics endpoint for monitoring with Prometheus/Grafana
  • Config hot-reload: SIGHUP reloads config, adds/removes SMSCs without restart
  • Production ready: Powers SENDER.GE in production

Installation

1. Install Dependencies

RHEL/Rocky/AlmaLinux (EL9+)
sudo dnf install epel-release
sudo crb enable
sudo dnf install gcc make autoconf automake libtool \
    openssl-devel pkgconfig mariadb-devel libpq-devel \
    libsqlite3x-devel hiredis-devel gettext-devel
Fedora
sudo dnf install gcc make autoconf automake libtool \
    openssl-devel pkgconfig mariadb-devel libpq-devel \
    libsqlite3x-devel hiredis-devel gettext-devel
Debian/Ubuntu
sudo apt install build-essential autotools-dev autoconf automake \
    libtool libssl-dev pkg-config \
    libmysqlclient-dev libpq-dev libsqlite3-dev libhiredis-dev
Arch Linux
sudo pacman -S base-devel autoconf automake libtool openssl \
    mariadb-libs postgresql-libs sqlite hiredis

2. Build and Install

autoreconf -fi
./configure --enable-ssl --with-mysql --with-pgsql --with-sqlite3 --with-redis
make
sudo make install-strip
Configure Option Description
--enable-ssl Enable SSL/TLS support
--with-mysql MySQL/MariaDB support
--with-pgsql PostgreSQL support
--with-sqlite3 SQLite3 support
--with-redis Redis/Valkey support
--with-cassandra Cassandra support
--with-oracle Oracle support (requires Instant Client)
--with-mssql MSSQL support (requires FreeTDS)
--enable-reproducible Reproducible builds (auto if SOURCE_DATE_EPOCH set)

3. Configure and Run

# Configure
sudo mkdir -p /etc/kamex
sudo cp doc/examples/kannel.conf /etc/kamex/kamex.conf
# Edit /etc/kamex/kamex.conf with your SMSC details

# Run
bearerbox /etc/kamex/kamex.conf &
smsbox /etc/kamex/kamex.conf &

# Open admin panel
open http://localhost:13000/

# Test SMS sending (classic)
curl "http://localhost:13013/cgi-bin/sendsms?user=tester&pass=foobar&from=Kamex&to=+1234567890&text=Hello"

# Test SMS sending (JSON API)
curl -X POST http://localhost:13013/cgi-bin/sendsms \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-token" \
  -d '{"from":"Kamex","to":"+1234567890","text":"Hello"}'

Admin Panel

Access the built-in admin panel at http://localhost:13000/

  • Dashboard: SMS/DLR traffic, SMSC status, connected boxes
  • Queue: View pending messages in store
  • Send SMS: Test SMS sending
  • Controls: Gateway management (suspend/resume/shutdown)

Use admin-password for full control, status-password for view-only access.

Documentation

Document Description
Configuration Guide Core configuration options
CLI Usage Command-line options, signals, hot-reload
SMS Gateway Setup HTTP API and message routing
SMSC Types Protocol-specific configuration
Delivery Reports DLR storage backends
Logging Async logging architecture
Metrics Prometheus monitoring setup
OpenAPI API specification (Swagger)
Docker Docker deployment guide
Addons Building SQLBox and OpenSMPPBox
Examples Sample configuration files

Supported SMSC Protocols

Protocol Config Description
SMPP smsc = smpp SMPP 3.3, 3.4, 5.0 (industry standard)
EMI/UCP smsc = emi CMG UCP/EMI (European operators)
HTTP smsc = http HTTP-based gateways
AT Modem smsc = at GSM modems via serial/USB

Note: Legacy protocols (CIMD, SMASI, OIS, SEMA, CGW, EMI/X.25) were removed in v1.7.5. These protocols have no active deployments. Use SMPP instead.

Architecture

+--------+     HTTP      +--------+    Internal     +-----------+     SMSC      +------+
|  App   | -----------> | SMSBox | --------------> | BearerBox | ------------> | SMSC |
+--------+   :13013      +--------+    Protocol     +-----------+   Protocol    +------+
                                                          |
                                                    Admin Panel
                                                      :13000
  • BearerBox: Core daemon managing SMSC connections and message routing
  • SMSBox: HTTP interface for applications to send/receive SMS

Performance

Benchmark results (Linux, Intel i5-13500):

Test Throughput Latency
HTTP API ~14,000 req/sec -
SMS/SMPP ~16,000 msg/sec 80ms avg

Run your own benchmarks:

make ssl-certs  # Required for benchmarks
./benchmarks/run-benchmarks benchmarks/bench_http.sh benchmarks/bench_sms.sh

Docker

Image Base Size
ghcr.io/vaska94/kamex:latest UBI 10 ~150MB
ghcr.io/vaska94/kamex:alpine Alpine ~20MB
mkdir kamex && cd kamex
# Create docker-compose.yml and kamex.conf (see doc/docker.md)
docker compose up -d

See Docker Guide for full setup with Valkey for DLR storage.

systemd Integration

# Install systemd service files
sudo ./contrib/systemd/setup-kamex-user.sh
sudo systemctl enable kamex-bearerbox kamex-smsbox
sudo systemctl start kamex-bearerbox kamex-smsbox

Reproducible Builds

Kamex supports reproducible builds for enterprise verification and compliance.

# Build with fixed timestamp from git commit
export SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)
autoreconf -fi
./configure --enable-ssl --with-redis
make

# Verify reproducibility - all binaries have identical hashes
sha256sum gw/.libs/bearerbox gw/.libs/smsbox gwlib/.libs/libgwlib.so

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: make check
  5. Submit a pull request

License

Kamex is dual-licensed:

  • New code: MIT License (see LICENSE)
  • Original Kannel code: Kannel Software License 1.0 (see LICENSE.kannel)

Links

About

Open source SMS gateway (SMPP, EMI/UCP, HTTP, and GSM) - modernized fork of Kannel with WAP removed, works on RHEL 9+

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE.kannel

Stars

Watchers

Forks

Packages

 
 
 

Contributors