lievcin
03/14/2025, 10:22 AMcall = twilio_client.calls.create(
url=webhook_url,
to=phone_number,
from_=TWILIO_PHONE_NUMBER,
status_callback=TWILIO_STATUS_CALLBACK_URL,
status_callback_event=["initiated", "ringing", "answered", "completed"],
record=True,
recording_track="both",
recording_channels="dual",
recording_status_callback=TWILIO_RECORDING_STATUS_CALLBACK_URL,
)
but when I try sending these parameters to VAPI the parameters are not recognised. Is there a way to pass this along? Alternatively to configure in UI, maybe this could be done at Assistant level?
payload = {
"assistantId": VAPI_ASSISTANT_ID,
"customer": {
"name": customer_name,
"number": customer_number
},
"statusCallbackUrl": TWILIO_STATUS_CALLBACK_URL,
"phoneNumberId": VAPI_PHONE_NUMBER_ID,
"recording": {
"enabled": True,
"dualChannel": True, # Ensure dual-channel recording
"statusCallbackUrl": TWILIO_RECORDING_STATUS_CALLBACK_URL
}
}
async with httpx.AsyncClient() as client:
try:
response = await client.post(VAPI_API_URL, json=payload, headers=headers)
Thank you!Vapi Support Bot
03/14/2025, 10:23 AMartifactPlan
in your assistant:
json
{
"artifactPlan": {
"recordingEnabled": true,
"transcriptPlan": {
"enabled": true
}
}
}
When integrating Twilio with VAPI, you'll need to:
1. Set up a webhook on Twilio to handle incoming calls
2. Create a VAPI call with phoneCallProviderBypassEnabled: true
3. Establish WebSocket connections for audio streaming
For handling Twilio callbacks, you can configure your backend endpoint like this:
javascript
app.post('/twilio/status', async (req, res) => {
const { CallSid, RecordingStatus } = req.body;
// Handle recording status
console.log(`Recording for Call SID ${CallSid} has status: ${RecordingStatus}`);
res.sendStatus(200);
});
I wasn't able to find specific information about passing Twilio recording parameters directly through VAPI API as you're attempting to do. VAPI seems to handle recordings through its own configuration rather than passing parameters to Twilio.
For your compliance requirements, you might need to:
1. Use VAPI's phoneCallProviderBypassEnabled
mode
2. Set up the WebSocket bridge as shown in the documentation
3. Configure your Twilio webhook to handle the recording parameters separately
Would you like me to provide more details on any specific part of this integration?
Source:
- [VAPI Docs](https://docs.vapi.ai/phone-calling)lievcin
03/14/2025, 10:41 AMVapi
03/15/2025, 9:41 PM