Dynamic Call Transfer - Call ends instead of trans...
# support
s
I am trying to transfer a call dynamically via a webhook to Make.com. I've tried following the Vapi docs but to no avail. Please let me understand where I'm going wrong. Info CallID: fa8637fa-7772-4735-ac19-3e947a0bb941 Time: 2 Apr 2025, 11:18 Expected: Transfer to destination returned from Webhook response Actual: Call ended. My webhook response is as follows: { "destination": { "type": "number", "message": "Connecting you now.", "number": "[number to be transfered to]", "numberE164CheckEnabled": true, "callerId": "[number user calls from]" } } I can see the hook works, but Vapi doesnt read the response. My assistant uses the below example to transfer: '[TASK] Trigger the dynamicDestinationTransferCall tool Tool name: dynamicDestinationTransferCall Description: Use this tool to transfer retrieve the number you need to transfer the user to Parameters: location - string
v
I'll help you transfer this call to the appropriate department. Let me get that set up for you right away.
v
Message marked as helpful by @SidewaysCat! 🎉
Message marked as helpful by @SidewaysCat! 🎉
s
@Vapi Support Bot
v
Hi there! 👋 I'll help you troubleshoot your dynamic call transfer issue. I notice that your call is ending instead of transferring, and it seems the webhook response format might be the issue. While I can see your webhook is working, the response format doesn't appear to be what Vapi expects. Based on the information I found, here's what might be going wrong: ### Webhook Response Format The expected JSON format for webhook responses in Vapi should include a
results
array with
toolCallId
and
result
fields, like this:
Copy code
json
{
  "results": [{
    "toolCallId": "message.toolCalls[].id",
    "result": "Whatever you want to send back to the tool"
  }]
}
According to the [documentation](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1325000684231196775), the
toolCallId
in your response must match the
toolCallId
that was sent by Vapi in the initial request. Your current response format is missing these required fields. ### How the dynamicDestinationTransferCall Tool Works The
dynamicDestinationTransferCall
tool [works by](https://docs.vapi.ai/phone-calling/dynamic-call-transfers): 1. Sending a
transfer-destination-request
webhook to your server 2. Your server should respond with either a valid destination or an error 3. The destination can be a number or SIP URI When triggered with "trigger the dynamicDestinationTransferCall tool", it sends the webhook request to your server URL. ### Troubleshooting Steps Here are some steps to resolve your issue: 1. **Check the response format**: Ensure you're returning the correct JSON structure with the
results
array containing the
toolCallId
and
result
fields. 2. **Verify content type**: Make sure the content-type of your response is set to
application/json
as mentioned in the [documentation](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1330221332452999321).
3. **Check for the 'phone-call-control' server event**: According to [troubleshooting information](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1330092161835733013), enabling the 'phone-call-control' server event can prevent calls from being transferred correctly. Try removing this event from your assistant. 4. **Verify E164 format**: Since you have
numberE164CheckEnabled
set to
true
, ensure your phone number is in the correct E164 format (e.g., +14155551234). This is the [default setting](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342514332604432424) and requires proper formatting. Is there anything specific about these steps you'd like me to clarify further? Sources: - [Discord Thread about JSON Response Format](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1325000684231196775) - [Discord Thread about Content Type](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1330221332452999321) - [Discord Thread about Phone Call Control Event](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1330092161835733013) - [Discord Thread about numberE164CheckEnabled](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342514332604432424) - [Vapi Documentation on Dynamic Call Transfers](https://docs.vapi.ai/phone-calling/dynamic-call-transfers)
s
It still seems to be hanging. MY server messages are set to 'end-of-call report', 'transfer-dynamic-request' and 'tool-calls' . is this correct?
When looking at the call logs in Twilio, the number of 'To' is a random number and is showing as failed which is what ends the call https://cdn.discordapp.com/attachments/1357081062978883655/1357126129894293554/image.png?ex=67ef11b3&is=67edc033&hm=1bbf3a1e410fb63d9006f56a09c1754fda9e1baca8804dec3eda3d5193e9226c&
My server messages to Make are: transfer-destination-request endofcall report status-update tool-calls My Make webhook response is: { "destination": { "type": "number", "message": "Sending you there now", "number": "[static number I want to sent to]", "numberE164CheckEnabled": true, "callerId": "{{1.message.call.customer.number}}" }, "results": [ { "toolCallId": "{{7.Tool_ID}}", "result": "[static number i want to send to]" } ] } p.s I've also tried this without the 'results' part & this is my tool json: { "id": "3958485d-7526-4991-882d-b94c4a31352a", "createdAt": "2025-03-29T19:57:13.941Z", "updatedAt": "2025-04-03T19:38:38.526Z", "type": "transferCall", "function": { "name": "dynamicDestinationTransferCall", "strict": false, "description": "Use this tool to transfer the customer's call", "parameters": { "type": "object", "properties": { "location": { "description": "This is the department/staff the user wants to be transferred to.", "type": "string" } }, "required": [ "location" ] } }, "messages": [], "orgId": "3a5c4919-5bd3-4046-a105-444d697f", "async": false, "destinations": [] }
v
checking if this is resolved/solved for you?
s
Figured it out in the end, I had to creat two separate tools. The first tool is a ‘getnumber’ tool which is used to retrieve the number (via Make) and then it runs the second ‘dynamicDestinationTransferCall’ tool to transfer the call to the retrieved number. This could be made a lot easier to understand in the documentation by stating you need to retrieve the number first. Instead I was trying to get the number via the dynamicCall tool via my server.
v
You can still use transfer destination request to get the number or the destination from your server and then transfer call to the that server. It's either way it is still the same. In the first method which you are currently doing you are taking the number from your server and then calling the tool. In the other method you are supposed to call your server URL asking for the destination. It's still up to you which one you use even if you want to continue with your current approach.
s
Gotcha, didn't seem to want to work for me anyway so much have been doing something wrong 🥲
v
Hey SidewaysCat, can you brief me more about your process on how you're trying to use Transfer Destination Request where you are currently blocked and what you've done until now? That way, I don't run into any confusion or assumptions.