使用 TwiML 时,如何设置重复循环?
我的用例是调用支持热线,Twilio 等待等待音乐,直到技术人员接听电话并调用 1。我不知道如何等待人工接听,所以我想永远重复直到接听。如果我能找出重复的话。
最佳答案
您可以使用值为 0 的 loop
属性。
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say loop="0">Hello World</Say>
</Response>
The 'loop' attribute specifies how many times you'd like the text repeated. The default is 1. Specifying '0' will cause the verb to loop until the call is hung up.
https://www.twilio.com/docs/api/twiml/say#attributes-voice
.
或者如果您正在播放音频文件
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Play loop="0">https://api.twilio.com/cowbell.mp3</Play>
</Response>
The 'loop' attribute specifies how many times the audio file is played. The default behavior is to play the audio once. Specifying '0' will cause the verb to loop until the call is hung up.
关于Twilio 重复 SAY,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46874559/