A comprehensive, feature-rich Private Branch Exchange (PBX) and VoIP system built from scratch in Python
- COMPLETE_GUIDE.md - Comprehensive documentation covering installation, deployment, features, integrations, security, troubleshooting, and API reference
- TROUBLESHOOTING.md - Troubleshooting guide for administrators with solutions to all known issues
- docs/ - Operational guides (deployment, HA, incident response, capacity planning, reverse proxy)
- docs/reference/ - Technical reference (SIP implementation, phone book API, framework features)
- SIP Protocol - Full SIP implementation with TLS/SIPS support
- RTP Media - Real-time audio streaming with multi-codec support (G.711, G.722, G.729, Opus, and more)
- Extension Management - User registration, authentication, and directory
- Call Routing - Intelligent routing based on dialplan rules
- Call Management - Hold, resume, blind/attended transfer, and forward
- Auto Attendant (IVR) - Automated menus with DTMF navigation
- Call Recording - Compliance and quality assurance recording
- Call Queues (ACD) - Automatic Call Distribution with multiple strategies and skills-based routing
- Conference Calling - Multi-party conference rooms
- Call Parking - Park and retrieve calls from any extension
- Music on Hold - Customizable hold music
- Voicemail - Full-featured with email notifications, greeting recording, and transcription (Vosk)
- CDR - Comprehensive call detail records and statistics
- IP Phone Provisioning - Auto-configuration for Zultys, Yealink, Polycom, Cisco, Grandstream
- ATA Support - Grandstream HT801/HT802, Cisco SPA112/SPA122/ATA191/ATA192 (see docs/ATA_SUPPORT_GUIDE.md)
- Phone Book - Centralized directory with AD sync, pushed to phones (Yealink XML, Cisco XML)
- BLF Monitoring - Real-time busy lamp field status
- Paging System - SIP/RTP overhead paging with zone support
- Jitsi Meet - Video conferencing (free Zoom alternative)
- Matrix/Element - Team messaging (free Slack/Teams alternative)
- EspoCRM - CRM with screen pop & call logging (free Salesforce alternative)
- Vosk - Offline speech recognition for voicemail transcription
- Zoom - Meeting creation from PBX (optional, proprietary)
- Active Directory - LDAP authentication and directory sync
- Microsoft Outlook - Calendar and contact integration
- Microsoft Teams - Presence sync and meeting escalation
- Webhook System - Event-driven HTTP notifications with HMAC signatures
- Conversational AI - Natural language IVR with multi-provider support (OpenAI, Google Dialogflow, Amazon Lex, Azure LUIS) and local NLTK fallback
- Predictive Dialing - Outbound campaign management with four dialing modes (preview, progressive, predictive, power) and Erlang-C pacing algorithms
- Predictive Voicemail Drop - Answering machine detection using energy analysis, beep frequency validation, and silence-ratio heuristics with automated RTP message playback
- Video Conferencing - WebRTC-based video rooms with SDP offer/answer negotiation, ICE candidate relay, screen sharing, and multi-codec support (VP8, VP9, H.264)
- FIPS 140-2 Compliant - Government-grade encryption (AES-256, SHA-256, PBKDF2)
- TLS 1.3 / SIPS / SRTP - Encrypted signaling and media
- In-House CA - Automatic certificate requests from enterprise CA
- Password Security - PBKDF2-HMAC-SHA256 with 600,000 iterations
- Rate Limiting & IP Banning - Brute force protection
- E911 Compliance - Ray Baum's Act dispatchable location support
- Web Admin Panel - Modern browser-based management with MFA support
- Python 3.13+
- Node.js 22+ (for frontend admin interface)
- PyYAML, cryptography>=46.0.5
- Network access for SIP (5060/udp) and RTP (10000-20000/udp) ports
git clone https://github.com/mattiIce/PBX.git
cd PBX
sudo python3 scripts/setup_ubuntu.pyThe wizard installs dependencies, sets up PostgreSQL, generates SSL certificates, creates voice prompts, and initializes the database. See COMPLETE_GUIDE.md - Section 1 for details.
git clone https://github.com/mattiIce/PBX.git
cd PBX
# Install dependencies (requires uv: https://docs.astral.sh/uv/)
make install # Development mode
# Or: make install-prod # Production only
# Install frontend dependencies
npm install
# Set up environment
python scripts/setup_env.py
# Generate SSL certificate
python scripts/generate_ssl_cert.py --hostname YOUR_IP_OR_HOSTNAME
# Configure and start
nano config.yml
python main.pyThe PBX starts on:
- SIP: UDP port 5060
- RTP Media: UDP ports 10000-20000
- REST API / Admin Panel: HTTPS port 9000
See COMPLETE_GUIDE.md - Section 1.3 for database and environment setup.
git clone https://github.com/mattiIce/PBX.git
cd PBX
sudo bash scripts/deploy_production_pilot.sh
# Or dry-run first: sudo bash scripts/deploy_production_pilot.sh --dry-runThe script configures PostgreSQL, Python venv, Nginx reverse proxy, UFW firewall, daily backups, monitoring (Prometheus), and systemd service.
After deployment: See COMPLETE_GUIDE.md - Section 2.2 for post-deployment steps (database password, SSL, voice prompts).
# Nginx (recommended)
sudo scripts/setup_reverse_proxy.sh
# Apache (alternative)
sudo scripts/setup_apache_reverse_proxy.shSee COMPLETE_GUIDE.md - Section 2.4 or docs/APACHE_REVERSE_PROXY_SETUP.md.
Access at https://localhost:9000/admin/ for system management.
| Pattern | Destination | Example |
|---|---|---|
0 |
Auto attendant | Dial 0 |
1xxx |
Internal extensions | Dial 1002 |
2xxx |
Conference rooms | Dial 2001 |
7x |
Call parking slots | Dial 70 |
8xxx |
Call queues | Dial 8001 |
*xxx |
Voicemail access | Dial *1001 |
curl http://localhost:9000/api/status # System status
curl http://localhost:9000/api/extensions # List extensions
curl http://localhost:9000/api/calls # Active calls
curl http://localhost:9000/api/analytics/advanced # Call records
curl http://localhost:9000/api/config # ConfigurationSee COMPLETE_GUIDE.md - Section 9.2 for full API reference.
- System logs:
logs/pbx.log(configurable level inconfig.yml) - CDR files:
cdr/cdr_YYYY-MM-DD.jsonl - API endpoints:
/api/analytics/advanced,/api/statistics - Grafana dashboards: See grafana/dashboards/
make check # Run all checks (format + lint + test)
make test # All tests (225 test files, Python + JavaScript)
make lint # ruff check + mypy
make dev # Start backend + frontend dev serversThe project includes 76 feature modules, 226 test files, and 18 admin panel pages. See CLAUDE.md for full development reference.
- Admin panel after updates: If the panel doesn't display correctly, press
Ctrl+Shift+Rto force refresh cached files.
See TROUBLESHOOTING.md for comprehensive troubleshooting.
MIT License - see LICENSE.
For issues and questions, open a GitHub issue.
Built for robust in-house communication systems



