Hi guys, Is it possible to transfer call to twilio...
# support
a
Hi support team, Is it possible to transfer call twilio phone number from vapi using SIP URI? The workflow is like this: 1. A user call vapi ai agent. 2. The agent
transfer the call
to twilio. 3. In twilio web hook, we do sth. 4. Then twilio transfer call to vapi ai agent again. Is it possible to transfer call using SIP URI?
v
message has been deleted
@adam Yes, it is indeed possible to transfer a call to a Twilio phone number using the SIP Trunking feature of Twilio. With VAPI, you can set up a call flow that includes a transfer to a SIP URI provided by Twilio's SIP Trunking. You would need to configure your Twilio SIP Trunk to accept incoming calls and then use the appropriate VAPI action to redirect the call to the SIP URI associated with your Twilio number. If you need guidance on how to set this up or if you have any specific questions about the configuration, please let me know, and I'll be happy to assist you further!
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
a
1. I made SIP domain in twilio(Voice/Manage/Sip Domains): SIP URI: xxx.sip.twilio.com IP ACCESS CONTROL LISTS: 44.229.228.186 / 32, 44.238.177.138 / 32 CREDENTIAL LISTS: username, password A CALL COMES IN: webhook SIP Registration: Enabled 2. And I made a call transfer function in Vapi using the following command:
Copy code
curl -X POST "https://api.vapi.ai/tool" \
-H "Authorization: Bearer xxx" \
-H "Content-Type: application/json" \
-d '{
  "type": "transferCall",
  "async": false,
  "function": {
    "name": "xxx-transfer"
  },
  "destinations": [
    {
      "type": "sip",
      "sipUri": "sip:username@xxx.sip.twilio.com",
      "description": "destination",
      "message": "destination",
      "transferPlan": {
        "mode": "warm-transfer-wait-for-operator-to-speak-first-and-then-say-message",
        "message": "message"
      }
    }
  ]
}'
3. And I called the
xxx-transfer
tool in Vapi assistant's prompt. The purpose is to send some parameters to twilio webhook. I want to know is it right way. And if it's right, how can we register SIP URI? Thank you in advance.
@Shubham Bajaj could you help me?
y
I am having the same issue
a
@User
a
I've already read
s
@adam yes it is possible to transfer calls using SIP.
What's your current blocker?
a
is this right way?
s
Yes, what exactly issue your facing can't do call transfers?
a
the call doesn't transfer
this is log
and the call doesn't transfer and ends
s
@adam call id please.
@adam can you check in your twilio logs what you see over there for this twilio call sid CA770fc16c4665fbf7974a4c33e9ab63df
logs
šŸ”µ 08:05:39:596 Transferring Twilio Call...TwiML:sip:testuser@saxxxxent-test.sip.twilio.com
a
@User I cannot find Call log which sid is CA770fc16c4665fbf7974a4c33e9ab63df
@Shubham Bajaj
s
@adam This is twilio call SID, you have to check for this in your own twilio account call logs.
a
i've checked here
still cannot find
s
@adam let me confirm with team if we do phone-number to SIP transfer I'm not sure right now, and yeah you should be finding it in logs if you have used own number.
a
I cannot find it.
I will wait, please let me know.
y
I see so many videos on youtube talking abouit this capability on vapi but none of them actually showcase the whole thing being built
a
@Shubham Bajaj
@Shubham Bajaj when can we get the answer?
s
@YinYang your issue was different and transfer is working for you.
@adam Yes, we do allow numbers from SIP transfers. I just confirmed that calls are successfully transferred from our side. Can you try it with another call?
a
@Shubham Bajaj i tried again but it still doesn't work
this is vapi tool i created. is it right?
@Shubham Bajaj please let me know
s
@adam can you share the call id?
a
@Shubham Bajaj
s
logs
šŸ”µ 20:57:40:426 Transferring Twilio Call...TwiML:sip:testuser@spt-test.sip.twilio.com šŸ”µ 20:57:40:570 Live Call Manager Ending...(assistant-forwarded-call) "phoneCallProviderId": "CA57cef285d40beaa5e77637e7c474c63b" @adam can you check again in twilio logs what do you find over there?
a
@Shubham Bajaj I cannot find anything
s
@adam I just remembered that you need to enable SIP Refer in your Twilio dashboard, otherwise transfers won't work. Have you enabled it? If not, could you please enable it and give it a try? Also, I will be available on Discord today for an hour of live support if you'd like to continue troubleshooting there.
y
yo I reccomend hopping on a support call with one of the support members. Things move alot faster. It's working for me now
s
@adam a gentle reminder did you got chance, to check if SIP Refer is enabled for your account inside twilio dashboard?
a
s
@adam please refer this guide https://www.twilio.com/docs/sip-trunking/call-transfer and let me know how it goes!!
a
@User SIP Trunking provides connectivity for IP-based communications infrastructure to connect to the PSTN. But I need to handle the forwarded call in webhook. I think we can do this in "Voice/Manage/SIP domains" because this page has a setting for webhook like this image. I'm not clear what is the difference between SIP domains and SIP Trunking. Can we trigger this webhook in Vapi? This is my question. Thank you. https://cdn.discordapp.com/attachments/1328481118697164891/1329831812545118421/image.png?ex=678bc5e3&is=678a7463&hm=0400f9139d180cd3c6ee55e4fca12cd07ea8cc14a3d3b6d420a47b73eb8bb081&
s
@adam SIP domains and SIP trunking work together to manage your VoIP communications. SIP domains handle the internal organization and routing of SIP traffic within your network, while SIP trunking connects this internal system to external networks, including the Public Switched Telephone Network (PSTN). You cannot trigger the webhook from Vapi instead when a call comes in your this webhook will be used for handling and continuing the call.
Now regarding the call forwarding handling on your side you can use server event
phone-call-control
and then it will be your responsibility on how to handle the call forwarding.
a
@Shubham Bajaj thank you and what is server event
phone-call-control
?
s
The phone-call-control server event delegates the responsibility for handling forward to your server instead of relying on the Vapi.
8 Views