diff --git a/bbb-client-check/.gitignore b/bbb-client-check/.gitignore index fbdc8da61e3d20cdffb4029c02eedb3437c34c2b..768152c0f642307d559b3aecc5c5627d5e69d160 100644 --- a/bbb-client-check/.gitignore +++ b/bbb-client-check/.gitignore @@ -10,3 +10,4 @@ conf/config.xml resources/lib/bbb_webrtc_bridge_sip.js resources/lib/sip.js resources/lib/bbb_localization.js +resources/lib/jquery-1.5.1.min.js diff --git a/bbb-client-check/build.xml b/bbb-client-check/build.xml index 90eca8216b2129515cca374937d38f1dd48b57b5..b02d0d7cae273e6f2f7854caf62744b21862503c 100755 --- a/bbb-client-check/build.xml +++ b/bbb-client-check/build.xml @@ -107,6 +107,7 @@ <fileset file="../bigbluebutton-client/resources/prod/lib/bbb_webrtc_bridge_sip.js" /> <fileset file="../bigbluebutton-client/resources/prod/lib/sip.js" /> <fileset file="../bigbluebutton-client/resources/prod/lib/bbb_localization.js" /> + <fileset file="../bigbluebutton-client/resources/prod/lib/jquery-1.5.1.min.js" /> </copy> <get src="${TEST_IMAGE_URL}" dest="${html.output}/test_image.jpg" skipexisting="true" /> diff --git a/bbb-client-check/html-template/index.html b/bbb-client-check/html-template/index.html index c677de2f7faa83092f8a5bc9e8b316b383bbd9eb..4fbb92fb91b27bfe764ce330fb78254a571ad923 100755 --- a/bbb-client-check/html-template/index.html +++ b/bbb-client-check/html-template/index.html @@ -34,6 +34,7 @@ <script type="text/javascript" src="history/history.js"></script> <!-- END Browser History required section --> + <script type="text/javascript" src="resources/lib/jquery-1.5.1.min.js"></script> <script type="text/javascript" src="resources/lib/api-bridge.js"></script> <script type="text/javascript" src="resources/lib/sip.js"></script> <script type="text/javascript" src="resources/lib/bbb_webrtc_bridge_sip.js"></script> diff --git a/bbb-client-check/resources/lib/api-bridge.js b/bbb-client-check/resources/lib/api-bridge.js index 6bf5a9f1d9442d85ec597fd6dcc89271d9b5252d..c31d93ec0ab5c6bb47c814bf284a4d3a87deb006 100755 --- a/bbb-client-check/resources/lib/api-bridge.js +++ b/bbb-client-check/resources/lib/api-bridge.js @@ -208,12 +208,9 @@ var swfObj = getSwfObj(); swfObj.webRTCEchoTest(success, errorcode); - webrtc_hangup(function() { - console.log("[BBBClientCheck] Handling webRTC hangup callback"); - var userAgentTemp = userAgent; - userAgent = null; - userAgentTemp.stop(); - }); + if (callActive === true) { + leaveWebRTCVoiceConference(); + } } BBB.getMyUserInfo = function(callback) { @@ -224,7 +221,7 @@ myRole: "undefined", amIPresenter: "undefined", dialNumber: "undefined", - voiceBridge: "undefined", + voiceBridge: "00000", customdata: "undefined" } @@ -232,67 +229,42 @@ } // webrtc test callbacks - BBB.webRTCEchoTestFailed = function(errorcode) { - console.log("[BBBClientCheck] Handling webRTCEchoTestFailed"); - sendWebRTCEchoTestAnswer(false, errorcode); - } - - BBB.webRTCEchoTestEnded = function() { - console.log("[BBBClientCheck] Handling webRTCEchoTestEnded"); - } - - BBB.webRTCEchoTestStarted = function() { - console.log("[BBBClientCheck] Handling webRTCEchoTestStarted"); - sendWebRTCEchoTestAnswer(true, 'Connected'); - } - - BBB.webRTCEchoTestConnecting = function() { - console.log("[BBBClientCheck] Handling webRTCEchoTestConnecting"); - } - - BBB.webRTCEchoTestWaitingForICE = function() { - console.log("[BBBClientCheck] Handling webRTCEchoTestWaitingForICE"); - } - - BBB.webRTCEchoTestWebsocketSucceeded = function() { - console.log("[BBBClientCheck] Handling webRTCEchoTestWebsocketSucceeded"); + BBB.webRTCCallSucceeded = function() { + console.log("[BBBClientCheck] Handling webRTCCallSucceeded"); var swfObj = getSwfObj(); swfObj.webRTCSocketTest(true, 'Connected'); } - BBB.webRTCEchoTestWebsocketFailed = function(errorcode) { - console.log("[BBBClientCheck] Handling webRTCEchoTestWebsocketFailed"); - var swfObj = getSwfObj(); - swfObj.webRTCSocketTest(false, errorcode); - } - - // webrtc callbacks - BBB.webRTCConferenceCallFailed = function(errorcode) { - console.log("[BBBClientCheck] Handling webRTCConferenceCallFailed"); - } - - BBB.webRTCConferenceCallEnded = function() { - console.log("[BBBClientCheck] Handling webRTCConferenceCallEnded"); + BBB.webRTCCallFailed = function(inEchoTest, errorcode, cause) { + console.log("[BBBClientCheck] Handling webRTCCallFailed, errorcode " + errorcode + ", cause: " + cause); + if (errorcode == 1002) { + // failed to connect the websocket + var swfObj = getSwfObj(); + swfObj.webRTCSocketTest(false, errorcode); + } else { + sendWebRTCEchoTestAnswer(false, errorcode); + } } - BBB.webRTCConferenceCallStarted = function() { - console.log("[BBBClientCheck] Handling webRTCConferenceCallStarted"); + BBB.webRTCCallEnded = function(inEchoTest) { + console.log("[BBBClientCheck] Handling webRTCCallEnded"); } - BBB.webRTCConferenceCallConnecting = function() { - console.log("[BBBClientCheck] Handling webRTCConferenceCallConnecting"); + BBB.webRTCCallStarted = function(inEchoTest) { + console.log("[BBBClientCheck] Handling webRTCCallStarted"); + sendWebRTCEchoTestAnswer(true, 'Connected'); } - BBB.webRTCConferenceCallWaitingForICE = function() { - console.log("[BBBClientCheck] Handling webRTCConferenceCallWaitingForICE"); + BBB.webRTCCallConnecting = function(inEchoTest) { + console.log("[BBBClientCheck] Handling webRTCCallConnecting"); } - BBB.webRTCConferenceCallWebsocketSucceeded = function() { - console.log("[BBBClientCheck] Handling webRTCConferenceCallWebsocketSucceeded"); + BBB.webRTCCallWaitingForICE = function(inEchoTest) { + console.log("[BBBClientCheck] Handling webRTCCallWaitingForICE"); } - BBB.webRTCConferenceCallWebsocketFailed = function(errorcode) { - console.log("[BBBClientCheck] Handling webRTCConferenceCallWebsocketFailed"); + BBB.webRTCCallTransferring = function(inEchoTest) { + console.log("[BBBClientCheck] Handling webRTCCallTransferring"); } BBB.webRTCMediaRequest = function() { diff --git a/bigbluebutton-client/resources/prod/lib/bbb_api_bridge.js b/bigbluebutton-client/resources/prod/lib/bbb_api_bridge.js index 217e72998c8fffdd286ca8cabbb962ef951f8580..7eb7d69cddd8b1e3457b45cb965dae0c5e9267e7 100755 --- a/bigbluebutton-client/resources/prod/lib/bbb_api_bridge.js +++ b/bigbluebutton-client/resources/prod/lib/bbb_api_bridge.js @@ -420,6 +420,10 @@ * */ + BBB.webRTCCallSucceeded = function() { + // do nothing on this callback + } + BBB.webRTCCallStarted = function(inEchoTest) { var swfObj = getSwfObj(); if (swfObj) { diff --git a/bigbluebutton-client/resources/prod/lib/bbb_webrtc_bridge_sip.js b/bigbluebutton-client/resources/prod/lib/bbb_webrtc_bridge_sip.js index 94ab80860da7f29a8faefc7313b359ac29486b25..840ad7ef7e134221031cd608f912d5c294ce101b 100755 --- a/bigbluebutton-client/resources/prod/lib/bbb_webrtc_bridge_sip.js +++ b/bigbluebutton-client/resources/prod/lib/bbb_webrtc_bridge_sip.js @@ -4,6 +4,9 @@ var inEchoTest = true; function webRTCCallback(message) { switch (message.status) { + case 'succeded': + BBB.webRTCCallSucceeded(); + break; case 'failed': if (message.errorcode !== 1004) { message.cause = null; @@ -175,6 +178,7 @@ function createUAWithStuns(username, server, callback, stunsConfig, makeCallFunc userAgent = new SIP.UA(configuration); userAgent.on('connected', function() { uaConnected = true; + callback({'status':'succeded'}); makeCallFunc(); }); userAgent.on('disconnected', function() {