Warm Transfer Issue
# support
u
I need help with sending a custom “reason” message during a warm transfer using the Transfer Call tool in Vapi. Right now, the warm transfer works only when I hard-code the reason inside the tool itself. Instead, I want the assistant to first ask the caller for the reason, then pass that collected reason to the destination number before connecting the call. Is there a way to dynamically send this custom reason from the assistant to the warm transfer?
v
Yes, you can dynamically send the caller's reason during a warm transfer by configuring the transfer assistant to use conversation context. After gathering the reason from the caller, set the
firstMessage
property to reference that context. For example:
Copy code
json
"transferAssistant": {
  "firstMessage": "Hi, I have a customer on the line. Reason: {{reason}}. Are you available?",
  "maxDurationSeconds": 90,
  "model": { "provider": "openai", "model": "gpt-4o" }
}
Make sure your assistant collects the
reason
variable before the transfer—this will be available for dynamic insertion in the message according to the documentation you have found. Source: - [Assistant-based warm transfer](https://docs.vapi.ai/calls/assistant-based-warm-transfer)
c
Hi Umair Ameen, To dynamically send a custom "reason" message during a warm transfer, you can configure the transfer assistant to use conversation context. Follow these steps: 1. **Collect the Reason**: Ensure your assistant collects the
reason
from the caller before initiating the transfer. You can use a system prompt or setup in your assistant to gather this information. 2. **Configure Transfer Assistant**: Set the
firstMessage
in the
transferAssistant
configuration to include the dynamic
reason
. Here’s an example configuration:
Copy code
json
   {
     "transferAssistant": {
       "firstMessage": "Hi, I have a customer on the line. Reason: {{reason}}. Are you available?",
       "firstMessageMode": "assistant-speaks-first",
       "maxDurationSeconds": 90,
       "model": {
         "provider": "openai",
         "model": "gpt-4o"
       }
     }
   }
3. **Ensure Context is Passed**: Make sure that the
reason
variable is correctly populated in the assistant's context before the transfer. This will allow dynamic insertion into the transfer message. By ensuring that the assistant collects and passes the
reason
variable, your transfer assistant can dynamically inform the operator, thus preventing the need to hard-code this information. For further details, you can refer to the [Assistant-based warm transfer documentation](https://docs.vapi.ai/calls/assistant-based-warm-transfer).