time specific forwarding
# support
k
Is it possible to have multiple forwarding numbers that have time specific instructions? For example: I have a restaurant that has a reservation team that is separate from the events team. They want us to filter which call should go to which team at different forwarding numbers. On top of this they would like to have the call be forwaded between 9-5 but outside of those hours we capture details and email them to the customer. Please let me know if you can help with this @Support.Voice-Agent
v
Yes, you can achieve time-specific forwarding by handling the
transfer-destination-request
webhook in your server and routing calls based on the current time. Here’s a simple example in JavaScript:
Copy code
js
const hour = new Date().getHours();
if (hour >= 9 && hour < 17) {
  // Forward to reservation or events team based on call details
  res.json({ destination: { type: "number", number: "+1234567890", message: "Connecting you to reservations." } });
} else {
  // Capture details and send email (implement your email logic here)
  res.json({ error: "Our team is unavailable. We'll email you shortly." });
}
This lets you forward calls during business hours and handle them differently after hours. You’ll need to implement the email logic in your backend. [See dynamic transfer docs](https://docs.vapi.ai/calls/call-dynamic-transfers#respond-to-transfer-requests) for more details. Source: - [Dynamic Call Transfers](https://docs.vapi.ai/calls/call-dynamic-transfers#respond-to-transfer-requests)
k
Yes, by using time-based logic with the transferCall tool and integrations for after-hours messaging..
v
Message marked as helpful by @kbmaine! 🎉
v
checking if this is resolved/solved for you?