I would like to allow callers to barge in during a Say Action in Twilio Autopilot. is that possible? At the start of the call, I read off a list of possible things to say to the bot - but the list is growing and would like for users to be able to interrupt the reading and go to the appropriate action without having to wait for it to end.
0
votes
1 Answers
4
votes
Twilio developer evangelist here.
The docs are not yet updated, but barge is supported. By default, customers could cut-off a Say
or a Collect
using speech. If you would like to disable barge
, you could set it to false
in the listen
or collect
property below speech
.
That JSON might look something like:
{
"actions": [
{
"say": "Hi, how can I help you today?"
},
{
"listen": {
"barge": true
}
}
]
}
Or in a more complex 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
}
}
]
}
Or in a Collect
that might look like:
{
"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"
}
}
}
}
]
}
Let me know if this helps at all!