How do I configure forwardingPhoneNumbers array?
# support
r
The documentation from https://docs.vapi.ai/call_forwarding doesn't explain it.
v
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]() -----------------------------
### 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:
Copy code
json
{
  "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.
r
Where do i put that configuration?
v
Got it. Tagging @User for additional help.
s
Put this using API Call.
r
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.
s
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.
r
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.
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.
r
@Sahil Thank you so much!
s
Also, do note that all the forwarding numbers were from twilio.
r
@Sahil So how do I modify the built in transferCall function with this configuration? I only know how to do this for custom functions.
s
@Henryk will be posting a tool calling tutorial pretty soon.
It’s up.
r
@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
s
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
r
@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.
s
Let's get on a one-on-one call and let's see what I can do to fix this issue.
r
Thank you Sahil!
s
@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
r
@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
s
Just try it once but don't end the call wait till end until it says something like transfer call and wait for 30s
r
ok
@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.
s
Awesome.
2 Views