douqiaolong0528 2014-10-03 14:53
浏览 44
已采纳

Twiml - 自动按(数字)和挂断

I want a simple script that will allow me to:

  • Answer the incoming phone (from Intercom)
  • Automatically press "9"
  • Hangup the call

I have an intercom which calls to my number and I have to answer it then press 9 to door to be opened and hangup. I want to implement this with twilio but can't find any solutions.

Any suggestions?

  • 写回答

1条回答 默认 最新

  • doumi0737 2014-10-03 15:21
    关注

    Twilio evangelist here.

    Just to make sure I understand your question, you want your intercom to call your Twilio number and have Twilio "press 9" and then hang up. Assuming I have that right it should be pretty simple to do.

    You're going to use the <Play> and <Hangup> TwiML verbs and return something like this Twilio in response to our Voice Request:

    <Response>
        <Play digits="9" />
        <Hangup />
    <Response>
    

    if you need to add some time between when the call is answered and the tone is played, you can do something like this:

    <Response>
        <Play digits="wwww9" />
        <Hangup />
    <Response>
    

    Each w character tells Twilio to pause for .5 seconds, so in this sample there is a 2 second delay before the tone is played.

    Hope that helps.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度