REST API & Integrations
Full REST API at /api/v1/, live Asterisk status endpoint, FastAGI server, callback daemon, and CRM integration patterns.
PearlPBX2 exposes a versioned REST API built with Django REST Framework, giving external systems programmatic access to agents, queues, CDR data, blocklists, and live Asterisk status. A dedicated FastAGI server (port 4573) enables Asterisk dialplan to call Python business logic mid-call. The callback daemon integrates with the AMI to originate outbound calls. Together these interfaces make PearlPBX2 a complete platform for CRM and ERP integration.
Key highlights
Versioned REST API at /api/v1/ — agents, queues, CDR, blocklist, contacts, callbacks
Live status endpoint: returns real-time Asterisk + Redis state as JSON
Blocklist and Allowlist API: add/remove numbers programmatically for real-time call blocking
FastAGI server on TCP port 4573 — call Python logic from within Asterisk dialplan
Callback daemon uses AMI Originate to place outbound calls from the server side
Django admin API: full CRUD on all models available via Django REST admin interface
API endpoints
- GET /api/v1/agents/ — list all agents with current status
- GET /api/v1/queues/ — list queues with member counts and service metrics
- GET /api/v1/cdr/ — paginated CDR records with filters by date, agent, queue, disposition
- GET/POST /api/v1/blocklist/ — retrieve or add blocked numbers
- GET/POST /api/v1/callbacks/ — view or create callback queue entries
- GET /api/v1/status/ — live Asterisk channels, registrations, and Redis connectivity
- POST /api/v1/originate/ — trigger an AMI Originate call programmatically
Integration patterns
- CRM screen-pop: on inbound call, query /api/v1/status/ by caller ID and open the CRM record
- Automatic blocklist sync: your CRM pushes refusal numbers to /api/v1/blocklist/ in real time
- Post-call webhook: Asterisk AGI posts call result to your CRM after hangup using the FastAGI service
- Queue status widget: embed live queue metrics in your helpdesk using the /api/v1/queues/ endpoint
- Callback from web form: your website POSTs to /api/v1/callbacks/ to request an agent callback
Standalone services
- FastAGI server (port 4573): Python AGI handler called mid-call by Asterisk for recording, routing decisions, and CRM lookup
- Callback daemon: independent process that polls the database and uses AMI Originate to place calls
- Dashboard Listener: subscribes to Asterisk AMI event stream and publishes to Redis for WebSocket delivery
- All three services are managed independently and can be restarted without restarting the Django app
Ready to see it in action?
Request a live demo or explore pricing for hosted and self-hosted options.