Twilio 语音邮件的不同Twiml

Twilio 语音邮件的不同Twiml,twilio,twilio-twiml,Twilio,Twilio Twiml,我们有一个Windows服务,可以自动发送多个语音呼叫以提醒约会 var call = CallResource.Create( machineDetection: "DetectMessageEnd", asyncAmd: "true", twiml: new Twiml(message), to

我们有一个Windows服务,可以自动发送多个语音呼叫以提醒约会

var call = CallResource.Create(
                    machineDetection: "DetectMessageEnd",
                    asyncAmd: "true",
                    twiml: new Twiml(message),
                    to: new PhoneNumber(toPhone),
                    from: new PhoneNumber(FromPhone));
上面的消息是使用下面的Twiml动态生成的

<Response>
  <Pause length="1"/>
  <Say voice="alice">Hello {name},</Say>
  <Pause length="1"/>
  <Say voice="alice">Your appointment is scheduled for {date} at {time}.</Say>
  <Pause length="1"/>
  <Gather timeout="3" numDigits="1" action="https://6f8137e0cb9a.ngrok.io/Voice/gather?aid=12345" method="GET">
    <Say voice="alice">To confirm this appointment press 1, to cancel press 2, or you may hang up.</Say>
  </Gather>
</Response>

你好{name},
您的约会安排在{date}时间{time}。
要确认此约会,请按1;要取消约会,请按2;或者您可以挂断电话。
当接听电话时,它工作正常,但如果没有应答,则转到语音信箱。我想发送一个不同的Twiml,如下所示

<Response>
  <Pause length="1"/>
  <Say voice="alice">Hello {name},</Say>
  <Pause length="1"/>
  <Say voice="alice">Your appointment is scheduled for {date} at {time}.</Say>
  <Pause length="1"/>
  <Say voice="alice">To confirm or cancel this appointment call 18888888888.</Say>
</Response>

你好{name},
您的约会安排在{date}时间{time}。
要确认或取消此约会,请致电18888888。

这在Twilio上可能吗?

Twilio开发者福音传道者在这里

这是绝对可能的!在您的原始脚本中,它显示您正在使用asyncAmd,这意味着您的初始消息将在机器检测继续时开始播放。如果检测到一台机器,AMD会提醒您这一点

要做到这一点,您需要向出站调用提供一个指向URL的链接,当您从AMD获得结果时,该URL可以接收webhook

该webhook将接收参数,包括
CallSid
和您的
AccountSid
,最重要的是
AnsweredBy
参数。当为您的AMD使用
DetectMessageand
时,
AnsweredBy
参数可以是“机器结束时发出嘟嘟声”、“机器结束时静音”、“机器结束时其他”、“人”、“传真”和“未知”中的任意一个

对于机器结果,如果您想留下消息,现在需要

var call=CallResource.Update(
twiml:新twiml(机器消息),
pathSid:调用\u SID
);
让我知道这是否有帮助