在使用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设置包括asterisk服务器和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>=====
有人能帮帮我吗?
发布于 2014-08-01 20:13:34
尝试从您的代码中替换以下内容
<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编解码器。我还没有测试这个特性。
https://stackoverflow.com/questions/22853881
复制相似问题