Twilio autopilot handoff action is not working with Twiml Bin

耗尽温柔 提交于 2019-12-11 02:47:41

问题


I have a Twilio autopilot task from an incoming call, which performs a greeting then asks a question before redirecting to a new task called 'callnumber'. This all works fine.

The 'callnumber' task looks like this

{
    "actions": [
        {
            "handoff": {
                "channel": "voice",
                "uri": "https://handler.twilio.com/twiml/TWIMLBINID"
            }
        }
    ]
}

TWIMLBINID actually has the correct ID from the Twiml Bin.

This is the Twiml content in the bin:

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

Unfortunately I'm not hearing this Response spoken out and instead just get the standard 'an error has occurred' voice message.

I've tried a few different versions of this, even calling an xml file hosted on my own public web server and seeing the same problem. Also tried the dial verb and still seeing this issue.

I feel like I may have missed some configuration, after seeing similar posts like: Twilio autopilot doesnt say what it is supposed to say

Any help is much appreciated!


回答1:


I was able to get the TwiML Bin working with similar JSON, when I have it associated with a Task that has samples.

So, for example, a call comes in to your Autopilot assistant and initially triggers the Assistant Initiation Task of hello_world where you modified the predefined JSON with a listen action.

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

You then respond so the task associated with your handoff JSON/TwiML Bin is executed (based on the samples you provided). If you try to call the handoff task directly, it fails.




回答2:


I have the same JSON for "actions" of the task-seems perfect. But 2 Small differences for the TwiMLbin : 1)don't forget to put the xml tag in the TwiLbin : It should be :

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say>For this question, I will put you in contact ...</Say>
</Response>

2)I don't understand how your twiMLbin has such an hyperlink. Normally the syntax is https://handler.twilio.com/twiml/******SID****** and the SID can not be chosen and mine has 34 characters. (do not use the "friendly name" of the twiMLbin). You have a button in the twiMLbin to copy-paste it directly.

for me it works. Otherwise please provide some more elements

-do you have queries associated to the autopilot task ? if you have task(s) that do not have any queries, the model will refuse to build (you can check this in the screen "natural language router" / tab "build models").

-are you sure you don't have conflicting query that triggers another task than the one you think (typically with short queries, they "vampirize" other intents). For that please provide the logs of the queries (query Vs Task) of your autopilot assistant.

nb : I confirm what philnash said : you should really try with a phone call. I experienced also some "glitches" with the Twilio simulator.



来源:https://stackoverflow.com/questions/53205213/twilio-autopilot-handoff-action-is-not-working-with-twiml-bin

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