Dynamic Call Forwarding
# support
s
I want to forward calls to a phone number defined at the beginning of the call. My use case if outbound calls. For each outbound call I start, I have a specific phone number I need to forward the call to. How can I do that? Right now, this is hard-coded in the tool definition that is tied to the assistant, and not dynamic at the call level.
@User
v
@Skan To dynamically forward calls to a specific phone number for each outbound call, you would need to modify your call flow to include a step that sets the forwarding number at the beginning of each call based on the context or parameters provided for that call. If your current setup does not support dynamic assignment of forwarding numbers and is hard-coded, you may need to update your Voice API configuration or script to accept a variable for the forwarding number. This variable can then be set at the beginning of each call, allowing you to specify the desired forwarding number for that particular call. If you have access to the code or configuration, look for the section where the forwarding number is defined and replace the hard-coded number with a variable. Then, ensure that you pass the correct forwarding number when initiating each outbound call. If you're not sure how to make these changes or if the tool you're using supports this functionality, please ask support for more info on this. They can provide you with specific instructions or updates that may be required to achieve dynamic call forwarding based on your needs.
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
g
i am having same issue. need to set dynamic variable for phone number in call forwarding
s
@User any idea on how to do this?
s
Hey @Skan / @Gurinder Singh please check this documentation regarding call forwarding, it helps you define the numbers dynamically. https://docs.vapi.ai/call-forwarding
Do let me know if you have any questions.
Check the shared documentation, if this doesn't helps then do let me know.
g
please check for more details in this message: https://discord.com/channels/1211482211119796234/1306878180862464060
it clears says: Call Forwarding Tools transferCall Tool: This tool enables call forwarding to predefined phone numbers with specific messages based on the destination. the numbers must be predefind. i need to retrieve 1 of thousands of numbers from a database during call and then send that number to vapi to forward the call to. cannot find anything on it in docs
x
Hey, quick question: What’s the maximum number of options I can set up in VAPI’s code for forwarding calls based on the choices the user selects? @Vapi
v
@Xavier The maximum number of forwarding options you can set up in VAPI's code for call forwarding based on user selections is not explicitly limited by VAPI itself. However, practical limitations may arise from the complexity of your call flow, the maintainability of the code, and potential performance considerations. If you're looking to dynamically retrieve a phone number from a database during a call and then forward the call to that number, you would typically implement logic in your call handling script to query the database, retrieve the appropriate number, and then use that number to forward the call. Since you mentioned that the documentation does not cover this scenario, you might need to use a custom solution. This could involve using a webhook to fetch the number from your database when the call is initiated and then using the VAPI to forward the call to the retrieved number. If you need further assistance with implementing this feature or if the functionality you're looking for is not available, please ask support for more info on this. They can provide guidance tailored to your specific use case and the capabilities of the VAPI platform.
x
Can I forward the calls to 20 options set up in Vapi ? @Vapi
v
@Xavier Yes, you can set up call forwarding to 20 different options in VAPI. The system is designed to handle multiple forwarding rules, so you can configure call forwarding based on various conditions or user selections. However, you should ensure that your call flow is designed efficiently to handle the logic for 20 different forwarding paths, keeping in mind the user experience and the maintainability of your code. If you need to dynamically forward calls to one of many numbers retrieved from a database, you would typically implement a system that selects the appropriate forwarding number during the call based on your criteria, and then use VAPI's call forwarding functionality to route the call to that number. If you have any specific questions about setting this up or if you encounter any limitations, please feel free to reach out to support for more detailed assistance.
x
Thanks @Vapi can you provide me the code to do that?
t
You need to create a custom function/tool calling for that
s
Hey @Gurinder Singh I have replied to your question under your ticket.
3 Views