How an inbound call is answered
From the dialled number to the agent speaking, including the three ways it does not work.
Updated
On this page
The whole chain, from a phone ringing to an agent speaking:
dialled number -> blind index -> PhoneNumber -> organization -> agent
The number that was dialled is hashed into a blind index and matched against
the PhoneNumber table. That hash is what makes the lookup possible
at all. The number itself is encrypted at rest, and you can't search an
encrypted column.
The three ways it does not work
Each of these behaves differently, and the difference matters when you're looking at why a call didn't happen.
The number is not ours
No PhoneNumber row matched. The call is hung up immediately and
no call record is written, because there is no organization to
write it against. The event is logged with only the last four digits.
Billing does not allow traffic
A call record is written, with status: "failed" and
ended_by: "error", and then the call is hung up. A failed call you
can see beats a call that silently never existed.
The number has no agent
A call record is written, the call is answered, and the platform itself speaks:
Thanks for calling. This number is not connected to an assistant yet. Please try again later.
Then it hangs up as soon as playback finishes, and the call is marked
outcome: "abandoned".
When it does work
The call record is created before the call is answered. It carries the agent, the agent's live version, the direction, both numbers, and two retention stamps taken from your organization's transcript and recording retention windows. Then the call is answered.
From there the agent greets the caller. If it has a
returning_message and the caller matches a contact with a first
name, that's what gets used, with {name} substituted. Otherwise
first_message. The recording disclosure, if the agent records, is
woven in before any trailing question.
Why the agent does not answer itself
A phone puts the agent's own voice back into the microphone. A speakerphone does it acoustically, and the carrier's transcriber picks it up either way. Without a guard, the agent transcribes its own greeting, answers it, transcribes that, and talks over the caller for the rest of the call.
So each call carries a moment before which it will not believe a transcript. It's set ahead of the expected end of every spoken line and tightened when the carrier confirms playback finished. A lost "finished speaking" event therefore makes the agent deaf for a few seconds, not for the rest of the call.
Webhooks
The carrier calls POST /api/webhooks/telnyx/voice. That endpoint
is not part of the versioned API. It's the carrier's contract, not ours.
Signatures are verified, and a bad signature is a 403. Everything
else answers 200, including events we don't handle, because a
non-200 makes the carrier retry and a retried call event is a duplicated
call.