BenchSMS

Self-hosted SMS/MMS gateway: an Android phone on a SIM becomes your own Twilio.

ALPHA Products · 9 features · PHP 8.4 / CI4 · Kotlin · Android 8+ · SQLite

overview

BenchSMS turns an Android phone with a SIM into a full SMS/MMS gateway. Client apps POST plain JSON or Twilio-shaped form fields to a CodeIgniter API; the companion Android app polls the outbound queue over the cellular network, sends via the SIM, and pushes inbound texts and MMS straight to your webhooks.

It was built as a drop-in Twilio replacement for TechBench: the generic HTTP provider needs zero code changes, and BenchSMS also serves the real Twilio Messages.json endpoint so even the twilio provider can be repointed at it. The server ships with an embedded admin UI (dashboard, message log, API keys, pairing codes, webhook management with delivery retries), runs on SQLite by default, and installs on Debian 13 in one script, bare-metal or Docker.

features

  • ▸Drop-in Twilio shape -- accepts {to,body} JSON and Twilio form fields at /api/v1/messages and /2010-04-01/Accounts/{x}/Messages.json
  • ▸Outbound queue -- atomic outbox claims, stuck-message reclaim, 24h expiry, multipart + emoji/unicode via SmsManager
  • ▸Inbound SMS + MMS -- default-SMS-app role, MMSC fetch over the MMS APN, media uploaded as attachments
  • ▸Outbound MMS -- composes m-send.req PDUs through the system MMS stack
  • ▸Webhook forwarding -- Twilio field set (From/Body/MessageSid/NumMedia/MediaUrlN) with HMAC signing and 8x backoff retries
  • ▸Admin UI -- device status (battery/signal/online), message log, test send, API keys, pairing codes, webhook test button
  • ▸Phone app -- foreground service, configurable poll interval + batch size, delivery reports, boot restart, battery-optimisation exemption
  • ▸One-command install -- Debian 13 bare-metal (Apache + PHP 8.4) or Docker Compose
  • ▸Single SIM, single phone design -- the phone IS the gateway number

screenshots

Dashboard -- gateway device online with battery and signal
Dashboard -- gateway device online with battery and signal
Messages -- outbound queue states and inbound texts
Messages -- outbound queue states and inbound texts
Android app -- paired device, gateway running, live poll status
Android app -- paired device, gateway running, live poll status
Setup flow -- permissions, default SMS role, pairing, battery exemption
Setup flow -- permissions, default SMS role, pairing, battery exemption
Send -- queue a test SMS or MMS to any number
Send -- queue a test SMS or MMS to any number
Settings -- API keys, pairing codes, webhooks and delivery log
Settings -- API keys, pairing codes, webhooks and delivery log

stack

PHP 8.4 / CI4 Kotlin Android 8+ SQLite Apache Docker

get started

quickstart
$ ./install.sh                  # Debian 13: bare-metal or --docker
$ php spark migrate --all
$ php spark benchsms:deliver    # webhook retry runner (cron)
$ docker compose up -d --build
▊