用于记录的 Twilio 操作

Twilio action for record

我正在尝试创建一个 Twilio 工作流来拨打电话并记录用户所说的内容。为此,我使用 Record,但我不完全确定要在 action 参数中放置什么。

尽管我知道 Twilio 会发送有关对 URL 的调用的信息,但我不一定需要它。有没有办法为信息提供某种天坑?

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="woman">Hi! Say your name:</Say>
<Record method="GET" action="URL_here" timeout="2"/>
</Response>

我认为除了创建一个 bin 或另一个端点和 return 一个空响应之外没有其他选择,例如:

<?xml version="1.0" encoding="UTF-8"?>
<Response />

如果您省略 action 属性,您将得到一个可能不是您想要的循环。

The 'action' attribute takes a relative or absolute URL as a value. When recording is finished Twilio will make a GET or POST request to this URL including the parameters below. If no 'action' is provided, will default to requesting the current document's URL.

After making this request, Twilio will continue the current call using the TwiML received in your response. Keep in mind that by default Twilio will re-request the current document's URL, which can lead to unwanted looping behavior if you're not careful. Any TwiML verbs occurring after a are unreachable.

(https://www.twilio.com/docs/voice/twiml/record?code-sample=code-using-attributes-in-a-record-verb&code-language=output-twiml)