Agents

Transfer & end call

Two things an agent can do to the call itself: hand it to a human, or hang up. You turn these on in the agent config — they're built in, so you don't define them as tools.


Transfer to a human

Let the agent pass the live call to a real person. The agent says a short goodbye, dials the human, and bridges them in. If the human doesn't pick up, the agent carries on.

One number (simplest)

{
  "transfer": {
    "enabled": true,
    "mode": "always",
    "to_number": "+919812345678",
    "when": "The caller asks for a person, or you can't resolve their problem."
  }
}
Field What
enabled Turn transfer on.
mode "always" — one number for every transfer.
to_number The human's number, E.164. Never spoken to the caller.
when Plain-English rule for when to transfer. The agent reads this.

Route to different people

Use "conditional" mode to send different callers to different numbers. The agent picks a route by its when; if none fit, it uses fallback_number.

{
  "transfer": {
    "enabled": true,
    "mode": "conditional",
    "routes": [
      { "when": "The caller asks about billing.",  "to_number": "+919800000001" },
      { "when": "The caller asks about a repair.",  "to_number": "+919800000002" }
    ],
    "fallback_number": "+919812345678"
  }
}
Field What
routes List of { when, to_number }. The agent matches when to the conversation.
fallback_number Used when no route matches.

Phone calls only. A Voice Socket has no phone leg to dial a human on, so transfer is removed there automatically.


End the call

Let the agent hang up on its own when the conversation is genuinely over.

{
  "endCall": {
    "enabled": true,
    "when": "The caller has said goodbye and has nothing else to ask."
  }
}
Field What
enabled Turn auto-hangup on.
when Plain-English rule for when it's done.

On a phone call this hangs up the line. On a Voice Socket it closes the session.


Seeing them happen

Both show up in the transcript as role: "tool" entries with tool_type: "control" (names transfer_to_human and end_call), and live on the socket as tool.called / tool.completed. See Tools — where you see activity.


Next