Sip 参数wsServers的值错误

Sip 参数wsServers的值错误,sip,sip-server,Sip,Sip Server,我正在使用freeswitch 1.6并遵循cookbok来实现webrtc。为此,我下载sip。js@0.7.0也并创建了call.html、call.js和answer.html、answer.js页面。包含js的my call.html是 <html> <body> <button id="startCall">Start Call</button> <but

我正在使用freeswitch 1.6并遵循cookbok来实现webrtc。为此,我下载sip。js@0.7.0也并创建了call.html、call.js和answer.html、answer.js页面。包含js的my call.html是

    <html>
        <body>
             <button id="startCall">Start Call</button>

             <button id="endCall">End Call</button>
             <br/>
             <video id="remoteVideo"></video>
             <br/>
             <video id="localVideo" muted="muted" width="128px" height="96px"></video>
             <!--<script src="js/sip-0.7.0.min.js"></script>-->
             <!--<script src="call.js"></script>-->
    </body>

    <HEAD>
    <script src="js/sip-0.7.0.min.js"></script>
    <script>

                var session;
                console.log('hiiiiiiiiiiii')
                var endButton = document.getElementById('endCall');
                endButton.addEventListener("click", function () {
                             session.bye();
                             alert("Call Ended");
                             }, false);
                console.log('hiiiii2')

                var userAgent = new SIP.UA({
                                uri: 'sip:anonymous@gmaruzz.org',
                                wsServers: ["ws://call.sia.co.in:5066"],
                                authorizationUser: 'anonymous',
                                password: 'welcome'
                });

                console.log('hiiii3')
                var startButton = document.getElementById('startCall');
                startButton.addEventListener("click", function () {
                    session =userAgent.invite('sip:1010@139.59.17.63', options);
                    alert("Call Started");
                }, false);

                console.log('hiiii4')
                var options = {
                        media: {
                                    constraints: {
                                                        audio: true,
                                                        video: true
                                                },
                                    render: {
                        remote:document.getElementById('remoteVideo'),
                        local: document.getElementById('localVideo')
                                                }
                                }
                };
</script>
</HEAD>
</html>

开始通话
结束通话


var会议; console.log('hiiiii') var endButton=document.getElementById('endCall'); endButton.addEventListener(“单击”),函数(){ session.bye(); 警报(“通话结束”); },假); console.log('hiiii2') var userAgent=new SIP.UA({ uri:'sip:anonymous@gmaruzz.org', wsServers:[“ws://call.sia.co.in:5066”], authorizationUser:“匿名”, 密码:“欢迎” }); console.log('hiiii3') var startButton=document.getElementById('startCall'); addEventListener(“单击”,函数(){ session=userAgent.invite('sip:1010@139.59.17.63",选择),; 警报(“呼叫启动”); },假); console.log('hiiii4') 变量选项={ 媒体:{ 限制条件:{ 音频:是的, 视频:真的 }, 呈现:{ 远程:document.getElementById('remoteVideo'), local:document.getElementById('localVideo') } } };

请纠正我哪里出错了。提前感谢。

您必须将wsServers置于传输选项中,如:

var userAgent = new SIP.UA({
uri: 'sip:anonymous@gmaruzz.org'

transportOptions: {
  wsServers: "ws://call.sia.co.in:5066"
},

authorizationUser: 'anonymous',
password: 'welcome'

你的语法是正确的。但是,尝试将
wsServers
作为字符串
wsServers:“ws://call.sia.co.in:5066”
wsServers:“ws://call.sia.co.in:5066/ws”
是的,我做了相同的操作,但错误仍然与参数“wsServers”的“无效值”ws://call.sia.co.in:5066/ws”相同。粘贴您在控制台中得到的准确错误<代码>异常代码:1条消息:“无效值[{“ws_uri”:”wss://call.sia.co.in:7443“}]对于参数“wsServers”“name:“CONFIGURATION\u ERROR”参数:“wsServers”Dude这很奇怪,你做错了什么!在您的代码中粘贴了
wsServers:[“ws://call.sia.co.In:5066”]
,但错误显示
[{“ws\u uri”:wss://call.sia.co.in:7443“}]
如何将
ws
变成
wss
并更改端口?