optimistic-gold
optimistic-gold17mo ago

How do I configure forwardingPhoneNumbers array?

The documentation from https://docs.vapi.ai/call_forwarding doesn't explain it.
29 Replies
Ask Inkeep
Ask Inkeep17mo ago
Hi @rahtid, 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: * Call Forwarding * Function Calling * Inbound Support Example * Outbound Sales Example -----------------------------
Ask Inkeep
Ask Inkeep17mo ago
Answer To configure the forwardingPhoneNumbers array for call forwarding in Vapi, you can define an array of phone numbers you wish to forward calls to. This setup allows dynamic call forwarding based on the conversation context or other criteria during the call. The configuration looks like this:
{
"forwardingPhoneNumbers": [
{
"number": "+17775551212",
"message": "Hello, world!"
},
{
"number": "+17775551213",
"message": "Hello again!"
}
]
}
{
"forwardingPhoneNumbers": [
{
"number": "+17775551212",
"message": "Hello, world!"
},
{
"number": "+17775551213",
"message": "Hello again!"
}
]
}
Each object in the forwardingPhoneNumbers array can include a phone number (in E.164 format) and an optional message that might be played or used when forwarding to that number. You also need to instruct your assistant on when and how to use these numbers dynamically during the call (1) . Remember, this configuration allows you to set up multiple forwarding options and dictate the conditions under which each number should be used, enhancing the flexibility of your call flows.
optimistic-gold
optimistic-goldOP17mo ago
Where do i put that configuration?
Ask Inkeep
Ask Inkeep17mo ago
Got it. Tagging @Vapi Team for additional help.
rival-black
rival-black17mo ago
Put this using API Call.
optimistic-gold
optimistic-goldOP17mo ago
If I were to create a custom function to transfer calls since the forwarding number is dynamic, what would the json look like in the API call? I've been trying to figure this out but can't get it to work.
rival-black
rival-black17mo ago
You don't need to create a custom function to transfer calls. This is already in their in the API you just need to use it.
optimistic-gold
optimistic-goldOP16mo ago
I tried that too but it wouldn't work when i try to dynamically change the forwarding phone number. It only works when a static number is there. @Sahil Here is a script section of my prompt. The Voice assistant say they will transfer but nothing happens and I am calling from my cell phone. Script
Customer: I want to make a payment. You: I can help with that. Could you please tell me which insurance company your policy is with? Example 1 Customer: Mercury Insurance. ###Function Call Use the transferCall function with forwardingPhoneNumber as +18005033724.
rival-black
rival-black16mo ago
https://dump.sahilsuman.me/transfertool.txt This is the transfer tool configuration that I used to transfer the call dynamically and it worked flawlessly. Whenever you are asked to forward the call then use transferCall then you need to ask whom should I forward to i) Sahil Forwarding Number - 1 ii) Sahil Forwardind Number - 2 iii) Sahil Forwarding Number - 3 This was my exact prompt.
optimistic-gold
optimistic-goldOP16mo ago
@Sahil Thank you so much!
rival-black
rival-black16mo ago
Also, do note that all the forwarding numbers were from twilio.
optimistic-gold
optimistic-goldOP16mo ago
@Sahil So how do I modify the built in transferCall function with this configuration? I only know how to do this for custom functions.
rival-black
rival-black16mo ago
@Henryk will be posting a tool calling tutorial pretty soon. It’s up.
rival-black
rival-black16mo ago
Henryk | AI Automation
YouTube
How to Build Powerful Tools in Vapi - Step-by-Step Tools Tutorial
Hey folks! In this video, I'm diving into how to create tools within Vapi, complete with a live demo and step-by-step guide. You'll see exactly how to set up your Vapi assistant with powerful, custom tools. FYI, you can actually use dynamic variable to get the time inside of your assistant, but I just chose to use this for the sake of the examp...
optimistic-gold
optimistic-goldOP16mo ago
@Sahil and @Henryk Got it working. Thank you very much for the help! @Sahil Did something change with transferCall? I can't get it to work anymore. One of the many that failed: Call ID: 84c22afe-86c7-4113-83d9-b54b0c6401a6 A successful one: Call ID: f2f4a056-b217-4675-9266-8b43cd202ac6
rival-black
rival-black16mo ago
Nope, nothing changed. In the second call, assistant-forwarded-call but not on the first one. You need to improve your prompt to fix this issue. You need to explicitly tell when to trigger the transfer call with which number
optimistic-gold
optimistic-goldOP16mo ago
@Sahil I made some tweaks and it still doesn't work. I don't know how to improve the prompt more; Script
Customer: I want to make a payment, file a claim, or I need to modify my insurance policy. You: I can help with that. Which of these insurance companies are you with? Mercury, Safeco, Travelers, Mapfre, Liberty Mutual. Example 1 Customer: Mercury. Function Call When customer says Mercury, use the transferCall function with forwardingPhoneNumber as +18005033724. Example 2 Customer: Safeco. Function Call When customer says Safeco, use the transferCall function with this phone number: +18003323226. Example 3 Customer: Travelers. Function Call When customer says Travelers, use the transferCall function with this phone number: +18008425075.
rival-black
rival-black16mo ago
Let's get on a one-on-one call and let's see what I can do to fix this issue.
optimistic-gold
optimistic-goldOP16mo ago
Thank you Sahil!
rival-black
rival-black16mo ago
@rahtid I just checked with the team. It was a hallucination issue but the assistant did transfer the call. Can you try to play around the prompt? Also, try to use gpt-4 turbo
optimistic-gold
optimistic-goldOP16mo ago
@Sahil thanks for the update, any suggestions on how to improve the prompt? I honestly don’t know how to improve it further. I’ll also try 4 turbo. Still doesn't work with 4 turbo. Call IDs: 57e9c960-0508-4a87-b0df-979ef377f6b4 c1da43b2-91cb-4ccf-9d1e-8778c39c40aa b9d09caf-89bf-4ff9-99fe-90891d268dc9
optimistic-gold
optimistic-goldOP16mo ago
So for the ones that failed it shows this in logs:
No description
optimistic-gold
optimistic-goldOP16mo ago
For the one that was successful yesterday during our call: Call ID: 65b12736-084c-4289-b68c-2b5193533546
No description
rival-black
rival-black16mo ago
Just try it once but don't end the call wait till end until it says something like transfer call and wait for 30s
optimistic-gold
optimistic-goldOP16mo ago
ok
optimistic-gold
optimistic-goldOP16mo ago
No description
optimistic-gold
optimistic-goldOP16mo ago
@Sahil I think I may have figured out the issue but not completely sure. I removed the knowledge base config from the json and the transfer calls are now working.
rival-black
rival-black16mo ago
Awesome.

Did you find this page helpful?