Skip to main content
A transfer sends the caller to a person, an operator, on a phone number or a SIP agent. An Autopilot agent transfers with its built-in transfer tool. A stream transfers with the Voice SDK, and can also brief the operator before connecting the caller.

Pick a transfer mode

Three timelines of caller, your app and operator. Cold: after transfer(), the operator rings and answers, your app leaves, and the caller and operator talk; recording continues. Warm: after transfer({mode: warm}), the caller waits on hold with music while your app briefs the operator, then completeTransfer() connects them and your app leaves; recording continues. Refer: after transfer({mode: refer}), a SIP REFER goes back to the caller's side, your app leaves, and the call leaves Fonoster; recording stops. Three timelines of caller, your app and operator. Cold: after transfer(), the operator rings and answers, your app leaves, and the caller and operator talk; recording continues. Warm: after transfer({mode: warm}), the caller waits on hold with music while your app briefs the operator, then completeTransfer() connects them and your app leaves; recording continues. Refer: after transfer({mode: refer}), a SIP REFER goes back to the caller's side, your app leaves, and the call leaves Fonoster; recording stops. Use cold for most transfers. Use warm when the operator should hear the context before they take the call. Use refer only when your carrier supports SIP REFER and you want the call off Fonoster after the transfer. The operator can be:
  • A phone number in E.164 format, such as +18095550100. The call goes out through the trunk of the number the caller dialed (or, on an outbound call, the number you called from).
  • A SIP agent’s address, such as sip:maria@acme.sip.fonoster.com. See SIP agents.

Transfer from an Autopilot agent

Set transferOptions on the agent: the operator’s number and what the agent says first. The model can then call the built-in transfer tool. When it does, the agent says the message and makes a cold transfer.
agent.yaml
In the dashboard, set Transfer to an operator in the agent’s Behavior panel. Tell the model when to transfer in the system prompt, for example: “If the caller asks for a person, transfer the call.” Give your agent tools has the steps for the dashboard, the SDK and the CLI.
Check that the transfer number answers. If the operator can’t be reached, the agent doesn’t return to the conversation, and the caller hears silence until the call reaches its maximum length.

Transfer from a stream

Call transfer on the session. A cold transfer resolves when the operator answers and your session ends:
If the operator can’t be reached, transfer rejects with a SessionError whose code is transfer_failed. The call goes on, so tell the caller and carry on:

Warm transfer

In a warm transfer, the caller hears hold audio while your application and the operator hear each other. Start the transfer without waiting on it, wait for the operator to answer, brief them, then call completeTransfer to connect the caller:
In Python, start it as a task, because transfer waits until the session ends:
Fonoster sends transfer.answered when the operator answers. completeTransfer before that is refused with SessionError code transfer_not_answered: the caller stays on hold and you can call it again after the event. If the operator doesn’t answer within 30 seconds, the transfer fails with transfer_failed and the caller is back with your application.

SIP REFER

Pass mode: "refer". Your session ends once the caller’s side accepts the REFER:

Send data to the operator’s phone

Add custom SIP headers to tell the operator’s system who’s calling. Headers must start with X-, and you can send up to 16:
Some headers are reserved for Fonoster, such as X-App-Ref, X-Call-Ref and X-Dod-Number. A transfer that sets one fails with bad_message.

Hold and resume

To put the caller on hold without transferring, for example while you look something up, call hold. Pass a music URL to play while they wait, or leave it out for silence:
While the caller is on hold, your application gets no caller audio and no speech events, but it still gets keypresses. Only resume, hangup, transfer and handoff work. Anything else, such as say, fails with on_hold.

Check it

  • Call your number, ask for a person, and check that the operator’s phone rings.
  • In a stream, listen for the session’s end. After a transfer, its reason is transfer:

Next steps

SIP agents

Give operators a softphone to take transfers.

Give your agent tools

The transfer tool and the others.

Voice SDK reference

Every method and option.

Record calls

What gets recorded after a transfer.