问题
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