Implement RequestTransfer and AnswerTransferRequest in your WebRTC client to handle call transfers. Configure destinations with the Transfer tool.
How WebRTC transfer works
On a WebRTC Channel, transfer_conversation delegates the transfer to your application through LiveKit RPC. Your client receives the request, performs the transfer, and reports whether it succeeded.
Assistant behaviour
Phase
Assistant Behaviour
Request sent
Disables user audio input while awaiting the answer
Waiting
Waits up to 300 seconds for AnswerTransferRequest
Transfer accepted
Ends the Reecall conversation and disconnects the Assistant, leaving the room available to your application
Transfer rejected
Re-enables audio, informs user of failure, continues conversation
No answer or client disconnect
Shuts down the Assistant session
RPC interface reference
The transfer protocol uses two RPC methods with JSON payloads.
RequestTransfer (Assistant → client)
The Assistant initiates a transfer by calling the RequestTransfer RPC method on your client.
Payload:
Code
{ "requestId": "550e8400-e29b-41d4-a716-446655440000", "destination": "+33612345678", "reason": "Customer requested to speak with billing department", "conversationSummary": "Customer inquired about invoice #12345..."}
Field
Type
Required
Description
requestId
string
Yes
Unique identifier for this transfer request. Use it when sending the answer
destination
string
Yes
Transfer target (phone number, extension, queue name, or custom identifier)
reason
string
No
Why the Assistant initiated the transfer
conversationSummary
string
No
AI-generated summary of the conversation up to this point
The payload contains an optional summary, not the full message history.
Expected response:
Code
{ "acknowledged": true}
AnswerTransferRequest (client → Assistant)
After performing the transfer, your client calls the AnswerTransferRequest RPC method to report the outcome to the Assistant.
{ "requestId": "550e8400-e29b-41d4-a716-446655440000", "accepted": false, "reason": "No human agent was available."}
Field
Type
Required
Description
requestId
string
Yes
Must match the requestId from the original RequestTransfer call
accepted
boolean
Yes
true if transfer succeeded, false if it failed
reason
string
No
Explanation when accepted is false. Used to inform the user politely
Response from Assistant:
Code
{ "acknowledged": true}
The Assistant acknowledges receipt and proceeds based on the accepted value:
accepted: true - Ends the Reecall conversation and disconnects the Assistant without deleting the LiveKit room
accepted: false - Resumes the conversation, informs the user using the reason field
Step 1: register the RequestTransfer handler
Use a connected LiveKit Room for these examples. Call setupTransferHandler or setup_transfer_handler to register the handler in your client. The handler acknowledges the request immediately and starts the transfer in the background. See LiveKit's RPC reference for SDK method signatures.
The initial RequestTransfer RPC must return within 5 seconds. After that acknowledgement, the Assistant waits up to 300 seconds for AnswerTransferRequest. It mutes caller input during the wait; provide hold audio in your application if needed. If the client disconnects or the answer times out, the Assistant shuts down.
Step 2: perform the transfer
Implement executeTransfer or execute_transfer with your application's transfer logic. The examples below call that function and report its outcome to the Assistant.
async def send_transfer_answer( room: rtc.Room, request_id: str, accepted: bool, reason: Optional[str] = None,) -> None: # Find the agent participant agent_participant = None for participant in room.remote_participants.values(): if participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_AGENT: agent_participant = participant break if not agent_participant: print("Agent participant not found") return payload = json.dumps({ "requestId": request_id, "accepted": accepted, "reason": reason, }) try: response = await room.local_participant.perform_rpc( destination_identity=agent_participant.identity, method="AnswerTransferRequest", payload=payload, ) print(f"Transfer answer acknowledged: {response}") except Exception as e: print(f"Failed to send transfer answer: {e}")
Code
func sendTransferAnswer(room *lksdk.Room, requestID string, accepted bool, reason string) { // Find the agent participant var agentParticipant *lksdk.RemoteParticipant for _, p := range room.GetRemoteParticipants() { if p.Kind() == lksdk.ParticipantAgent { agentParticipant = p break } } if agentParticipant == nil { fmt.Println("Agent participant not found") return } payload, _ := json.Marshal(map[string]interface{}{ "requestId": requestID, "accepted": accepted, "reason": reason, }) response, err := room.LocalParticipant.PerformRpc(lksdk.PerformRpcParams{ DestinationIdentity: agentParticipant.Identity(), Method: "AnswerTransferRequest", Payload: string(payload), }) if err != nil { fmt.Printf("Failed to send transfer answer: %v\n", err) return } fmt.Printf("Transfer answer acknowledged: %s\n", response)}
Note
When the transfer is rejected, the Assistant explains the failure in non-technical terms based on your reason field, then asks if it can help with anything else.