Assistant forwarding calls instead of answering
# support
b
I provide my assistant a forwardingPhoneNumber an instruction in the prompt to "to transfer the call to a live person, use the transferCall function." I provide my assistant config via a server-url configured on the phone number. I see the webhooks where my server is providing my assistant config successfully - but the system is forwarding the call almost immediately after receiving the config. Can you please help me figure out what I might be doing wrong?
this is a recent assistant request where I saw this: { "message": { "timestamp": 1742274791165, "type": "assistant-request", "call": { "id": "b15ecae3-3600-4e6e-ab2a-bc2ec904b80d", "org_id": "0bf4bf78-c010-4b01-9c4d-c08d06f23700",
a
Hey! To help track down this issue, could you share: - The call ID This would really help us figure out what went wrong!
b
yup, it's "b15ecae3-3600-4e6e-ab2a-bc2ec904b80d" @Shubham Bajaj
a
Hey Blehh, We aren't able to locate that call ID, do you have one that is within the last 30 days? Thank you for your patience while we resolve this
b
Here's another one from just now:
76709165-e3ef-497b-be27-fd74e2713bd7
It might be relevant that the forwarding number is another vapi number with a static assistant assigned via the ui. I had tested the assistant config successfully with a NOT vapi forwarding number in the past. In the webhook logs I see a successful assistant request/response immediately followed by a status update that the call is being forwarded. I don't see a call log for the forwarded call, but then I do see a call log for the forwarded-to bot.
but ☝️ is the call id from the webhook log of the assistant request + status update
I just tried again with an external forwarding number in call id
ba7e83bf-6253-4478-86a3-7fe54acb6c96
but it also immediately forwarded 🤷‍♂️
Hey @Mason or @Shubham Bajaj any ideas on what I can look at or get you here? If it helps this is the phoneNumberId 3d7474c4-bb61-498b-9980-b8bf7f4eb607
a
Your current response has all the assistant configuration properties directly at the root level of the JSON, rather than nested inside an assistant property. Based on the AssistantRequestMessageResponse class definition, the response should have a specific format. The correct structure should be:
Copy code
{
  "assistant": {
    "voice": {...},
    "model": {...},
    "recordingEnabled": true,
    ...
  }
}
Give it a try and let me know how it goes for you
b
thanks @Shubham Bajaj that fixed it! i'm surprised that vapi processed my response. it looks like vapi still read my forwardingPhoneNumber for the forwarding, but i'm not really seeing which schema that would've matched 🤔
a
> it looks like vapi still read my forwardingPhoneNumber for the forwarding, but i'm not really seeing which schema that would've matched @blehh could you share the call ID so I could take a look?
b
yeah this was the last one before i changed my server response schema:
06f29089-1c9a-4ddd-a57c-05c9d566f183
a
I just looked into the call logs for the shared call ID. You are still returning the wrong response format for the assistant request. That's why it's going to the forwarding phone number. So I suggest you look at the above shared format and return the assistant correctly according to it, and then it will work as you are expecting it out to work.