2016-12-06 8 views
0

이미 실행중인 SIP 서버로 JSSip과의 연결을 설정하려고합니다. 나는 문서를 읽고 다음 코드를 생각해 냈다. 여기 내 코드가있다.JSSip으로 연결을 시도하는 중 WebSocket 오프닝 핸드 셰이크 취소가 발생하는 이유는 무엇입니까?

<!DOCTYPE html> 
<html lang="en"> 
    <head> 
     <title></title> 
    </head> 

    <body></body> 

    <script src="jssip-3.0.0.min.js"></script> 

    <script> 
    var socket = new JsSIP.WebSocketInterface('wss://sip.group.com'); 
    var configuration = { 
     sockets : [ socket ], 
     uri  : 'sip:[email protected]', 
     password : 'password#' 
    }; 

    var coolPhone = new JsSIP.UA(configuration); 

    coolPhone.start(); 

    // Register callbacks to desired call events 
    var eventHandlers = { 
     'progress': function(e) { 
     console.log('call is in progress'); 
     }, 
     'failed': function(e) { 
     console.log('call failed with cause: '+ e.data.cause); 
     }, 
     'ended': function(e) { 
     console.log('call ended with cause: '+ e.data.cause); 
     }, 
     'confirmed': function(e) { 
     console.log('call confirmed'); 
     } 
    }; 

    var options = { 
     'eventHandlers' : eventHandlers, 
     'mediaConstraints' : { 'audio': true, 'video': true } 
    }; 

    var session = coolPhone.call('sip:[email protected]', options); 
    </script> 
</html> 

내 서버 확장은 4051이며 내 동료 4050에게 전화하려고합니다. 그러나 Chrome의 콘솔을 열면 다음 오류가 발생합니다.

WebSocket connection to 'wss://sip.group.com/' failed: WebSocket opening handshake was canceled 
+1

을 사용하여 연결하고 'ws : //'를 사용하여 시도해 볼 수 있습니까? –

+0

나는했다. 그리고 이제이 에러를 보여줍니다 :'WebSocket handshake 동안의 에러 : 예상치 못한 응답 코드 : 403'. – MiniGunnR

+0

서버를 통해 HTML 파일을 실행하거나 파일을 두 번 클릭하면 연결을 설정하기에 충분합니까? – MiniGunnR

답변

0

jsSIP 또는 웹 소켓에는 문제가 없습니다. 귀하의 sip.group.com의 WSS는 새 연결을 수락하지 않습니다 당신이 https://sip.group.com/

Connection:close 
Content-Length:76 
Content-Type:text/plain 
Server:RTC/7.0 
X-MS-Server-Fqdn:PNQIN100EDG02.infra.lync.com 

1. 당신의 WSS가 443에서 실행하는 확신 할 때 웹 소켓의 흔적은 응답이 없다? 다른 포트에서 실행중인 경우 wss://sip.group.com:port