0

I am getting a dropout while making a call using jssip/sipjs library. There is no audio too. Following is shown in javascript console.

====
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

Set up involves an asterisk server and webrtc service.

Below given is the sample html page I am using to test.

<!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>

=====

Can somebody help me on this?

4

1 回答 1

0

Try Replacing following from your code

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

with

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

and

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

with

//Here you determine whether the call has video and audio

var options = {

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

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

I have tested with Asterisk 11.11.0 and Firefox 31.0 and Opera 22.0.1471.70. Audio call is working fine. I am facing no audio issue with latest chrome browser (Version 37.0.2062.58 beta-m (64-bit)). Otherwise its works like charm.

One more thing, Asterisk does not support vp8 codec, so video will not work. Asterisk 12 supports vp8 codec in passthrough mode. I am yet to test this feature.

于 2014-08-01T12:13:33.957 回答