Handle assistant-request type without returning an...
# support
m
Is there a way to hang up or preferably forward the call that comes INBOUND instead of returning an assistant to the message type assistant request by vapi? I need to handle a process (with other logic) that if a call comes inbound to a twilio number that is imported into vapi, it will hang up or forward it to another number. Twilio fallback webhook url is not an option because the request from vapi to twilio doesn't actually fail, it responds "Couldnt get assistant". I need to handle this without returning a valid assistant payload. This is ultimately needed to handle the case of if my calls exceed my concurrent call limit
v
@MikeKraz Certainly! To forward an inbound call to another number without returning a valid assistant payload, you can use VAPI's voice capabilities to create a custom logic that will handle the incoming call and redirect it as needed. Here's a high-level overview of how you can set this up: 1. **Inbound Call Handling**: When a call comes in, your VAPI application will receive a webhook notification. 2. **Custom Logic**: Within your application, you'll need to implement the logic to handle the call. This logic will decide whether to forward the call or hang up. 3. **Forwarding the Call**: If the decision is to forward the call, you can use VAPI's
connect
action within the NCCO (Nexmo Call Control Object) to forward the call to the desired number. 4. **Hanging Up the Call**: If the decision is to hang up, you can use the
hangup
action within the NCCO. Here's an example of an NCCO that forwards a call:
Copy code
json
[
  {
    "action": "connect",
    "from": "VAPI_NUMBER",
    "endpoint": [
      {
        "type": "phone",
        "number": "DESTINATION_NUMBER"
      }
    ]
  }
]
And here's an example of an NCCO that hangs up a call:
Copy code
json
[
  {
    "action": "hangup"
  }
]
Please note that as of my knowledge cutoff in April 2023, VAPI does not support hanging up the call directly without returning an NCCO. However, you can use the
hangup
action in the NCCO to achieve this. If you need to implement this logic and require assistance with the code or setting up the webhook, please let me know, and I can guide you through the process. If there are any updates or changes to the VAPI capabilities beyond my knowledge cutoff, 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
Just use your own twilio account and handle the logic from there itself like if they called your number forward it your human agent
2 Views