own-pbx docs

own-pbx

A self-hosted home/hobby phone system. Plain Asterisk 22 does the calling, a small Python service makes every call decision, a clean web panel runs the whole thing, and a separate Kamailio edge box is the only part that faces the internet.

Hobby project — read this first

own-pbx is built and tested as a home/hobby PBX. It is not intended for business, commercial, multi-tenant, carrier or life-safety use, and comes with no warranty. Only tested with VoIP.ms. 911/E911 has NOT been tested end to end — do not rely on this system to call 911. Stripe billing has not been tested with real payments. Published as-is under GPL-2.0-or-later.

What you get

How it fits together

                     Internet
                        │
          TCP 5061 (TLS) + UDP 20000-20099 (SRTP audio)
                        │
                 ┌──────▼───────┐      Router forwards ONLY these to the edge.
                 │  Edge server │      Kamailio (SIP proxy) + rtpengine (audio relay)
                 │ 192.168.1.11 │      fail2ban, flood limit, TLS certificate
                 └──────┬───────┘
                        │  plain SIP/RTP on your LAN
                 ┌──────▼───────┐
  Office phones ─►  PBX server  │      Asterisk 22 (calls, audio, voicemail)
  (UDP 5060)     │ 192.168.1.10 │      pbx-brain  (Python: every call decision)
                 │              │      pbx-agi    (Python: texts)
                 │              │      pbx-api    (Python: web panel, port 8001)
                 └──────────────┘      SQLite database /var/lib/pbx/pbx.db
                        │
                 SIP trunk provider (outbound registration)
  • Asterisk handles the low-level work: SIP, audio, recording, playing sounds. It has almost no dialplan — every call is handed to pbx-brain.
  • pbx-brain decides what happens to every call: who rings, forwarding, voicemail, ring groups, IVR, 911, plans and blocking.
  • pbx-api is the web panel and REST API. It owns the database and rebuilds Asterisk's phone list whenever you change users or trunks.
  • The edge server is optional. Without it the system works fully inside your network; you only need it for phones away from home.

Ports at a glance

WherePortWhatWho can reach it
PBX5060 UDP/TCPSIP for office phones and the edgeyour LAN only
PBX8001 TCPweb panel (admin + My Phone)your LAN (optionally My Phone via tunnel)
PBX8088, 8099, 4573Asterisk API, brain status, text handlerthe PBX itself only
Edge5061 TCPSIP over TLS for outside phonesinternet
Edge20000–20099 UDPcall audio (SRTP)internet

Where to go from here

If you want toStart at
Install itInstallation
Set up phonesPhones & feature codes
Run the system day to dayAdmin panel
Use My Phone on AndroidAndroid app
Text from extensions and DIDsSMS & MMS
Understand the security modelSecurity
Fix something brokenTroubleshooting