来自应用程序的呼出电话的已应答通知-TWILIO [英] Answered Notification for Outbound call from an App - TWILIO

查看:121
本文介绍了来自应用程序的呼出电话的已应答通知-TWILIO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于从应用程序到号码的拨出电话,
 有两条腿-一条在我的浏览器与Twilio之间,另一条在Twilio与要拨打的号码之间
 我可以设置一个Webhook来触发第二回合的每次callstatus值更改(尤其是在通话状态"正在进行时)以及如何触发吗?
这是必要的,这样我才可以在客户拿起电话后启动计时器并显示保持按钮
任何其他实现这一目标的想法也欢迎您.预先感谢.

For Outbound Calls From An App to a Number,
  There are two legs - One between my browser and Twilio and the other between Twilio and the number to be dialled
  Can I set a webhook to trigger, on each callstatus value change (especially when the Call Status is in-progress) of the second leg and How?
This is necessary so that I can start the timer and show hold button only after the customer picks up the phone
Any other idea to achieve this also Welcome. Thanks in advance.

推荐答案

此处是Twilio开发人员的福音.

Twilio developer evangelist here.

当您从 Twilio客户端拨出时,您可以发送参数进入请求(例如数字),然后Twilio将向您的应用程序发送带有这些参数的webhook,以查找下一步要执行的操作.要拨打电话号码,您可以使用 <Dial> 动词并嵌套一个其中的 <Number> .

When you dial out from 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> within it.

使用<Number>,您可以在发生某些事件时注册Webhook回调.为此,您可以设置 statusCallback属性到将接收回调的URL.默认情况下,statusCallback URL仅在呼叫结束时接收到completed事件,但是您可以使用

With a <Number> you can register for webhook callbacks when certain events take place. You do so by setting a 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.

您也想订阅的事件称为已回答",而您需要的TwiML是:

The event you want to subscribe too is called "answered" and the TwiML you need is:

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

让我知道这是否有帮助.

Let me know if that helps at all.

这篇关于来自应用程序的呼出电话的已应答通知-TWILIO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆