Rerouting Twilio request to Vapi
# support
s
I'm trying to call the
https://api.vapi.ai/twilio/inbound_call
endpoint but constantly getting
"code": "ConnectionRefused"
Why would this be happening? Does the phone number have to always be registered first with Vapi?
v
It sounds like you're running into a "ConnectionRefused" error when trying to call the
https://api.vapi.ai/twilio/inbound_call
endpoint. Here are some common reasons for this error: 1. **Network Restrictions**: Check if there are any firewall settings or network restrictions that might be blocking the connection to Vapi's servers. 2. **Incorrect Endpoint URL**: Make sure that the endpoint URL is correct and matches the official Vapi documentation. 3. **Service Outage**: Sometimes, there might be temporary service outages on Vapi's side. It's a good idea to check their status page or support for any ongoing issues. 4. **Authentication Issues**: Ensure that your API key and any necessary authentication methods are correctly implemented and active. Regarding your question about phone number registration, you do not need to register your phone number with Vapi to use the Twilio inbound call endpoint. You can integrate your Twilio number with Vapi without needing to port it. Instead, you can set up a webhook to handle calls and process them through Vapi. If you continue to experience issues, feel free to provide more details, and I can help troubleshoot further! 😊 Sources: - [Common Reasons for "ConnectionRefused" Error](https://discord.com/channels/1211482211119796234/1211483291191083018/1341449578100031488) - [Phone Number Registration with Vapi and Twilio Integration](https://discord.com/channels/1211482211119796234/1211483291191083018/1334941334368419850)
s
What are the required headers, params, body for this endpoint? does it actually need some form of authentication as well? Why is this not in the api documentation
k
Yes, the phone number must be registered with Vapi first. The endpoint requires Twilio signature validation, and The endpoint expects some parameters in the request body from twilio. The "ConnectionRefused" error typically means either: \- The phone number isn't registered with Vapi \- The Twilio signature validation is failing \- The request isn't coming from Twilio This endpoint is designed to be called by Twilio's systems directly, not by your application. That's why it's not in the public API documentation. To properly set this up: 1\. First register your Twilio number with Vapi using either: - Dashboard UI - API endpoint to import Twilio number - You'll need your Twilio Account SID and Auth Token 2\. Configure your Twilio number's webhook URL to point to:
s
Thanks very insightful
k
Marking this ticket as Solved ✅
f
Make sure it's set to a POST request rather than GET. Otherwise, you might get this when you call it (auto response) "We are sorry, an application error has occured, goodbye""