我正试图在软电话和网页之间拨打电话

时间:2018-06-04 14:55:35

标签: javascript node.js sip freeswitch

我正在使用NodeJS,FreeSWITCH和sip.js。

我尝试使用sip.js注册一个sip用户,它可以工作。 当我尝试使用耳机拨打电话时,它说没有找到设备。

我没有使用SSL。

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Calling to 1001....</h1>      
<script src="sip-0.10.0.min.js"></script>
<script>
var config = {
  // Replace this IP address with your FreeSWITCH IP address
  uri: '1000@127.0.0.1',

  // Replace this IP address with your FreeSWITCH IP address
  // and replace the port with your FreeSWITCH ws port
  wsServers: 'ws://127.0.0.1:5066',

  // FreeSWITCH Default Username
  authorizationUser: '1000',

  // FreeSWITCH Default Password
  password: '1234'
};

var ua = new SIP.UA(config);
var session = ua.invite('1001@127.0.0.1', {
    sessionDescriptionHandlerOptions: {
        constraints: {
            audio: true,
            video: false
        }
    }
});

</script>

</body>
</html>

我测试了它并且它只能用一种方式(1000次拨打1001,1001可以听到1000和1000听不到1001)。

有人能告诉我我做错了什么吗?

0 个答案:

没有答案