JSSIP / SIP-JS呼叫退出

时间:2014-04-04 04:55:17

标签: webrtc asterisk sip kamailio jssip

我在使用jssip / sipjs库打电话时辍学。也没有音频。以下内容在javascript控制台中显示。

====
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:100@X.X.X.X',
//  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>

=====

有人可以帮我吗?

1 个答案:

答案 0 :(得分: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')
                                            }
                                  }
                       }
};

我已经使用Asterisk 11.11.0和Firefox 31.0以及Opera 22.0.1471.70进行了测试。音频通话 工作正常。我最新的Chrome浏览器(版本37.0.2062.58 beta-m(64位))没有音频问题。否则它就像魅力一样。

另外一件事,Asterisk不支持vp8编解码器,因此视频无效。 Asterisk 12支持直通模式下的vp8编解码器。我还没有测试这个功能。

相关问题