rpv
04/10/2025, 1:27 PMcall_transfer
webhook
3. The transfer tool:
- Places the caller on hold
- Attempts to connect with an available human specialist
- Either connects the caller to the specialist OR reconnects the caller to the AI if no specialist is available
4. The AI receives the result of the transfer attempt and continues the conversation if reconnected
Key Questions:
- Is this implementation approach feasible with Vapi?
- What happens with the AI assistant's state during the on-hold period?
- Will the AI wait for the webhook result or disconnect from the call?
- How does Vapi integrate with FreePBX/Asterisk systems?
I'm particularly concerned about maintaining the AI's conversational context through the transfer process, especially if the caller is reconnected to the AI after a failed transfer attempt.Vapi Support Bot
04/10/2025, 1:30 PMtransferCall
function. Vapi offers two types of call transfers:
1. Blind transfer - The call is transferred directly to another agent
2. Warm transfer - The call is transferred after providing context about the call
For your specific flow, you can use the "On-Hold Specialist Transfer" functionality. According to the [On-Hold Specialist Transfer documentation](https://docs.vapi.ai/phone-calling/on-hold-specialist-transfer), when a user is transferred to a specialist, "the user is placed on hold in a Twilio conference." If the specialist doesn't answer, "control can be returned to the AI for scheduling."
## What happens with the AI assistant's state during the on-hold period?
During the on-hold period, the user is placed in a Twilio conference while the system attempts to connect to a specialist. Vapi offers features to manage conversation history during assistant transfers, including a transfer mode that allows more control over this history.
To keep the call on hold, you can create a transfer_call
tool with async: false
and a higher timeout. Additionally, you can add messages to tool_delay
to keep static messages while the representative is unavailable. When the server receives the transfer call destination request, you should keep that HTTP connection open while checking the representative's availability.
## Will the AI wait for the webhook result or disconnect from the call?Vapi Support Bot
04/10/2025, 1:30 PMVapi Support Bot
04/10/2025, 1:30 PMtransferMode
to rolling-history
to maintain conversation context during the transfer.
4. **Store and preload conversation context**: When transferring calls back to the AI after a failed attempt, store and preload the conversation context.
5. **Retrieve previous call history**: Before each call, retrieve the customer's previous call history and include it in API calls to the language model.
Is there anything specific about any of these aspects you'd like me to elaborate on further?
Sources:
- [Vapi's documentation](https://docs.vapi.ai/call-forwarding)
- [On-Hold Specialist Transfer documentation](https://docs.vapi.ai/phone-calling/on-hold-specialist-transfer)
- [Discord thread about call transfers and voicemail detection](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336424026486079559)
- [Discord thread about call transfer failures](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341953566801264690)
- [Discord thread about caching issues](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1343768614209323018)
- [Discord thread about call transfers](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1328028159949537341)
- [Discord thread about integration with Asterisk](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1331674878092382218)
- [Discord thread about SIP integration](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334251359519641692)
- [Discord thread about passing context](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1340813822193041499)Vapi Support Bot
04/10/2025, 1:30 PMrpv
04/10/2025, 1:49 PMrpv
04/10/2025, 1:50 PMKyle Brunker
04/11/2025, 7:12 PM