- An inbound agent answers the call and collects the caller’s reason for calling.
- While the inbound agent keeps the caller on the line, an outbound agent calls a customer service representative and briefs them.
- Once the representative is ready, both calls are transferred into a shared conference.
Inbound agent collects the reason and stalls
The inbound agent collectsreason_for_calling. Once that task is complete, the agent is given a new task: keep the caller on the line while a representative is found.
- Python
- TypeScript
main.py
Calling the representative
In the same handler, generate a random conference ID and start an outbound call to the representative withrunner.call_phone() in Python or outboundAgent.callPhone() in TypeScript.
The conference ID, the inbound call’s ID, and the reason for calling are passed to the outbound agent as variables.
- Python
- TypeScript
main.py
Outbound agent briefs the representative
The outbound agent readscall_reason with call.get_variable() (call.getVariable() in TypeScript), explains the caller’s issue to the representative, and confirms that they’re ready to take the call.
- Python
- TypeScript
main.py
Both calls join the conference
Once the representative is ready, the outbound agent usesRemoteCall with original_call_id to control the waiting inbound call. It then transfers both calls to conference:<conference_id>, which joins them together. Each agent says a short message before it transfers.
- Python
- TypeScript
main.py
Run the example
This example ships with the Python and TypeScript SDKs. Pass the representative’s phone number with--transfer-destination:
- Python
- TypeScript
--agent-number if you want to use a specific agent number from your account.
Call your agent’s number. After you give a reason for calling, the representative’s phone will ring. Once they’ve been briefed, you’ll both be connected in a conference.
Full example
- Python
- TypeScript
main.py