MCPSERV.CLUB
FreePBX

FreePBX

Self-Hosted

Open source PBX platform powering flexible, feature-rich VoIP solutions

Stale(40)
0stars
0views

Overview

Discover what makes FreePBX powerful

FreePBX is an open‑source, web‑based graphical front‑end for the Asterisk PBX engine. It exposes a RESTful API, PHP‑based modules, and an underlying MySQL database to manage extensions, trunks, IVR menus, call queues, and voicemail. From a developer’s standpoint, FreePBX abstracts the low‑level dialplan syntax of Asterisk into configurable modules while still allowing direct access to the underlying `extensions.conf` and `sip.conf` files for custom logic. The platform is built around a modular architecture, where each feature (e.g., call recording, voicemail‑to‑email) is encapsulated as a PHP module that registers hooks into the Asterisk event bus (AMI).

Modular PHP Framework

RESTful API & AMI Integration

Scribe Integration

Webhooks & Callbacks

Overview

FreePBX is an open‑source, web‑based graphical front‑end for the Asterisk PBX engine. It exposes a RESTful API, PHP‑based modules, and an underlying MySQL database to manage extensions, trunks, IVR menus, call queues, and voicemail. From a developer’s standpoint, FreePBX abstracts the low‑level dialplan syntax of Asterisk into configurable modules while still allowing direct access to the underlying extensions.conf and sip.conf files for custom logic. The platform is built around a modular architecture, where each feature (e.g., call recording, voicemail‑to‑email) is encapsulated as a PHP module that registers hooks into the Asterisk event bus (AMI).

Key Features

  • Modular PHP Framework – Each feature is a standalone module that can be enabled or disabled via the admin UI. Modules expose hooks (pre_execute, post_execute) that developers can override to inject custom PHP logic.
  • RESTful API & AMI Integration – FreePBX provides a freepbxapi endpoint for CRUD operations on extensions, trunks, and queues. Developers can also consume Asterisk’s AMI events (Event: NewChannel, Event: Dial) to build real‑time dashboards or call analytics.
  • Scribe Integration – The bundled Scribe module adds AI transcription to calls and voicemails, exposing WebSocket streams for real‑time speech recognition. The API allows developers to retrieve transcripts via /api/v1/scribe/transcripts.
  • Webhooks & Callbacks – Modules can register custom webhooks that fire on events such as CallEnded or VoicemailReceived, enabling seamless integration with external CRM or ticketing systems.

Technical Stack

LayerTechnology
Web UIPHP 7+, MySQL, jQuery, Bootstrap
Backend LogicFreePBX PHP modules (MVC‑like), Asterisk AMI
Dialplan EngineAsterisk 16+ (C, Lua extensions)
DatabaseMySQL 5.7+/MariaDB for configuration persistence
Optional AI LayerPython/Node.js microservice (Scribe) for transcription

FreePBX’s codebase follows a loosely coupled design: modules register themselves in modules.conf, and the core dispatcher routes HTTP requests to module controllers. Asterisk’s AMI is used for real‑time events, while the cdr database table logs call detail records that can be queried via SQL or exposed through the API.

Deployment & Infrastructure

  • Self‑Hosting – FreePBX runs on any LAMP stack; Docker images are available (freepbx:latest) for quick container deployment. The docker-compose.yml example mounts a persistent volume for /var/www/html/asterisk and /etc/asterisk.
  • Scalability – Horizontal scaling is achieved by running multiple FreePBX instances behind a load balancer (e.g., HAProxy) with shared MySQL replication. Asterisk’s pjsip stack supports thousands of concurrent SIP registrations per node.
  • High Availability – Pairing FreePBX with an Asterisk cluster and using MySQL Galera for synchronous replication ensures zero‑downtime failover.
  • Monitoring – Built‑in freepbx_monitor module exposes Prometheus metrics; integration with Grafana dashboards is common for call traffic analysis.

Integration & Extensibility

  • Module API – Developers can create new modules by extending Base_Module and implementing setup() / remove() hooks. The module skeleton includes templates for database migrations, language files, and UI forms.
  • Event Hooks – The Events class allows subscription to AMI events (on('NewChannel', callback)) or FreePBX internal events (on('module_enable', callback)).
  • Webhooks – Custom endpoints can be registered in webhook.xml and triggered via the core’s WebHook::fire() method.
  • Scribe API – Exposes a WebSocket endpoint (/ws/scribe) for streaming transcription results, and REST endpoints for transcript storage and retrieval.

Developer Experience

  • Documentation – The official FreePBX Wiki provides module development guides, API references, and architectural overviews. The community forum (FreePBX Community) is active for troubleshooting.
  • Testing – Unit tests are written in PHPUnit; the core framework supports stubbing AMI responses for isolated module testing.
  • Community – A large contributor base ensures rapid bug fixes and feature additions. Many third‑party modules (e.g., RingCentral, Twilio) demonstrate integration patterns.

Use Cases

  1. Enterprise Call Center – Deploy FreePBX with custom IVR modules, call queues, and Scribe transcription to feed analytics into a CRM.
  2. VoIP Service Provider – Build a white‑label PBX solution with configurable SIP trunks, auto‑dialer modules, and real‑time monitoring dashboards.
  3. Small Business – Leverage the web UI to manage extensions, voicemail‑to‑email, and integrate with Slack via webhooks for instant notifications.
  4. Educational Institutions – Use the call recording and transcription APIs to archive lectures or support remote learning platforms.

Advantages

  • Open Source & Extensible – No licensing costs; developers can modify core PHP modules or contribute back to the community.
  • Performance – Asterisk’s event‑driven architecture handles high call volumes; FreePBX adds minimal overhead.
  • **Flex

Open SourceReady to get started?

Join the community and start self-hosting FreePBX today