问题描述
我试图找出一种方法来捕获调用者是否在 TwiML 指令中间挂断电话.如果来电者挂断电话(放弃通话),twilio 会通知应用程序吗?
I am trying to figure out a way to capture if the caller hangs up in the middle of TwiML instructions. If the caller hangs up (abandons the call) does twilio notify the application of such?
我看到状态回调 url 设置,但我只是得到一个已完成"状态.我想知道来电者是否正在聚会中并挂断了 twilio 是否会知道电话已挂断并报告?或者我应该只看到完成"状态,然后确定呼叫是否真正成功完成?
I see the status callback url setting but I just get a "completed" status. I was wondering if the caller was in a middle of a gather and hung up would twilio know the call hung up and report it? Or am I supposed to just see the "completed" status and at that time determine if the call actually successfully completed or not?
推荐答案
Twilio 布道者在这里.
Twilio evangelist here.
据我所知,除了通过 CallStatus 传递给您的状态回调之外,我们没有特定的方式告诉您呼叫方在 <Gather>
的中间挂断了您指出的只是告诉您呼叫已完成,而不是呼叫者在 TwiML 文档或呼叫流程中的哪个位置.
To my knowledge we don't have a specific way of telling you that a caller hung up during the middle of a <Gather>
other than the status callback passing you the CallStatus, which as you points out just tells you that the call was completed, not where within a TwiML document or a call flow the caller was.
如果您想知道呼叫在呼叫流程中的哪个位置结束(例如呼叫者挂断了电话),我很确定这是您需要在自己的应用程序中跟踪的内容.您可以通过存储电话的 callSid 以及一些元数据来实现这一点,这些元数据可帮助您的应用了解呼叫在流程中的位置,并且每次 Twilio 向您的应用发出 Webhook 请求时都进行更新.
If you want to know where within a call flow the call ends (for example the caller hangs up), I'm pretty sure that is something you would need to track in your own application. You could do that by storing the callSid of the phone call along with some meta data that helps your app know where in the flow the call is, and just updating each time Twilio makes a webhook request to your app.
希望有所帮助.
这篇关于TwiML 应用程序:如果调用方在申请过程中挂断电话,Twilio 是否会通知应用程序挂断?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!