Twilio浏览器客户端是否可用 [英] Twilio Browser client Available or not

查看:86
本文介绍了Twilio浏览器客户端是否可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在检测Twilio浏览器客户端是否可用时遇到Twilio问题.

I am facing a problem with Twilio to detect the Twilio Browser client Available or not.

如果Twilio客户端不可用,则需要发送语音邮件,否则我将用来接听电话.

If Twilio client is not available then need to send the voicemail otherwise I am using to accept the call.

Twilio.Device.incoming(function (conn);

谢谢.

推荐答案

可以按照以下步骤实现此目标
  1.为客户端的Dial动词的action属性设置有效的url
  例如,拨打客户的TwiMl必须是
  <响应>
   <拨号操作="myapp/statusCallBack">
   < Client> jenny</Client>
  </拨号>
  </响应>
  2.如果客户端jenny可用,则可以通过
接收连接对象    Twilio.Device.incoming(function(conn){conn.accept();});
  3.如果客户端jenny不可用,Twilio将请求带有参数'DialCallStatus = no-answer'的statusCallBack URL.现在以下
可以返回 &tmpml说不可用消息.
  <响应>
   < Say>
    请留下您的姓名和电话号码以及短信.
   </说>
   <记录maxLength ="3600" action ="myapp/recordedUrl">
   </记录>
  </响应>
  4.现在,一旦呼叫者记录了语音邮件,则在调用"myapp/recordedUrl"时可以存储语音邮件的URL.有关录制动词的更多信息,请访问本网站
 请注意,如果客户端不可用或客户端不接受呼叫,则会在两种情况下录制语音邮件.

The following steps can be followed to achieve this
 1. Set a valid url to the action attribute of the Dial verb of the client
  Eg., The TwiMl to dial the client must be
  <Response>
   <Dial action="myapp/statusCallBack">
    <Client>jenny</Client>
   </Dial>
  </Response>
 2. If the client jenny is available, the connection object can be received via
  Twilio.Device.incoming(function (conn){conn.accept();});
 3. If the client jenny is unavailable, Twilio will request to the statusCallBack url with the parameter 'DialCallStatus=no-answer'. Now the following
  twiml can be returned to say Unavailable message.
  <Response>
   <Say>
    Please leave your name and number along with a short message.
   </Say>
   <Record maxLength="3600" action="myapp/recordedUrl">
   </Record>
  </Response>
 4. Now the voicemail url can be stored when the "myapp/recordedUrl" is called once the caller recorded the voicemail. For more info on record verb, visit this site
 Note that the voice mail is recorded on two cases, if the client is unavailable or the client does not accept the call.

这篇关于Twilio浏览器客户端是否可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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