Callback service on the website using Twilio

2019-09-09 21:07发布

Let's say I need to implement a callback service on a website. I'm curious if it's possible to develop it using Twilio.

For example, if a website visitor provides his mobile phone number from one side, from another side I have a manager using his web CRM application. Is it possible to:

  1. Make a call (using WebRTC?) to a manager
  2. When the manager replies the incoming call, call to the website visitor (on his mobile phone)
  3. Connect both sides together

I know there are lots of ready-to-use callback services, I'm just curious how it works under the hood.

1条回答
在下西门庆
2楼-- · 2019-09-09 22:07

Twilio developer evangelist here.

This is a feature we call Click to Call. Here's how it would work with Twilio:

  1. The visitor provides his number through a form on the site
  2. Generate a call to the manager using the Twilio REST API
  3. When the call connects to the manager, dial the visitor.
    • This is achieved using TwiML
    • Whent the call connects, Twilio makes an HTTP request to a URL you provide in step 2
    • That URL needs to respond with TwiML, which is a subset of XML to tell Twilio what to do with the call
    • In this case the TwiML would be to <Dial> the visitors number
  4. When the visitor answers the two are connected

This is a high level view of it, we also have a tutorial walking you through Click to Call with Twilio (this is the Python version, but there are others available too) which I recommend you take a look at.

Let me know if this helps at all.

查看更多
登录 后发表回答