我正在开发 Twilio 客户端应用程序,并且很难发送 DTMF 音调。这是我到目前为止的代码:
<script type="text/javascript">
$.each(['0','1','2','3','4','5','6','7','8','9','star','pound'], function(index, value) {
$('#button' + value).click(function(){
if(connection) {
if (value=='star')
connection.sendDigits('*')
else if (value=='pound')
connection.sendDigits('#')
else
connection.sendDigits(value)
return false;
}
});
});
</script>
<div id="dialpad">
<table>
<tr>
<td><input type="button" value="1" id="button1"></td>
<td><input type="button" value="2" id="button2"></td>
<td><input type="button" value="3" id="button3"></td>
</tr>
<tr>
<td><input type="button" value="4" id="button4"></td>
<td><input type="button" value="5" id="button5"></td>
<td><input type="button" value="6" id="button6"></td>
</tr>
<tr>
<td><input type="button" value="7" id="button7"></td>
<td><input type="button" value="8" id="button8"></td>
<td><input type="button" value="9" id="button9"></td>
</tr>
<tr>
<td><input type="button" value="*" id="buttonstar"></td>
<td><input type="button" value="0" id="button0"></td>
<td><input type="button" value="#" id="buttonpound"></td>
</tr>
</table>
</div>
当我拨打我的测试号码并按下拨号盘上的按钮时,它不会发送值。非常感谢您对此的任何帮助?