bashcurl -X POST "https://{workspace_id}.firetell.app/api/v1/calls/make" \-H "Authorization: ApiKey sk-YOUR_API_KEY" \-H "Content-Type: application/json" \-d '{"from": { "number": "+14155550100", "name": "VoiceBot AI" },"to": { "number": "+12125550123", "name": "John Doe" },"actions": [{"action": "stream","params": {"ws_url": "wss://bot.yourdomain.com/voice-stream","track": "both","sample_rate": 16000,"bidirectional": true,"headers": { "Authorization": "Bearer YOUR_WS_TOKEN" }}}]}'
| Chiều truyền | Loại Frame | Dữ liệu & Quy tắc |
|---|---|---|
| Firetell → Server của bạn | Binary | PCM 16-bit little-endian tại 8000 Hz (mặc định) hoặc 16000 Hz. Stereo (trái=người gọi, phải=bên nghe) nếu track=both. |
| Server của bạn → Firetell | Binary | PCM 16-bit little-endian mono đúng sample_rate. Cần bidirectional: true và cuộc gọi ở trạng thái ACTIVE. |
| Server của bạn → Firetell | Text JSON | {"type":"killAudio"} xóa ngay audio đang xếp hàng phát để xử lý ngắt lời (barge-in). |
| Bắt tay & Định danh | URL + Headers | Chỉ nhận wss:// hoặc ws:// public; tối đa 10 header tùy chỉnh kèm tham số call_id, caller_number tự gắn trên URL. |