URGENT: FALLBACK NUMBER NOT WORKING
# support
j
I have setup a FALLBACK phone number for cases where the assistant is not available. We have just experienced a failure in our webhook that provides assistant-requests but vapi did not transfer the call to the fallback number. Call Id: cef0d7e8-6982-4ae8-87b9-01a9fff516fe Error: "An error occurred in this call: assistant-request-returned-error" @Shubham Bajaj @Vapi
v
To ensure calls are transferred to a fallback number when an assistant-request error occurs, add an assistant hook like this to your configuration:
Copy code
json
"hooks": [{
  "on": "call.ending",
  "filters": [{
    "type": "oneOf",
    "key": "call.endedReason",
    "oneOf": ["assistant-request-returned-error"]
  }],
  "do": [{
    "type": "transfer",
    "destination": {
      "type": "number",
      "number": "+YOUR_FALLBACK_NUMBER"
    }
  }]
}]
Replace
+YOUR_FALLBACK_NUMBER
with your actual fallback number. This will automatically transfer calls to your fallback number if the assistant-request fails with the specified error. Reference: [Assistant hooks documentation](https://docs.vapi.ai/assistants/assistant-hooks) Source: - [Assistant hooks documentation](https://docs.vapi.ai/assistants/assistant-hooks)
To ensure calls are transferred to a fallback number when an assistant-request webhook fails, add an assistant hook that triggers on
call.ending
with a filter for
assistant-request-returned-error
. Example configuration:
Copy code
json
{
  "hooks": [{
    "on": "call.ending",
    "filters": [{
      "type": "oneOf",
      "key": "call.endedReason",
      "oneOf": ["assistant-request-returned-error"]
    }],
    "do": [{
      "type": "transfer",
      "destination": {
        "type": "number",
        "number": "+1234567890"
      }
    }]
  }]
}
This will automatically transfer the call to your fallback number if the assistant-request fails. For more details, see the [assistant hooks documentation](https://docs.vapi.ai/assistants/assistant-hooks#example-transfer-on-pipeline-error). Source: - [Assistant hooks](https://docs.vapi.ai/assistants/assistant-hooks#example-transfer-on-pipeline-error)
j
Where should this configuration be added? Remember we are using DYNAMIC assistants.
And will it also work for VAPI provided phone numbers?
s
"An error occurred in this call: assistant-request-returned-error" Are you serving the Agent config via your own server when vapi makes the assistant request yeah? @Jonas
j
Yes, I am. This is a dynamic assistant.
@User @Shubham Bajaj ?
s
@Jonas your config has an issue with it, are you logging the configuration and making sure it matches with. What is your goal with the fall back number? When YOUR assistant is not available it's supposed to redirect to a different number?
3 Views