Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jfederico/bigbluebutton into bbb-…
Browse files Browse the repository at this point in the history
…web_fix-maxParticipants-by-tracking-joins-II
  • Loading branch information
Ubuntu committed Jul 11, 2016
2 parents a518a3a + 1d451f1 commit 6cc9f0d
Show file tree
Hide file tree
Showing 31 changed files with 3,242 additions and 1,576 deletions.
38 changes: 22 additions & 16 deletions bigbluebutton-client/resources/prod/lib/bbb_webrtc_bridge_sip.js 100755 → 100644
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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
Expand All @@ -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')
}
}
};
Expand Down Expand Up @@ -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
Expand All @@ -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);
});

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -520,3 +525,4 @@ function isWebRTCAvailable() {
function getCallStatus() {
return currentSession;
}

0 comments on commit 6cc9f0d

Please sign in to comment.