axornet
09/01/2025, 7:53 PMChiranjeet Mishra
09/02/2025, 11:35 PMtransfer-destination-request.
2. **Handle Webhook Properly**: Implement a webhook handler on your server to process these requests. The webhook should receive the transfer-destination request and return the SIP URI:
javascript
app.post('/webhook', (req, res) => {
const request = req.body;
if (request.type !== 'transfer-destination-request') {
return res.status(200).json({ received: true });
}
const sipUri = getSipUriFromYourSource(); // Retrieve SIP URI dynamically
const destination = {
type: "sip",
uri: sipUri
};
res.json({ destination });
});
3. **Server Configuration**: Make sure your server URL is configured in the Vapi dashboard to handle the webhook events properly, and verify the webhook signature as explained in [Dynamic Call Transfers](https://docs.vapi.ai/calls/call-dynamic-transfers).
By ensuring your webhook dynamically provides the SIP URI and that the assistant is configured to make use of the transfer-destination-request, you should be able to route calls dynamically to SIP addresses.