Synchronizing Call Data Between VAPI and Twilio St...
# support
k
We currently use VAPI as an agent in some calls. However, we are unsure how VAPI and Twilio integrate when a call transfer occurs. Specifically, we want to link the CallSid from the VAPI call with the CallSid generated by Twilio when the call is transferred. The system works as follows: initially, VAPI handles the call as an agent, and if it cannot resolve the issue, it transfers the call to Twilio, specifically to a Twilio Studio voice IVR flow, which follows a set of rules before forwarding the call to Flex. What we need is a way to match the incoming call from VAPI with the Twilio Studio flow. The challenge is that the CallSid generated by VAPI and the one generated by Twilio are completely different. The only way we currently identify that the call came through VAPI is by the VAPI phone number itself, but this lacks the granularity we need. We are looking for a solution to match the VAPI call and the Twilio flow on a 1-to-1 basis. Is there any way to send metadata during the call transfer to Twilio, such as a UUID, that would allow us to establish this match?
v
@KishinNext Absolutely, you can send metadata during the call transfer to Twilio to help match the VAPI call with the Twilio flow. When transferring a call from VAPI to Twilio, you can include custom parameters in the payload of the transfer request. These parameters can then be accessed in Twilio Studio and used to link the calls. Here's how you can achieve this: 1. When initiating the transfer from VAPI to Twilio, include a unique identifier, such as a UUID, in the transfer request's parameters. This UUID should be generated by your system and associated with the VAPI CallSid. 2. In the Twilio Studio flow, you can retrieve this UUID from the incoming parameters. Twilio Studio allows you to access parameters sent with the incoming call using the
{{widgets.YOUR_WIDGET_NAME.incoming.parameters.YOUR_PARAMETER_NAME}}
syntax. 3. Store this UUID along with the Twilio CallSid in your system. This will create a link between the VAPI call and the Twilio call. 4. Use this UUID to match the VAPI call with the Twilio flow on a 1-to-1 basis. If you need to set this up or require further assistance with the implementation, please let me know, and I can guide you through the process or provide more detailed instructions.
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
k
How to create this dynamic UUID when a call is requested?
17 Views