- 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.
main.py
Calling the representative
In the same handler, generate a random conference ID and userunner.call_phone() to start an outbound call to the representative.
The conference ID, the inbound call’s ID, and the reason for calling are passed to the outbound agent as variables.
main.py
Outbound agent briefs the representative
The outbound agent readscall_reason with call.get_variable(), explains the caller’s issue to the representative, and confirms that they’re ready to take the call.
main.py
Both calls join the conference
Once the representative is ready, the outbound agent usesguava.RemoteCall 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.
main.py
Run the example
This example ships with the Python SDK. Pass the representative’s phone number with--transfer-destination:
--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
main.py