Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
421 views
in Technique[技术] by (71.8m points)

javascript - Sipjs无法接听电话(Sipjs can not get incoming call)

I can call another user via sipjs.

(我可以通过sipjs呼叫另一个用户。)

I am waiting call via sipjs.

(我正在等待通过sipjs打电话。)

But it's not coming.

(但这还没到。)

I can registered to server.

(我可以注册到服务器。)

No error output on console.

(控制台上没有错误输出。)

newRTCSession event is not giving any output.

(newRTCSession事件未提供任何输出。)

Browser: Chrome Vue js code

(浏览器:Chrome Vue js代码)

var callOptions = {
  mediaConstraints: {
    audio: true, // only audio calls
    video: false
  }
};
var bwPhone = new JsSIP.UA({
  ‘uri’: ‘sip:[email protected]’,
  ‘password’: ‘password’,
  ‘ws_servers’: ‘wss://webrtc.registration.bandwidth.com:10443’
});
bwPhone.start();
bwPhone.on(“newRTCSession”, function(data){
    var session = data.session;
    if (session.direction === “incoming”) {
        // incoming call here
        session.on(“accepted”,function(){
            // the call has answered
        });
        session.on(“confirmed”,function(){
            // this handler will be called for incoming calls too
        });
        session.on(“ended”,function(){
            // the call has ended
        });
        session.on(“failed”,function(){
            // unable to establish the call
        });
        session.on(‘addstream’, function(e){
            // set remote audio stream (to listen to remote audio)
            // remoteAudio is <audio> element on page
            remoteAudio.src = window.URL.createObjectURL(e.stream);
            remoteAudio.play();
        });
  ask by Cem K?y translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...