Hey everyone, I'm building an AI receptionist in VAPI. The receptionist answers inbound calls, greets the caller, finds out which department they need, and then transfers them to that department's phone number.
The flow I need is:
Caller rings in
AI receptionist answers and asks which department they need
Receptionist transfers to that department's number
If the department answers great, call connects
If the department does not answer after 15 seconds cancel the transfer and return the caller back to the AI receptionist who then takes a message
The transfer itself works perfectly. The destination rings every time. The problem is step 5 — cancelling the transfer and returning to the assistant.
I have tried every cancel method I can find and all fail with "failed to route call":
type: "hangup", leg: "destination" — failed
type: "cancel-transfer" — failed
type: "transfer", transferPlan: { mode: "cancel" } — returns "property transferPlan should not exist"
The controlUrl works fine for initiating the transfer but every command sent to it after the transfer fires returns "failed to route call". It seems like the controlUrl becomes invalid or the assistant is detached the moment the blind transfer executes.
Has anyone successfully built a transfer with fallback return to assistant? What is the correct architecture for this? Any working production examples would be really helpful.