来自应用程序的出站呼叫的应答通知 - TWILIO

Answered Notification for Outbound call from an App - TWILIO

对于从应用程序到号码的出站呼叫,
有两条腿——一条在我的浏览器和 Twilio 之间,另一条在 Twilio 和要拨打的号码之间
我可以设置一个 webhook 来触发,在第二条腿的每个 callstatus 值更改时(尤其是当呼叫状态正在进行时)以及如何?
这是必要的,这样我才能启动计时器并仅在客户拿起 phone
后显示保留按钮 任何其他实现此目的的想法也欢迎。提前致谢。

此处为 Twilio 开发人员布道师。

当你从里面的Twilio Client you can send parameters into the request, such as the number, then Twilio will send your application a webhook with those parameters to find out what to do next. To dial a number, you would use the <Dial> verb and nest a <Number>拨出的时候。

使用 <Number>,您可以在某些事件发生时注册 webhook 回调。您可以通过设置 statusCallback attribute to the URL that will receive the callback. By default the statusCallback URL will only receive the completed event when the call finishes, however you can register for more events using the statusCallbackEvent attribute.

您也想订阅的事件名为 "answered",您需要的 TwiML 是:

<Response>
  <Dial>
    <Number statusCallback="http://example.com/calls/callback" statusCallbackEvent="answered">
      NUMBER TO DIAL
    </Number>
  </Dial>
</Response>

如果有帮助请告诉我。