Hey qucik question
# support
k
how to handle if i create a twilio call from my twilio number to a vapi assistant (with twilio sdk /api) and after the end of the call to get the call details from vapi api i tried to match with call sid but it seems different from the one i get from twilio sdk ?
v
Hey there! 👋 I understand you're having trouble matching the Call SID from your Twilio SDK with the one in Vapi when retrieving call details. This is actually a common issue when integrating these two platforms! ## Why the Call SIDs are different The Call SID discrepancy occurs because when a call is transferred from Twilio to Vapi, Vapi assigns its own call ID which is different from the Twilio call SID. According to [information I found](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336707026536894534), Vapi stores the relationship between the two IDs, but they are indeed different identifiers. ## Methods to match calls between Twilio and Vapi Here are some approaches you can use to correlate the calls: 1. **Use Custom SIP Headers**: The most recommended approach is to use a custom SIP header (like
X-Call-ID
) to pass a unique identifier between call legs. According to [this source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1329106554041012265), you can: - Pass the Twilio Call SID in a custom SIP header during the initial call - When Vapi triggers a
transfer-destination-request
event, extract the
X-Call-ID
from the SIP headers - Use this extracted ID to correlate the new Twilio Call SID with the original one 2. **Generate and Track Your Own Call IDs**: As mentioned in [this documentation](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1343397177182912553), you can generate and track your own call IDs to maintain consistency across platforms. 3. **Use the Vapi API**: You can retrieve call details using the Vapi API's "GET Get Call" endpoint as noted in the [Vapi API reference](https://docs.vapi.ai/api-reference/squads/create). The Vapi system stores the relationship between its call ID and the Twilio call SID.
4. **DTMF Tones**: For a more creative solution, you could use DTMF tones to pass an ID to Vapi when calling a Vapi phone number, as suggested in [this resource](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342459464346767492). Is there a specific method you'd like me to elaborate on further? I'd be happy to provide more details! Sources: - [Discord Thread on Call Leg Association](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1329106554041012265) - [Discord Thread on Custom Call IDs](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1343397177182912553) - [Vapi API Reference](https://docs.vapi.ai/api-reference/squads/create) - [Discord Thread on DTMF Tones](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342459464346767492) - [Discord Thread on Vapi and Twilio Call ID Relationship](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336707026536894534)
v
checking if this is resolved/solved for you?