Merge pull request #3205 from capilkey/upgrade-sipjs

Upgrade sip.js to 0.7.5
This commit is contained in:
Fred Dixon 2016-07-07 17:17:11 -04:00 committed by GitHub
commit ef0dc056a4
2 changed files with 1945 additions and 1184 deletions

View File

@ -181,8 +181,8 @@ function createUAWithStuns(username, server, callback, stunsConfig, makeCallFunc
traceSip: true,
autostart: false,
userAgentString: "BigBlueButton",
stunServers: stunsConfig['stunServers'],
turnServers: stunsConfig['turnServers']
//stunServers: stunsConfig['stunServers'],
//turnServers: stunsConfig['turnServers']
};
uaConnected = false;
@ -193,13 +193,13 @@ function createUAWithStuns(username, server, callback, stunsConfig, makeCallFunc
};
function setUserAgentListeners(callback, makeCallFunc) {
console.log("reseting UA callbacks");
userAgent.off('connected');
console.log("resetting UA callbacks");
userAgent.removeAllListeners('connected');
userAgent.on('connected', function() {
uaConnected = true;
makeCallFunc();
});
userAgent.off('disconnected');
userAgent.removeAllListeners('disconnected');
userAgent.on('disconnected', function() {
if (userAgent) {
if (userAgent != null) {
@ -322,11 +322,12 @@ function make_call(username, voiceBridge, server, callback, recall, isListenOnly
options = {
media: {
stream: stream, // use the stream created above
constraints: {
audio: true,
video: false
},
render: {
remote: {
// select an element to render the incoming stream data
audio: document.getElementById('remote-media')
}
remote: document.getElementById('remote-media')
}
},
// a list of our RTC Connection constraints
@ -342,10 +343,12 @@ function make_call(username, voiceBridge, server, callback, recall, isListenOnly
options = {
media: {
stream: userMicMedia,
constraints: {
audio: true,
video: false
},
render: {
remote: {
audio: document.getElementById('remote-media')
}
remote: document.getElementById('remote-media')
}
}
};
@ -377,6 +380,7 @@ function make_call(username, voiceBridge, server, callback, recall, isListenOnly
console.log('call connecting again');
}
/*
iceGatheringTimeout = setTimeout(function() {
console.log('Thirty seconds without ICE gathering finishing');
callback({'status':'failed', 'errorcode': 1011}); // ICE Gathering Failed
@ -387,8 +391,9 @@ function make_call(username, voiceBridge, server, callback, recall, isListenOnly
userAgentTemp.stop();
}
}, 30000);
*/
currentSession.mediaHandler.on('iceComplete', function() {
currentSession.mediaHandler.on('iceGatheringComplete', function() {
clearTimeout(iceGatheringTimeout);
});
@ -462,7 +467,7 @@ function make_call(username, voiceBridge, server, callback, recall, isListenOnly
}
clearTimeout(callTimeout);
});
currentSession.mediaHandler.on('iceFailed', function() {
currentSession.mediaHandler.on('iceConnectionFailed', function() {
console.log('received ice negotiation failed');
callback({'status':'failed', 'errorcode': 1007}); // Failure on call
currentSession = null;
@ -478,7 +483,7 @@ function make_call(username, voiceBridge, server, callback, recall, isListenOnly
// Some browsers use status of 'connected', others use 'completed', and a couple use both
currentSession.mediaHandler.on('iceConnected', function() {
currentSession.mediaHandler.on('iceConnectionConnected', function() {
console.log('Received ICE status changed to connected');
if (callICEConnected === false) {
callICEConnected = true;
@ -490,7 +495,7 @@ function make_call(username, voiceBridge, server, callback, recall, isListenOnly
}
});
currentSession.mediaHandler.on('iceCompleted', function() {
currentSession.mediaHandler.on('iceConnectionCompleted', function() {
console.log('Received ICE status changed to completed');
if (callICEConnected === false) {
callICEConnected = true;
@ -520,3 +525,4 @@ function isWebRTCAvailable() {
function getCallStatus() {
return currentSession;
}

3091
bigbluebutton-client/resources/prod/lib/sip.js Executable file → Normal file

File diff suppressed because it is too large Load Diff