问题描述
我创建了一个asp.net网页,并且我正在使用twilio试用帐户(twilio客户端)来测试对会议的点击.连接后,它将播放twilio模拟帐户spiel,然后要求我单击任意数字以继续.不幸的是,由于我正在笔记本电脑上对其进行测试,因此它无法识别任何内容并断开连接,也无法将我连接到会议(为此,我在日志中看不到任何条目).我知道会议的工作原理是,我可以直接拨打电话号码,听消息,单击电话号码,然后听会议输入声音.
I created an asp.net webpage and I am using a twilio trial account (twilio client) to test click to conference. When I get connected, it plays the twilio demo account spiel and then asks me to click any number to continue. Unfortunately since I am testing this on a laptop, it doesn't recognize anything and disconnects and doesn't connect me to the conference (I don't see any entries in the log for this). I know the conference works as I can directly dial the phone number, listen to the message, click a number, and then hear the conference enter sound.
如何继续使用试用帐户来开发此应用?
How can I continue using the trial account for developing this app?
每位德文·雷德(Twilio Evangelist),我需要使用senddigits方法.这是我更新后的代码,仍然无效
Per Devin Rader (Twilio Evangelist), I need to use senddigits method. Here is my updated code that still does not work
<script type="text/javascript"
src="//static.twilio.com/libs/twiliojs/1.2/twilio.min.js"></script>
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
</script>
<script type="text/javascript">
Twilio.Device.setup('@token');
Twilio.Device.ready(function (device) {
$("#log").text("Ready");
});
Twilio.Device.error(function (error) {
$("#log").text("Error: " + error.message);
});
Twilio.Device.connect(function (conn) {
$("#log").text("Successfully established call");
});
function call() {
Twilio.Device.connect();
}
function senddigits() {
Twilio.Device.sendDigits("5");
}
function mute() {
Twilio.Device.mute(true);
}
function unmute() {
Twilio.Device.mute(false);
}
</script>
<div class="row">
<div class="col-md-4">
<button class="btn btn-default" onclick="call();">
Ready!
</button>
</div>
<div class="col-md-4">
<a class="btn btn-default" href="tel:1234567890">Call!</a>
</div>
<div class="col-md-4">
<button class="btn btn-default" onclick="senddigits();">
Send Digits
</button>
</div>
<div class="col-md-4">
<button class="btn btn-default" onclick="unmute();">
Unmute
</button>
</div>
<div class="col-md-4">
<button class="btn btn-default" onclick="mute();">
Mute
</button>
</div>
<div class="col-md-4" id="log">Loading...</div>
推荐答案
此处是Twilio的传播者.
Twilio evangelist here.
Twilio Client的 sendDigits 功能/www.twilio.com/docs/client/connection"rel =" nofollow>连接对象可让您发送DTMF音调以模拟拨号盘上的按数字,因此您只需添加另一个按钮即可.到您的页面上.
The sendDigits function of Twilio Client's Connection object lets you send DTMF tones to simulate pressing numbers on a dial pad, so you could just add another button (or buttons) to your page that.
在下面的示例中,我将传递给connect函数的连接对象放入全局变量中,然后在其他函数中使用该变量发送DTMF音调,并使连接静音/取消静音.
In the example below I'm putting the connection object passed into the connect function into a global variable, then usaing that variable in other functions to send DTMF tones, and mute/unmute the connection.
<script type="text/javascript">
var connection;
Twilio.Device.setup('@token');
Twilio.Device.ready(function (device) {
$("#log").text("Ready");
});
Twilio.Device.error(function (error) {
$("#log").text("Error: " + error.message);
});
Twilio.Device.connect(function (conn) {
$("#log").text("Successfully established call");
connection = conn;
});
function call() {
Twilio.Device.connect();
}
function senddigits() {
if (connection!=null)
connection.sendDigits("5");
}
function mute() {
if (connection!=null)
connection.mute(true);
}
function unmute() {
if (connection!=null)
connection.mute(false);
}
</script>
希望有帮助.
这篇关于发行使用演示帐户测试twilio webrtc客户端会议的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!