Manuel Saelices
01/15/2025, 3:15 PMsip:somusername@sip.vapi.ai
), we cannot make VAPI to forward back the call using SIP:
https://cdn.discordapp.com/attachments/1329106554041012265/1329106554330550334/vapi-sip-outbound.png?ex=67892270&is=6787d0f0&hm=715fdef6951f247c0eba29b14a34b7c5541c0f02ff6b1cc20bc1188cbf7c0dff&Vapi
01/15/2025, 3:17 PMVapi
01/15/2025, 3:17 PMManuel Saelices
01/16/2025, 11:19 AMVAPI Tech
01/16/2025, 11:51 AMShubham Bajaj
01/16/2025, 4:31 PMManuel Saelices
01/16/2025, 10:21 PMShubham Bajaj
01/17/2025, 10:07 PMShubham Bajaj
01/17/2025, 10:07 PMManuel Saelices
01/17/2025, 10:09 PMManuel Saelices
01/17/2025, 10:09 PMShubham Bajaj
01/17/2025, 10:16 PMManuel Saelices
01/20/2025, 1:48 PM921d59f4-726b-4f0e-9453-cc32ba9b4496
Manuel Saelices
01/21/2025, 4:33 PMShubham Bajaj
01/22/2025, 6:43 AMShubham Bajaj
01/22/2025, 7:15 AMManuel Saelices
01/22/2025, 8:47 AMManuel Saelices
01/22/2025, 8:48 AMreferUrl
to the SIP REFER requestsobberr
01/22/2025, 10:49 AMShubham Bajaj
01/22/2025, 3:47 PMManuel Saelices
01/22/2025, 9:40 PMManuel Saelices
01/22/2025, 9:53 PMManuel Saelices
01/22/2025, 9:53 PMManuel Saelices
01/22/2025, 9:54 PMdee65f9a-b23a-4f72-b47b-7972aa70a1e7
Manuel Saelices
01/22/2025, 9:56 PMManuel Saelices
01/22/2025, 9:57 PMreferUrl
, which is very different as the REFER
verb, which it's passed. @Shubham Bajaj could you please ping to the eng team?Manuel Saelices
01/25/2025, 1:51 PMShubham Bajaj
01/25/2025, 8:06 PMManuel Saelices
01/25/2025, 8:19 PMShubham Bajaj
01/25/2025, 8:25 PMManuel Saelices
01/25/2025, 10:23 PMShubham Bajaj
01/27/2025, 6:48 AMX-Call-ID
) that carries an identifier (e.g., Twilio Call SID for Call Leg 1, such as CAabc).
2. Second Call (VAPI to Destination):
- VAPI forwards the call to the destination (Call Leg 2), creating a new Twilio Call SID (e.g., CAxyz).
- The relationship between these two call legs needs to be established using the identifier passed in the SIP header (e.g., X-Call-ID
).
3. Association Between Call Legs:
- The identifier passed in the SIP header during Call Leg 1 (CAabc) allows the system to associate it with Call Leg 2 (CAxyz).
Possible Solution:-
1. Custom SIP Header:
- Pass X-Call-ID: <unique-id>
in the SIP headers for Call Leg 1.
2. VAPI and Transfer-Destination-Request:
- When VAPI triggers a transfer-destination-request event, your server receives this event.
- The event payload includes the SIP headers, allowing you to extract X-Call-ID
.
3. Transfer and Correlation:
- Use the extracted X-Call-ID
to determine the transfer destination.
- After the transfer is completed and Call Leg 2 is established, correlate the new Twilio Call SID (CAxyz) with the original Call SID (CAabc) using the X-Call-ID
identifier.
Notes
1. This approach works because the custom SIP header (X-Call-ID) acts as the bridge between the two call legs.
2. PSTN to SIP transfer is not available, using Vapi.Shubham Bajaj
01/27/2025, 6:49 AMManuel Saelices
01/27/2025, 7:14 AMManuel Saelices
01/27/2025, 7:16 AMShubham Bajaj
01/27/2025, 8:17 AMManuel Saelices
01/27/2025, 8:23 AMShubham Bajaj
01/27/2025, 8:31 AMManuel Saelices
01/27/2025, 9:41 AMManuel Saelices
01/27/2025, 9:56 AMShubham Bajaj
01/27/2025, 12:36 PM