使用 <Dial> 时在 TwiML 中使用 IfMachine [英] Use IfMachine in TwiML when using <Dial>

查看:111
本文介绍了使用 <Dial> 时在 TwiML 中使用 IfMachine的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将 Dial 动词与 IfMachine 参数结合使用?我在拨号动词页面上看不到任何内容 (https://www.twilio.com/docs/api/twiml/dial) 表示可以使用 IfMachine 参数或是否将其传递给结果 Action 参数.

Is there a way to use the Dial verb in conjunction with the IfMachine parameter? I don't see anything on the dial verb page (https://www.twilio.com/docs/api/twiml/dial) which indicates the IfMachine parameter can be used or whether it will be passed to the resulting Action parameter.

我发现这篇文章检测接听服务是否接听,答案是将 IfMachine 参数放入您的 TwiML 中",但我没有看到在 TwiML 中使用 IfMachine 参数的任何示例.我只见过它与 REST API 一起使用的示例.

I found this post Detecting if an answering service picks up, and the answer says "put the IfMachine parameter in your TwiML", but I don't see any examples of the IfMachine parameter being used in TwiML. I've only seen examples of it being used with the REST API.

我正在尝试让我的应用程序重定向呼叫,然后如果应答机接听重定向的呼叫,然后发送短信.理想情况下,来电 TwiML 看起来像这样:

I'm trying to have my application redirect a call, then if that redirected call was picked up by an answering machine to then send a text message. Ideally the incoming call TwiML would look something like:

<Response>
  <Dial action="/sendSmsIfMachine.cshtml" method="POST" ifMachine="Continue">
    555-5555
  </Dial>
</Response>

然后我的 sendSmsIfMachine 页面会有类似的内容:

Then my sendSmsIfMachine page would have something like:

@{
   Response.ContentType = "text/xml";
   if(Response["AnsweredBy"] == "machine")
   {
      var twimlResponse = new TwilioResponse();
      twimlResponse.Message("You got a voicemail", new { to = "555-5556" });
      Response.Write(twimlResponse.ToString();
   }
 }

当我尝试此操作时,根据 Twilio 日志,对 sendSmsIfMachine.cshtml 发出的请求不包含 AnsweredBy 参数.

When I tried this, the resulting request made to sendSmsIfMachine.cshtml did not include the AnsweredBy parameter according to to the Twilio log.

推荐答案

Twiml 不支持 (AMD) ifMachine 参数.我已经就这个问题联系了 Twilio,下面是回复.

No Twiml Doesn't support (AMD) ifMachine parameter. I've contacted Twilio about this issue and below is there response.

姐姐,

感谢您的提问.不,TwiML 不支持 AMD,只有API.这意味着 IfMachine 和 AnsweredBy 仅适用于REST API 发起的调用.

Thanks for the question. No, AMD is not supported by TwiML, only by the API. This means that IfMachine and AnsweredBy are only valid for calls initiated by the REST API.

这是我们发布 AMD 时故意排除的.路机检测工作是它听了接听方一秒钟在接通电话之前.然后如果它听到声音模式就像人类一样,它可以让电话接通.

This was a deliberate exclusion when we released AMD. The way machine detection works is it listens to the answering party for a second before connecting the call. Then if it hears audio patterns that sound like a human, it lets the calls connect.

呼叫的问题是通常有用户在线路已经在等待被叫方接听.所以,如果机器检测吃掉"了通话的第一秒,人已经在通话中没有听到被叫方说你好".这个引起了一阵尴尬的沉默.

The problem with calls on is that there is usually a user on the line already waiting for the called party to pick up. So, if the machine detection "eats" the first second of the call, the person already on the phone doesn't hear the called party say "Hello." This causes a bit of an awkward silence.

此致,

Twilio 客户支持

Twilio Customer Support

因此,如果您想使用那里的 AMD 功能,您必须使用 REST API.

So, if you want to use there AMD feature you MUST use REST API.

这篇关于使用 &lt;Dial&gt; 时在 TwiML 中使用 IfMachine的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆