Open-source PBX on Asterisk with a PHP/Phalcon web GUI. Ground truth for versions is
composer.json (PHP ^8.4, ext-phalcon ^5.9.3, PHPUnit ^9, PHPStan ^2). Runtime targets a
single container (Docker or LXC) bundling PHP, SQLite, Redis, Beanstalkd, Asterisk, Nginx.
Related repos: mikopbx/DevelopementDocs (developer docs), mikopbx/ModuleTemplate.
Nested AGENTS.md files in src/*/, tests/*/ and
sites/admin-cabinet/assets/js/src/SystemDiagnostic/ hold subsystem detail; read the one
for the subtree you touch. Keep this file repo-wide only.
- Import
use Phalcon\Di\Di;(neveruse Phalcon\Di;). - CLI scripts and tests bootstrap with
require_once 'Globals.php';— no path; the autoloader resolvessrc/Core/Config/Globals.php. - PSR-12 (
composer phpcs). Static analysis:vendor/bin/phpstan analyse(phpstan.neon, level 0,src/only). Run it after PHP changes. - Register new JS/CSS via
AssetProvider; never editsites/admin-cabinet/assets/js/pbx/**(Babel output ofassets/js/src/**). Use thebabel-compilerskill to transpile. - UI strings live in
src/Common/Messages/<lang>/*.php, Russian is the source language; use thetranslationsskill. - Reuse existing helpers and naming; no dead code, no stubbed "simplified" implementations, no mock services in tests.
- Unit:
vendor/bin/phpunit -c tests/Unit/phpunit.xml <path>— the XML defines no testsuites, so a path is mandatory. Run inside the PHP container sovendor/and extensions match production. tests/AdminCabinet(PHPUnit + Selenium/BrowserStack),tests/api(pytest),tests/Calls(bash/PHP, separate Asterisk on port 5062),tests/pycalltests(PJSUA2, runs inside the container). Each has its own README or guide.- Host
tests/is synced to/offload/rootfs/usr/www/testsin the container. - Restart the container before verifying backend changes; workers cache code.
- Rootfs is read-only. Hot-patch with
busybox mount -o remount,rw /offload...busybox mount -o remount,ro /offload. Usebusybox mount, not baremount; the mount point is/offload, not/offload/rootfs. - Packaging on macOS:
COPYFILE_DISABLE=1 tar --no-xattrs ...or._*files land on the host. - After editing
src/Common/Messages/*, delete/var/tmp/www_cache/js/localization-*.min.json the host;AssetProvider::makeLocalizationAssets()only regenerates a missing file and the version hash ignores translation content. - Live paths: DB
/cf/conf/mikopbx.db; logs under/storage/usbdisk1/mikopbx/log/(system/messages,php/php-error.log,nginx/error.log,asterisk/,fail2ban/). - Module workers crashing 100+ times in 30 min are auto-disabled (
DISABLED_BY_CRASH_LOOP).
Project skills (Agent Skills standard) are published separately at
https://github.com/mikopbx/agent-skills and are not part of this repository. Install them
into your agent with npx skills add mikopbx/agent-skills (works for Claude Code, Codex,
Cursor, Gemini CLI and others). Skills referenced elsewhere in these guides (babel-compiler,
translations, api-client, ...) come from that repository.
- Commit or stage without being asked. Do not read
vendor/,node_modules/,build/,resources/{db,sounds-base,rootfs}/,*.min.*— they are generated or huge. - Leave partial implementations, duplicated helpers, or resource leaks (DB handles, timers, listeners).