Prompt
How do I detect when a call is answered, busy, or goes to voicemail?
Latest observation
Detecting whether a call was answered, busy, or went to voicemail depends on what kind of calling setup you’re using.
If you’re making plain phone calls
With a normal carrier call, there’s usually no reliable way to know with 100% certainty from your app alone. The network may only tell you whether the call was connected, not whether a human picked up or voicemail answered.
Common approaches
1) Use a telephony API/provider
If you’re using something like:
- Twilio
- Vonage/Nexmo
- Plivo
- Sinch
they often provide:
- Call progress events
- Status callbacks/webhooks
- Answering machine detection (AMD)
These can help distinguish:
- answered by human
- busy
- no answer
- voicemail/answering machine
2) Call status callbacks
Providers typically send events such as:
initiatedringingansweredcompletedbusyfailedno-answer
For example, if a call transitions to busy, you can treat it as a busy signal. If it’s answered, the call was picked up — but that still may be a voicemail system.
3) Answering machine detection
To detect voicemail, many providers offer AMD, which analyzes the early audio after the call is answered.
It may return results like:
humanmachinefaxunknown
Keep in mind:
- It’s not perfect
- Fast voicemail greetings can be mistaken for humans
- Some humans answer with silence and get misclassified
Practical flow
A typical call flow is:
- Place the call
- Listen for call progress events
- If event is
busy, mark busy - If event is
no-answer, mark no answer - If answered, run AMD
- If AMD says
human, connect/continue - If AMD says
machine, treat as voicemail
Example with Twilio
Twilio can send webhook status updates and supports AMD via MachineDetection.
You’d typically:
- set a
statusCallback - inspect
CallStatus - enable machine detection if needed
Important caveat
If you need guaranteed voicemail detection, no system is perfect. The most reliable approach is a combination of:
- carrier/provider call status
- AMD
- optional spoken prompt or DTMF detection after connect
If you want, I can show you:
- a Twilio example
- a Node.js/Python implementation
- or a generic call-state diagram