📲 Mobil İstemcileri İndir 📲 Download Mobile Apps 📲 Mobile Apps Herunterladen 🌐 Mahir Gül (mhrgl.com)
Ana SayfaHomeStartseite / GeliştiriciDeveloperEntwickler / REST API & SDKREST API & SDKREST-API & SDK

🔌 REST API & Geliştirici Kılavuzu 🔌 REST API & Developer Reference 🔌 REST-API & Entwickler-Referenz

AiPBX; CRM sistemleri, ERP yazılımları, mobil istemciler ve harici çağrı merkezi panelleri ile çift yönlü entegrasyon kurabilen modern REST API ve WebSocket arayüzleri sunar.

AiPBX exposes structured REST endpoints and WebSocket protocols for bidirectional integration with CRMs, ERPs, call center wallboards, and mobile softphones.

AiPBX stellt strukturierte REST-Endpunkte und WebSocket-Protokolle für die bidirektionale Anbindung an CRMs, ERP-Systeme, Callcenter-Wallboards und Mobil-Softphones bereit.

1. Kod Tabanı & Mimari Standartları 1. Codebase & Architectural Standards 1. Codebasis- & Architekturstandards

AiPBX web katmanı, harici framework'lere bağımlı olmaksızın saf bir PHP 8 MVC mimarisi uygular:

  • Beyaz Liste Yönlendirici (Whitelist Router): index.php dosyasındaki $ROUTES dizisinde tanımlanmamış hiçbir URL çalıştırılamaz.
  • src/controllers/: Yalnızca yetki denetimi, HTTP girdi doğrulama ve yanıt orkestrasyonu yapar.
  • src/services/: İş kurallarını (business logic) işletir, veritabanına yazar ve Asterisk senkronizasyonunu tetikler.
  • src/sync/: Değişiklikleri Asterisk .conf dosyalarına dönüştürür ve geri alma (rollback) güvencesiyle Asterisk'i yeniden yükler.

AiPBX web core runs on a clean, dependency-free PHP 8 MVC pattern:

  • Whitelist Front Router: Only routes defined in index.php's $ROUTES are reachable; unknown paths trigger an instant 404.
  • src/controllers/: Authentication checks, input sanitization, and response orchestration only.
  • src/services/: Business logic, database mutations, and triggering Asterisk synchronization.
  • src/sync/: Generates modular Asterisk configuration with automatic .bak rollback safety.

Der AiPBX-Webkern basiert auf einem sauberen, schlanken PHP 8 MVC-Muster:

  • Whitelist-Front-Router: Nur in index.php ($ROUTES) definierte Pfade sind erreichbar; alle anderen erzeugen 404.
  • src/controllers/: Zugriffskontrolle, Eingabeprüfung und Orchestrierung.
  • src/services/: Geschäftslogik, Datenbankoperationen und Asterisk-Synchronisation.
  • src/sync/: Erzeugt modulare Asterisk-Konfigurationsdateien mit automatischer .bak-Rollback-Sicherheit.

2. REST API Uç Noktaları (Endpoints) 2. REST API Endpoints 2. REST-API-Endpunkte

Method Endpoint AçıklamaDescriptionBeschreibung Auth
POST /api/auth/login Dahili kimlik doğrulama ve oturum açma Extension credentials authentication Authentifizierung & Session-Start Public
GET /api/mobile/contacts.php Kurumsal dahili rehberi ve anlık çevrimiçi varlık Corporate directory with real-time presence Unternehmensverzeichnis mit Live-Präsenz User
GET /api/mobile/history.php Arama geçmişi ve net konuşma süreleri (CDR) Call detail history and talk durations (CDR) Anrufhistorie und Gesprächsdauern (CDR) User
POST /api/cc_actions/agent.php Temsilci mola (*22/*23) ve kuyruk giriş/çıkış kontrolü Agent pause/unpause (*22/*23) and queue state Agenten-Pause (*22/*23) und Warteschlangen-Status Agent

3. Otomatik Test Paketi (PHPUnit CI/CD) 3. Automated Test Suite (PHPUnit CI/CD) 3. Automatisierte Test-Suite (PHPUnit CI/CD)

bash — Unit Tests
# Prepare test database
bash bin/setup-test-db.sh

# Execute PHPUnit suite (142 tests, 350 assertions)
./vendor/bin/phpunit
Bu SayfadaOn This PageAuf dieser Seite