Vapi Support Bot
03/25/2025, 4:55 PMCalledVia
and ForwardedFrom
parameters from Twilio webhooks at the Vapi layer.
Looking at how Vapi processes Twilio webhook data, I can see that when handling inbound calls, only parameters like Caller
, CallSid
, To
, and From
are typically extracted from the Twilio request body, but not CalledVia
or ForwardedFrom
. Here's a snippet of how Vapi processes Twilio data:
python
def twilio_inbound_call(request_body):
"""Receive Twilio incoming call webhook and forward it to Vapi."""
Caller = request_body.get("Caller", "")
CallSid = request_body.get("CallSid", "")
To = request_body.get("To", "")
From = request_body.get("From", "")
Your approach to intercept the Twilio webhook on your server first is the correct solution. Instead of auto-registering your Twilio number with Vapi, you can:
- Set up your own webhook endpoint first
- Process the call as needed (capturing the CalledVia
and ForwardedFrom
parameters)
- Forward to Vapi using TwiML when required
This way, you can extract the parameters you need and pass them along to Vapi when forwarding the call.
Is there anything else you'd like to know about handling these Twilio parameters with Vapi?
Sources:
- [Twilio inbound call code](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1343574701909344297)
- [Intercepting and Forwarding Calls to Vapi](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1343397177182912553)Vapi Support Bot
03/26/2025, 10:25 AMKings Big
03/26/2025, 10:55 PM