Dhina
04/01/2026, 3:53 PMVapi Support Bot
04/01/2026, 3:54 PMjs
app.post('/webhook', async (req, res) => {
const { message } = req.body;
const controlUrl = message?.call?.monitor?.controlUrl;
const extension = message?.toolWithToolCallList?.[0]?.toolCall?.function?.arguments?.extension;
if (!controlUrl || !extension) return res.status(400).json({ error: 'Missing data' });
// Map extensions to SIP URIs
const extensionMap = {
'1001': 'sip:1001@yourdomain.com',
'1002': 'sip:1002@yourdomain.com',
// Add more as needed
};
const destination = { type: "sip", sipUri: extensionMap[extension] };
await axios.post(`${controlUrl}/control`, { type: "transfer", destination });
res.json({ success: true });
});
This approach ensures the bot transfers the call to the correct extension based on the caller’s request. For more details, see the [dynamic call transfers documentation](https://docs.vapi.ai/calls/call-dynamic-transfers).
Source:
- [Dynamic call transfers](https://docs.vapi.ai/calls/call-dynamic-transfers)Chiranjeet Mishra
04/02/2026, 9:43 AMtransferCall({"destination": "+16143855900"})
Both of the calls reviewed are using assistant ID 4ef36549-f8a2-4c8c-8e8d-c0dc65ec423f, and the system prompt is identical across both calls. At the moment, there does not appear to be any extension-to-phone-number mapping logic configured, which is why all transfers are going to the same base destination.
To support 6 distinct extensions, we recommend configuring 6 separate transfer destinations, with each extension mapped to its corresponding phone number or SIP route.
1. Use transferDestinations
Configure the assistant's transferDestinations array with 6 entries, each mapping an extension number to its SIP URI or phone number
"transferDestinations": [
{ "type": "number", "number": "+1XXXXXXXXXX", "message": "Transferring to extension 1001", "description": "Extension 1001" },
{ "type": "number", "number": "+1XXXXXXXXXX", "message": "Transferring to extension 1002", "description": "Extension 1002" }
]
You can continue this pattern through extensions 1001–1006.
1. Restrict transfer tool destinations
Alternatively, you can update the transfer tool schema so the destination parameter only allows the valid extension routes.
{
"destination": {
"type": "string",
"description": "The extension to transfer to (1001-1006)",
"enum": [
"+16143855900,1001",
"+16143855900,1002"
]
}
}
This ensures the assistant can only transfer to the allowed extension values.
Please try either of these approaches and let us know if you run into any issues. We’ll be happy to help review the updated transfer behavior.
https://cdn.discordapp.com/attachments/1488929289809432606/1489198657780846632/image.png?ex=69cf8bd3&is=69ce3a53&hm=79cfbf5ff184647e45109c5c4648ba5636b464c8a6183ab3b7dd27a72ad64225&