Sistema e notifiche
Stato del servizio, applicazione della configurazione, lavori in background e notifiche.
Stato del servizio
GET /health: risponde senza chiave, per i controlli di raggiungibilità.GET /v1/live/health(scopelive:read): stato complessivo (operational,degraded,outage) e contatori dell'azienda; per la piattaforma anche il dettaglio dei servizi.GET /v1/system/status(solo piattaforma): servizi, centralino, risorse del server.
curl -s https://centralino.exovoip.it/api/health
curl -s https://centralino.exovoip.it/api/v1/live/health -H "X-API-Key: $EXOPBX_API_KEY"
curl -s https://centralino.exovoip.it/api/v1/system/status -H "X-API-Key: $EXOPBX_API_KEY"const health = await pbx.live.health(); // operational | degraded | outage
const system = await pbx.system.status(); // solo piattaforma$health = $pbx->live->health();
$system = $pbx->system->status();health = pbx.live.health()
system = pbx.system.status()Applicazione della configurazione
Le modifiche fatte via API (interni, linee, code, menu…) vengono applicate al centralino automaticamente, senza interrompere le chiamate in corso. La piattaforma può richiedere un'applicazione esplicita e seguirne l'esito:
curl -s -X POST https://centralino.exovoip.it/api/v1/system/reload -H "X-API-Key: $EXOPBX_API_KEY" \
-H "Content-Type: application/json" -d '{"tenantId":3,"scope":"auto","reason":"verifica configurazione"}'
curl -s https://centralino.exovoip.it/api/v1/system/reload-jobs/55 -H "X-API-Key: $EXOPBX_API_KEY"const { job } = await pbx.system.reload({
tenantId: 3,
scope: 'auto',
reason: 'verifica configurazione',
});
const result = await pbx.system.reloadJob(job.id);$job = $pbx->system->reload(['tenantId' => 3, 'scope' => 'auto', 'reason' => 'verifica configurazione'])['job'];
$result = $pbx->system->reloadJob($job['id']);job = pbx.system.reload({"tenantId": 3, "scope": "auto", "reason": "verifica configurazione"})["job"]
result = pbx.system.reload_job(job["id"])Lavori in background
Operazioni lunghe (generazione di messaggi vocali, trascrizioni, riassunti) restituiscono un lavoro: GET /v1/jobs/:id ne indica lo stato (pending, running, done, failed) e l'eventuale errore.
Notifiche
L'azienda può ricevere avvisi via email o Telegram per chiamate perse, nuovi messaggi in segreteria, forzature degli orari, registrazioni pronte. Scope notifications:read / notifications:write.
curl -s -X PUT https://centralino.exovoip.it/api/v1/notifications/settings \
-H "X-API-Key: $EXOPBX_API_KEY" -H "Content-Type: application/json" \
-d '{"rules":[{"event":"missed_call","enabled":true,"channels":["email"],"emails":["reception@acme.example"],
"includeAdmins":false,"extensionIds":[],"queueIds":[5],"numberIds":[]}]}'await pbx.notifications.setSettings({
rules: [
{
event: 'missed_call',
enabled: true,
channels: ['email'],
emails: ['reception@acme.example'],
includeAdmins: false,
extensionIds: [],
queueIds: [5], // solo le chiamate perse della coda 5
numberIds: [],
},
],
});$pbx->notifications->setSettings(['rules' => [[
'event' => 'missed_call', 'enabled' => true, 'channels' => ['email'], 'emails' => ['reception@acme.example'],
'includeAdmins' => false, 'extensionIds' => [], 'queueIds' => [5], 'numberIds' => [],
]]]);pbx.notifications.set_settings({"rules": [{
"event": "missed_call", "enabled": True, "channels": ["email"], "emails": ["reception@acme.example"],
"includeAdmins": False, "extensionIds": [], "queueIds": [5], "numberIds": [],
}]})POST /v1/notifications/test invia una notifica di prova; GET /v1/notifications/log mostra gli invii recenti con l'esito.
Endpoint
| Descrizione | Richiesta | Scope | Metodo SDK |
|---|---|---|---|
| Stato del servizio | GET /health | — | health() |
| Utente della sessione | GET /auth/me | — | auth.me() |
| Stato servizi, Asterisk, host, reload | GET /v1/system/status | system:read | system.status() |
| Accoda reload configurazione | POST /v1/system/reload | system:write | system.reload() |
| Storico reload | GET /v1/system/reload-jobs | system:read | system.reloadJobs() · py: system.reload_jobs() |
| Dettaglio reload | GET /v1/system/reload-jobs/:id | system:read | system.reloadJob() · py: system.reload_job() |
| Regole di notifica (superadmin senza azienda: piattaforma) | GET /v1/notifications/settings | notifications:read | notifications.getSettings() · py: notifications.get_settings() |
| Modifica regole di notifica | PUT /v1/notifications/settings | notifications:write | notifications.setSettings() · py: notifications.set_settings() |
| Registro notifiche inviate | GET /v1/notifications/log | notifications:read | notifications.log() |
| Invio di prova | POST /v1/notifications/test | notifications:write | notifications.test() |
| Stato di un lavoro in background | GET /v1/jobs/:id | media:read | jobs.get() |
| Stato backup, firewall, lavori in background e servizi esterni | GET /v1/ops/status | system:read | ops.status() |
