Twilio自动驾驶仪允许插入

时间:2020-03-17 19:30:17

标签: twilio

我希望在Twilio自动驾驶仪中的“说出操作”期间允许呼叫者插入。那可能吗?在通话开始时,我读出了可能要告诉机器人的内容的列表-但该列表正在增长,希望用户能够中断读取并采取适当的操作而不必等待它结束。

1 个答案:

答案 0 :(得分:3)

这里是Twilio开发人员的传播者。

文档尚未更新,但支持插入。默认情况下,客户可以使用语音截断SayCollect。如果要禁用barge,则可以在false下的listencollect属性中将其设置为speech

该JSON可能类似于:

{
    "actions": [
        {
            "say": "Hi, how can I help you today?"
        },
        {
            "listen": {
                "barge": true
            }
        }
    ]
}

或更复杂的say

{
  "actions": [
    {
      "say": {
        "speech": "Hello! how can I help you. Say or press 1 for sales, 2 for support."
      }
    },
    {
      "listen": {
        "voice_digits": {
          "redirects": {
            "1": "task://sales",
            "2": "task://support"
          }
        },
        "barge": false
      }
    }
  ]
}

或者在Collect中看起来像这样:

{
   "actions":[
      {
         "collect":{
            "name":"collect_custom",
            "questions":[
               {
                  "question":"What office are you based out of? Press 1 for San Francisco. 2 for Mountain View. 3 for Remote",
                  "name":"twilio_office",
                  "type":"twilio_office",
                  "voice_digits":{
                     "mapping":{
                        "1":"San Francisco",
                        "2":"Mountain View",
                        "3":"Remote"
                     }
                  },
                  "barge":false
               }
            ],
            "on_complete":{
               "redirect":{
                  "uri":"https://example.com/collect",
                  "method":"POST"
               }
            }
         }
      }
   ]
}

让我知道这是否有帮助!