Testing & troubleshooting
Work through these in order; Fonada can run test calls with you at any stage. Steps 1–8 apply to both directions — validate them with inbound calls first (easier to trigger), then repeat steps 6 and 7 for outbound.
- Connectivity. Fonada connects and the endpoint accepts the upgrade. Confirm from the access logs, and that the URL and any authentication parameter arrive as expected.
- session_start parsing. The endpoint logs the session_id, the phone numbers, and the direction, and the field names match what the code expects.
- Audio reception. Write 10 seconds to a file and play it back — it should be intelligible speech at the agreed rate. Wrong-sounding audio here is almost always a sample-rate mismatch.
- Echo test. Return the end user's audio unchanged; they should hear themselves clearly. This validates the return path independently of your TTS.
- Real response. Return TTS audio and confirm it is heard cleanly — no truncation at the end (which indicates bursting too far ahead) and no distortion (a rate mismatch).
- Outbound concurrency. Run a small campaign at expected peak concurrency and confirm no connections are refused and no audio is dropped.
- Transfer. Call the transfer API mid-conversation and confirm the end user reaches a human agent and the WebSocket closes.
- Failure handling. Restart the service during a call and confirm the behaviour is as expected: the call drops, which is by design.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| Calls fail the moment they connect | Endpoint unreachable, invalid TLS certificate, or the upgrade is rejected (auth failure). Check the access logs for the handshake. |
| Far fewer connections than outbound calls placed | Expected. Only answered calls reach the endpoint; check dial outcomes in the outbound reporting. |
| End-user audio sounds too fast, slow, or garbled | Sample-rate mismatch. Confirm the endpoint reads at input_sample_rate from session_start. |
| Your audio sounds wrong to the end user | You are sending a rate other than the agreed output_sample_rate. |
| Your response is cut off partway | Bursting more than a few seconds ahead of real time; stream progressively. Alternatively, the call ended early. |
| You cannot parse the audio Fonada sends | Your implementation and Fonada's configured encoding disagree — ask Fonada which is enabled. The reverse direction is tolerant: Fonada accepts either form. |
| Nothing arrives for the first half second | Chunk size is 16384; ask Fonada to reduce it to 640. |
| The end of the last sentence is missing | Trailing partial chunk with a large chunk size; ask Fonada to reduce it. |
| Calls drop mid-conversation | Your service stopped reading for over 5 seconds, closed the socket, or crashed. |
| Audio is choppy or has gaps | Sustained delay reading from the socket — check whether processing blocks the read loop. |
| Connections refused during campaign ramp-up | Endpoint under-provisioned for peak concurrency, or a load-balancer connection limit. |
| Transfer returns 404 | The call already ended, the session_id is incorrect, or transfer is not enabled for the account. |
| Transfer returns 502 | Fonada's telephony control link is temporarily unavailable. The call is unaffected — continue the conversation or retry. |