Human Handoff
# support
a
How to havr the AI agent transfer a call ( human hand off ) on certain conditions
v
Hi @Abed Malak, 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 Ended Reason]() * [Prompting Guide]() * [Implementing Realtime Conversation]() * [Inbound Calling]() -----------------------------
### Answer To achieve human handoff or transfer a call under specific conditions using Vapi, the AI agent can utilize the
transferCall
function. This function is available when a
forwardingPhoneNumber
is defined for the assistant. The
transferCall
function allows the assistant to transfer the call to the specified forwarding number. Here is an example configuration:
Copy code
json
{
  "model": {
    "provider": "openai",
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "system",
        "content": "You are an assistant at a law firm. When the user asks to be transferred, use the transferCall function."
      }
    ]
  },
  "forwardingPhoneNumber": "+16054440129"
}
[(1)]() This setup can be tailored within the assistant's configuration to trigger the call transfer under the conditions you specify, such as specific user requests or other predetermined criteria.
s
Using forwardingPhoneNumber.
k
@Sahil Is there a better way to do the handoff, instead of call forwarding?? Like between Twilio and Google Dailogflow, there is seamless stream integration between them. Where if the Google Dialogflow fails to handle, then we don't need to do the call forwarding it hands of to the twilio in a same call. For reference https://www.twilio.com/docs/voice/twiml/stream/connect-to-dialogflow, this is how its done. So this kind of integration is really helpful. As to achieve this with VAPI i have to use 2 twilio numbers for each use cases and managing that is troublesome in the production.