Respond to an `assistant-request` with a call redi...
# support
h
We want to conditionally redirect some calls going to Vapi to another number, and preferrably we could do this without having to wait for the assistant to load in, trigger some user input, then use a tool call. Ideally we could return a certain response from the
assistant-request
which would cause the call to redirect instantly. Is this possible?
v
@heebers Yes, it is possible to conditionally redirect calls in VAPI without waiting for the assistant to load. You can achieve this by implementing logic on your server that handles the
assistant-request
message. When your server receives an
assistant-request
, you can check the caller's phone number or any other relevant conditions and decide whether to return an assistant's details or a response that instructs VAPI to redirect the call immediately. If you decide to redirect the call, you can respond with a JSON object that contains the necessary instructions for redirection instead of returning an assistant. The exact structure of this JSON object would depend on the specific capabilities and requirements of VAPI. If VAPI supports such a feature, the response would typically include the target phone number to which the call should be redirected. If you need the exact JSON structure or further assistance on how to implement this, please ask support for more info on this.
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
s
yes can transfer the call but after the user response. because the first message won't allow you to call the tool.
what's is in your mind? it's intresting.
h
we want to have the bot transfer the call immediately if a check on our server-side passes (aka if the number of the caller is in a registry)
we currently have to route this thru to another twilio number to provide that conditional routing, but if we could trigger a forward when responding to the assistant request message, that would remove the need for the extra routing number
s
1. don't set any assistant on vapi 2. vapi will make the request to your server for assistant 3. return the assistant based on number
h
yes, but if the number is in the list then we want it to forward to another number, not an assistant
s
see using assistant this is the only method
h
so the desired workflow is not possible?
s
yes bcoz w/o assistant cannot =, back to twilio flow. Sorry buddy.
11 Views