forwardingPhoneNumbers using Vapi?
# support
m
Hey guys. I am trying to use forwardingPhoneNumbers to forward to different phone numbers based on context. I have a few confusion. I am using a Twilio number. - Is it possible to forward to regular numbers using inbuilt CallTransfer function and forwardingPhoneNumbers array using Vapi? Or do I need to use Twilio externally? If yes, does the forwardingPhoneNumbers array need to be inside a custom function? I keep getting array or object error when I add phone numbers as an array (pics attached). What am I doing wrong? https://cdn.discordapp.com/attachments/1238702500362850374/1238702500568105011/2024-05-11_14_00_40-Window.png?ex=66403f1a&is=663eed9a&hm=095aa9802e0e47461dcca3576bda1c7d83ee1304eeb978a4c1a71cce39fd6b45& https://cdn.discordapp.com/attachments/1238702500362850374/1238702500870230016/2024-05-11_14_00_34-Window.png?ex=66403f1a&is=663eed9a&hm=a918046ecd718251270e8e44575c00ba6b59983dd2ccc0de96609135ed699d8b&
v
Hi @Mrpoopybutthole, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Function Calling]() * [Call Forwarding]() * [List Calls]() * [Create Phone Call]() -----------------------------
### Answer Yes, it is possible to forward calls to regular numbers using the inbuilt
CallTransfer
function and the
forwardingPhoneNumbers
array with Vapi. You do not need to use Twilio externally for this, as Vapi can handle call forwarding internally. The
forwardingPhoneNumbers
array does not need to be inside a custom function; it can be directly specified in your assistant's configuration. For configuring call forwarding, you could use the
forwardingPhoneNumbers
attribute to define an array of phone numbers for call forwarding, which allows you to direct calls to different departments or individuals based on the conversation context [(1)]() . If you're encountering an array or object error when adding phone numbers as an array, ensure that the format you are using matches the expected JSON structure. Here's an example of how the
forwardingPhoneNumbers
array could be structured:
Copy code
json
{
  "forwardingPhoneNumbers": [
    {
      "number": "+11234567890",
      "message": "Forwarding your call."
    },
    {
      "number": "+10987654321",
      "message": "Redirecting your call to another representative."
    }
  ]
}
Make sure that: - Each phone number is correctly formatted and includes the country code. - The JSON structure is valid without any missing commas or braces. If you continue to face issues, double-checking the JSON format and ensuring it matches the expected schema might help resolve the array or object error you're encountering.
Got it. Tagging @User for additional help.
m
How does function calling look on prompt? @User
v
Glad I could be helpful. Feel free to create a new thread with any new questions you may have.
s