duanjiyun7391 2018-03-14 17:38
浏览 41

Twilo如何处理拨号超时

I need to record a voice of my clients who is try to reach one of our advisors. This should happen when there is timeout

  1. User calls -->Number-----> If timeout --> say(Record your message)--> on end of the recording it should call the recordingStatusCallBack

  2. User Call --> Number --> answer call success --> On end of the call it should call method. Not sure where should we put the action either on number (statuscallback) or on the dial Action verb?

To achieve this I am try with the below twiML

<Response>
   <Dial callerId="+123124" record="true" timeout="10">
  <Number 
  statusCallback="https://<123134>.ngrok.io/ttwilio/callStatusCallBack" 
  statusCallbackEvent="completed" 
  statusCallbackMethod="POST">+1232424/Number>
 </Dial> 
 <Say>Please Record you message</Say> 
   <Record 
     recordingStatusCallback=
      "https://<123134>.ngrok.io/ttwilio/callStatusCallback" 
       recordingStatusCallbackMethod="POST"/>
</Response>

This works fine when there is a timeout but when the call is successfully ended twilio still ask for the user to "Please Record you message"

How to achieve this task?

  • 写回答

1条回答 默认 最新

  • dongsui8162 2018-03-14 23:37
    关注

    Twilio developer evangelist here.

    The behaviour of <Dial> when there is no action attribute is to continue with the TwiML below it once the call is finished, whether by timeout or through a successful call.

    If you add a URL as the action attribute, then the behaviour changes and <Dial> will always make a request to the action URL once the call is completed. The important difference here though, is that the URL will be called with a DialCallStatus parameter that will be one of "completed", "answered", "busy", "no-answer", "failed" and "canceled". This way you can check if the call was busy or not answered and return the TwiML for recording a message. Or if the call was completed successfully, you can just return <Hangup/>.

    Let me know if that helps at all.

    评论

报告相同问题?

悬赏问题

  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,
  • ¥15 我的代码无法在vc++中运行呀,错误很多