Chiamate in uscita
AI4CALL supporta due modalità outbound. Entrambe sono richieste API dalla tua applicazione verso AI4CALL.
| Endpoint | Instradamento della chiamata | Requisito |
|---|---|---|
POST /webhook/outbound_call |
Trunk VoIP AI4CALL | callerId è un numero demo o acquistato AI4CALL |
POST /webhook/outbound_call_pbx |
Il tuo PBX | ipPbx è autorizzato nell’account |
Per le nuove integrazioni usa i campi camelCase: assistantApiKey, addPrompt, callResultUrl, ipPbx e sipPort. I nomi legacy restano accettati per non interrompere le integrazioni esistenti.
{ "dst": "+390212345678", "callerId": "+390212300000", "assistantApiKey": "<ASSISTANT_API_KEY>", "callResultUrl": "https://example.com/webhooks/call-result"}Fornisci callResultUrl per ricevere dialstatus e duration finali. La callback risultato non include una trascrizione. Se il relativo CDR non è ancora persistito, interroga lo stato tramite internal_id:
curl 'https://outcall.ai4call.com/getDialstatus/<INTERNAL_ID>' \ -H "X-APIKEY-SECRET-AI4CALL: $OUTBOUND_API_KEY"{ "dialStatus": "ANSWER", "billSec": 42, "trafficCost": "0.003300"}L’endpoint restituisce 404 finché il CDR non è persistito; riprova con un ritardo limitato.

