2014-04-04 11 views
0

jssip/sipjs 라이브러리를 사용하여 호출하는 중 드롭 아웃이 발생합니다. 오디오도 없습니다. 다음은 자바 스크립트 콘솔에 표시됩니다.JSSIP/SIP-JS 호출이 끊어짐

==== 
Fri Apr 04 2014 10:14:30 GMT+0530 (IST) | sip.sanitycheck | Via sent-by in the response does not match UA Via host value. Dropping the response sip-0.5.0.js:170 
Fri Apr 04 2014 10:14:34 GMT+0530 (IST) | sip.sanitycheck | Via sent-by in the response does not match UA Via host value. Dropping the response sip-0.5.0.js:170 
Fri Apr 04 2014 10:14:38 GMT+0530 (IST) | sip.sanitycheck | Via sent-by in the response does not match UA Via host value. Dropping the response sip-0.5.0.js:170 
Fri Apr 04 2014 10:14:42 GMT+0530 (IST) | sip.sanitycheck | Via sent-by in the response does not match UA Via host value. Dropping the response sip-0.5.0.js:170 

설정에는 별표 서버와 webrtc 서비스가 포함됩니다.

다음은 테스트 할 때 사용하는 샘플 html 페이지입니다.

<!DOCTYPE html> 
<html> 
<head> 
<!-- <script type="text/javascript" src="SIPml-api.js"></script> --> 
</head> 

<body> 
Hello woirld 
<video id="remoteVideo"></video> 
    <video id="localVideo" muted="muted"></video> 
    <button type="button" id="endButton">End</button> 
<button type="button" id="callButton">Call</button> 
</body> 
<script type="text/javascript" src="sip-0.5.0.js"></script> 
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 
<script type="text/javascript"> 

(function() { 
    var session; 

    function onAccepted() { 
    alert("You made a call!"); 
    } 

var userAgent = new SIP.UA({ 
    uri: 'sip:[email protected]', 
// wsServers: ['ws://mywebrtc.com:10060'], 
    wsServers: ['wss://mywebrtc.com:10062'], 
    authorizationUser: '100', 
    password: '1234' 
}); 


$(document).ready(function() { 

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

}); 


    //here you determine whether the call has video and audio 
    var options = { 
    mediaConstraints: { 
     audio: true, 
     video: true 
    } 
    }; 
    //makes the call 
    session = userAgent.invite('111', options); 
    session.on('accepted', onAccepted); 

})(); 



</script> 
</html> 

=====

은 사람이 나를 도와 드릴까요?

답변

0

봅니다 교체 통화가 비디오 및 오디오가 있는지 여부를 판단 // 여기

<video id="remoteVideo"></video> 
    <video id="localVideo" muted="muted"></video> 

<audio id="remoteAudio"></audio> 
    <audio id="localAudio" muted="muted"></audio> 

//here you determine whether the call has video and audio 
     var options = { 
     mediaConstraints: { 
      audio: true, 
      video: true 
     } 
     }; 

와 사용자 코드에서 다음

var options = { 

       media: { 
          constraints: { 
             audio: true, 
             video: false, 
             }, 
          render: { 
            remote: { 
               audio: document.getElementById('remoteAudio') 
              }, 

            local: { 
               audio: document.getElementById('localAudio') 
              } 
            } 
         } 
}; 

별표 11.11.0과 Firefox 31.0 및 Opera 22.0.1471.70으로 테스트했습니다. 오디오 전화 이 정상적으로 작동합니다. 최신 크롬 브라우저 (버전 37.0.2062.58 베타 -m (64 비트))에 오디오 문제가 없습니다. 그렇지 않으면 매력처럼 작동합니다.

한 가지 더, 별표는 vp8 코덱을 지원하지 않으므로 비디오가 작동하지 않습니다. 별표 (*) 12는 패스 스루 모드에서 vp8 코덱을 지원합니다. 아직이 기능을 테스트하고 있습니다.