Twilio autopilot doesnt say what it is supposed to say

旧城冷巷雨未停 提交于 2019-12-24 11:44:01

问题


I feel blocked here. I have written a Twilio autopilot task that is handling an incoming phone call. It is supposed to say something, then transfer the controle of the call to a handler that will transfer the call to an external number. Here is the code:

{
    "actions": [
        {
            "say": "For this question, I will put you in contact with our customer care specialist."
        },
        {
            "handoff": {
                "channel": "voice",
                "uri": "https://handler.twilio.com/twiml/xxx-my hander id here-xxx"
            }
        }
    ]
}

then the url of the handler goes to a twimlbin with this content :

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial>+32xxxxx</Dial>
</Response>

The problem is that the task is going directly to the "handoff" action and does not say the text. So the call is transfered to +32xxxxx immediately and the task does not say the text. I have tried to remove the handoff and then the task is saying what it is supposed to say. I really don't know what I am doing wrong. Anybody an idea ? thx in advance


回答1:


Twilio evangelist here.

So currently if you include the handoff action in a task, Autopilot ignores all other actions in the task and only executes the handoff. To work around this in your case, you can put a verb in the TwiMLBin you're handing off to before whatever other TwiML you have there now.

So simplify your Task:

{
  "actions": [
    {
      "handoff": {
            "channel": "voice",
            "uri": "https://handler.twilio.com/twiml/xxx-my hander id here-xxx"
      }
    }
  ]
}

And in your TwiML Bin:

<Response>
    <Say>For this question, I will put you in contact with our customer care specialist.</Say>

    <!-- the rest of your TwiML -->

</Response>

The team knows this isn't ideal and its something they are looking at changing it.

Hope that helps.



来源:https://stackoverflow.com/questions/53081195/twilio-autopilot-doesnt-say-what-it-is-supposed-to-say

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!