Commit Graph

155 Commits

Author SHA1 Message Date
prlanzarin
f4ba6dd9a2 refactor(audio): use preloaded audio stream if provided
Avoids a surplus gUM with local echo test et al
2022-04-11 22:29:20 +00:00
prlanzarin
0d85905c83 fix(audio): centralize default in/out device id definitions, make them an empty string
"default" is not an universally valid default value for deviceIds which was causing issues with Firefox and Safari in some specific scenarios where exact deviceId constraints were being used
2022-04-11 19:23:32 +00:00
Mario Junior
5778306626
Merge pull request #9283 from znerol-forks/feature/develop/sip-user-agent
Send browser UA string in SIP UA, also add BBB server and client version
2022-03-22 11:18:06 -03:00
prlanzarin
e667f7aecb refactor(fullaudio): make some of the SIP.js input/output code re-usable
To be used by other bridges
2022-01-31 16:30:38 -03:00
prlanzarin
f4e6e6c4f4 refactor(fullaudio): make call transfer code reusable
Allows state tracking and transfer execution to be re-used by other audio bridges
2022-01-26 11:03:24 -03:00
Mario Jr
1621834239 feat(audio): add settings for audio websocket connection
Default values were kept, but now this can be changed in settings.yml.
If not set in settings.yml, the old hardcoded values are used.
2022-01-10 18:56:29 -03:00
prlanzarin
93b5f4c93d feat(bbb-html5): add a general forceRelay flag
public.media.forceRelay forces relay usage on all browsers, environments and media modules

If true, overrides public.kurento.[4~forceRelayOnFirefox
2021-12-09 11:35:56 +00:00
Daniel Schreiber
c46556e1f6 Allow BBB to run behind a proxy the avoid gUM permission queries per node
The idea is to run a loadbalancer node which maps each BBB node to a
path. That way each user gets only one gUM permission query for a
cluster. The loadbalancer node only serves the html5 client, each BBB
node will serve its own API and handle the websockets for freeswitch and
bbb-webrtc-sfu.

Configuring a cluster setup
===========================

* let bbb-lb.example.com be the loadbalancer node
* let bbb-01.eaxmple.com be a BBB node

Loadbalancer
------------

On the loadbalancer node add an nginx configuration similar to this one
for each BBB node:

```
location /bbb-01/html5client/ {
  proxy_pass https://bbb-01.example.com/bbb-01/html5client/;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "Upgrade";
}

```

BBB Node
--------

On the BBB node add the following options to
`/etc/bigbluebutton/bbb-web.properties`:

```
defaultHTML5ClientUrl=https://bbb-lb.example.com/bbb-01/html5client/join
presentationBaseURL=https://bbb-01.example.com/bigbluebutton/presentation
accessControlAllowOrigin=https://bbb-lb.example.com
```

Add the following options to `/etc/bigbluebutton/bbb-html5.yml`:

```
public:
  app:
    basename: '/bbb-01/html5client'
    bbbWebBase: 'https://bbb-01.eaxmple.com/bigbluebutton'
    learningDashboardBase: 'https://bbb-01.eaxmple.com/learning-dashboard'
  media:
    stunTurnServersFetchAddress: 'https://bbb-01.eaxmple.com/bigbluebutton/api/stuns'
    sip_ws_host: 'bbb-01.eaxmple.com'
  presentation:
    uploadEndpoint: 'https://bbb-01.eaxmple.com/bigbluebutton/presentation/upload'
```

Create the following unit file overrides:

* `/etc/systemd/system/bbb-html5-frontend@.service.d/cluster.conf`
* `/etc/systemd/system/bbb-html5-backend@.service.d/cluster.conf`

with the following content:

```
[Service]
Environment=ROOT_URL=https://127.0.0.1/bbb-01/html5client
```

Change the nginx `$bbb_loadbalancer_node` variable to the name of the
load balancer node in `/etc/bigbluebutton/nginx/loadbalancer.nginx` to
allow CORS requests:

```
set $bbb_loadbalancer_node https://bbb-lb.example.com
```

Prepend the mount point of bbb-html5 in all location sections except
from the `location @html5client` section in
`/etc/bigbluebutton/nginx/bbb-html5.nginx`

```
location @html5client {
    ...
}
location /bbb-01/html5client/locales {
    ...
}
```
2021-11-20 22:13:47 +01:00
Mario Jr
7e218c3eca feat(audio): add bridge configurable scheme
we are now able to switch between audio bridges, by selecting it in
config files.
2021-11-09 12:08:09 -03:00
Mario Jr
519883e89a update(audio): adjust reference to ignoreCallState flag 2021-09-24 14:48:22 -03:00
Mario Jr
1c08fc852a fix(audio): audio controls crash when ending call during brekout audio transfer
Restored the old behavior when ending breakout rooms while user is in the
breakout audio transfer, which is to the trigger the reconnection to the audio
in the main room.
This behavior could be improved by (instead of reconnecting) transfering user
back to the main room, but this requires some changes in akka-apps/fsesl
which can be treated in a different issue.

Closes #13242
2021-09-21 11:22:05 -03:00
Anton Georgiev
4ecb24b4fa Merge branch 'v2.3.x-release' of github.com:bigbluebutton/bigbluebutton into merge-aug30 2021-08-30 18:11:16 +00:00
Anton Georgiev
34453b8528
fix: Fix log message (LGTM)
Updating string for audio connected audio. Thanks @stweil
2021-08-25 13:17:27 -04:00
Mario Jr
cf366e5090 Get user and audio data, shows it and allows it to be copied to clipboard
Using getStats api and peer information to retrieve upload/download rates
and transport information
2021-08-12 16:39:04 -03:00
Mario Jr
c0d1255924 Merge branch 'v2.3.x-release' into fix-1005-logging 2021-07-30 12:28:34 -03:00
Mario Jr
2f75f6107e fix(audio): prevent false positive alerts of 1005 error
After reconnecting (with 1007 or 1005), user may gets 1005 when meeting
is ended by moderator.
2021-07-22 09:28:14 -03:00
Mario Jr
6db69c39d8 fix(audio): prevent duplicated error logging
We now let audio-manager log errors, using the specified error code.
These errors are still logged in bridge layer, but as a warning.
This commit doens't change error codes behavior, they are still being
logged as errors and with the same code numbers.
2021-07-20 11:10:04 -03:00
Mario Jr
431a6c7c3b chore(audio): add secondsToGatherIce as extraInfo in server log 2021-07-16 11:16:24 -03:00
Mario Jr
f5713869bf fix(audio): correct log the time needed for ice gathering 2021-07-15 11:15:53 -03:00
Mario Jr
287c4eb682 feat(audio): use kurento's trickle-ice to improve mic negotiation
Here's what we do when user activates mic:
1 - When we do something similar to listenonly's joining process
until we find a valid candidate-pair. The information about this
local candidate is store.
2 - We then start a new userAgent, and as soon as browser finds
a candidate with the same local ip address, we leave only this
candidate in the SDP and send this to FreeSWITCH. SDP should
contain only a single candidate.
3 - The rest of signaling process is basically the same.
2021-07-01 16:26:44 -03:00
Mario Jr
13bb0c8493 fix: match exact deviceId when retrieving mic streams
Needed for firefox for consistently changing microphone using device selector
Refs #12054
2021-04-26 22:08:22 -03:00
Mario Jr
2f78fc05d2 fix: breakout audio don't use previously selected output device
When joining breakout audio, the output device selected in the main room is
used in breakout.
When returning from breakout rooms, the output audio device previously set in
the main room is restored.

Some specific info:
SIPSession doesn't handle Storage anymore, we do this in SIPBridge, since
it has more info about the current selected device and it doesn't depend of
a session being oppened.
We also now pass the  output device ID when joining audio sessions. We can
then keep this information in the Storage.
Closes #11663
2021-04-23 11:28:30 -03:00
Mario Jr
e8d59ed14a fix: mic selection (firefox/all browsers) and muted alert when mic is changed
This commit contains three fixes: one already reported and two detected
during the investigation of the solution.
This started as a fix for firefox (#12023), but i also fixed the muted
alert/banner when device changes: the banner wasn't detecting device changes,
unless audio was deactived/actived.

There's another fix for the microphone stream: we now keep sender's track
disabled if it was already disabled for the sender's track of the previous
selected device.

Also did small refactor for eslint checking.

Some technical information: in sip bridge (bridge/sip.js), setInputStream and
liveChangeInputDevice function were both fully turned into promises, which
guarantees we have everything ready when it resolves to the respective values.
This helps AudioManager (audio-manager/index.js) to sequentially sets and
tracks the state of the current microphone stream (inputStream), when calling
liveChangeInputDevice function: we first set the current stream to null,
creats a new one and then set it to the newly created value - this is needed
because MutedAlert (muted-alert/component.jsx) can then gracefully
allocate/deallocate the cloned stream when it is set to a non-null/null value
(the cloned stream is used for speech detection with hark).
In MutedAlert we also make sure to enable the cloned stream's audio
tracks, just in case the user change the device when muted (audio track is
disabled in this case), which also leaves the cloned stream muted (we then
enable the track to allow speech detection).

Closes #12023
2021-04-16 10:45:40 -03:00
znerol
5399473f46 Send browser UA string in SIP UA, also add BBB server and client version 2021-04-04 22:21:33 +02:00
Mario Jr
951fc0ade8 fix: MEDIA_ERROR when joining room using Firefox
Firefox doesn't create a  device called 'default' and we were trying
to set this when user is joining the room. We don't do this anymore, letting
devices to be changed when there's some user request.

Moved outputDeviceId inputDeviceId information to be managed in bridge
(just like we do with inputDeviceId), we don't store this duplicated
information in audio container anymore.

Fixed the eslint warning in "playAlertSound(url) { ..."

We are safe to let users try to change input/output devices because the
device list is retrieved from enumerateDevices.
2021-04-01 15:53:43 -03:00
Anton Georgiev
ff45cccd66 Merge branch 'v2.2.x-release' of github.com:bigbluebutton/bigbluebutton into apr1-merge 2021-04-01 18:11:13 +00:00
Ramon Souza
05a0d5afbf move browser info to helper + remove unused libs 2021-04-01 08:14:24 -03:00
Mario Jr
60378e8c63 Merge branch 'develop' into merge-update-pr-10129 2021-03-29 19:07:27 -03:00
Mario Jr
cddca95ad1 Fixes and improvements on pr #10129 - dynamic change audio device
Allow listenonly users to change output devices
Fixed dynamic audio device change for firefox
Fixed shortcuts for audio join/leave
Show (with a bold font) the current selected device
[performance] Prevent calling mediaDevices.enumerateDevices every time we render
the selector. This adds a delay (~200ms, on my chrome setup) to render this component
[performance] Do not call enumerateDevices to search for new devices, instead we listen on mediaDevices.deviceChange event
Small refactoring and fixed a few errors that were being throw in browser's console
Fixed device selection when this is done in audio-settings modal
Fallback to default device when current device is removed
Truncate device name length
Renamed "Input","Output" labels to "Microphone","Speakers", respectively
Update eslint rule for accessKey
2021-03-29 18:55:17 -03:00
Mario Jr
cec88c996d Merge remote-tracking branch 'tainan/issue-9723' into merge-update-pr-10129 2021-03-29 18:52:12 -03:00
prlanzarin
2e51482c7c audio: make sdpSemantics configurable
Plan B is going to be phased out of Chrome soon and we should be testing it with unified plan
2021-03-29 20:01:33 +00:00
prlanzarin
f20fb3eef2 audio: make sdpSemantics configurable
Plan B is going to be phased out of Chrome soon and we should be testing it with unified plan
2021-03-12 03:04:55 +00:00
Mario Jr
209b06db2e Avoid setting an unknown input deviceId
Without 'exact' match, the browser fallbacks to the default inputDeviceId

This prevents the error (input device error)  when breakout is ended and we try
to skipCheck the microphone when user returns to main room (assuming the
user had the microphone active before joining breakout room).
2021-03-05 00:33:54 -03:00
Mario Jr
de05622d19 Avoid setting an unknown input deviceId
Without 'exact' match, the browser fallbacks to the default inputDeviceId

This prevents the error (input device error)  when breakout is ended and we try
to skipCheck the microphone when user returns to main room (assuming the
user had the microphone active before joining breakout room). Related
to the feature c451666d52
2021-02-28 17:15:08 -03:00
Mario Jr
b582b1ca78 Correctly return MediaStream object when calling audio-manager's inputStream
This was missed in recent audio/sip.js changes.
MediaStream is now returned from SIP.js
Related to #10733
2021-01-29 19:05:51 -03:00
Anton Georgiev
09e6ba8dfd Merge branch 'v2.2.x-release' of github.com:bigbluebutton/bigbluebutton into merge-Jan30 2021-01-29 20:58:05 +00:00
Mario Jr
f2de2806eb Add setting for enabling/disabling microphone audio filters
As explained in #11143, disabling audio filters is desired in some scenarios.
This basically adds an option for user to disable default constraints.
When user doesn't change this value in Settings > Application, the default
value for each audio constraints is retrieved from settings.yml.
When user changes this value in Settings > Application, audio
filters (AGC, Noise Supression and Echo Cancellation) are all set to
true/false, according to the value selected in the Settings GUI.

To start it simple, we decided to not to add a different setting in the GUI for
each audio contraint. This may be added in the future, though (perhaps in a
dedicated Audio Settings tab)
This is related to #4873
2021-01-29 14:18:15 -03:00
Mario Jr
b753ef5d8d Fix wrong path in settings for audio constraints
Using now 'application' instead of old 'audio' path
2021-01-26 14:12:18 -03:00
Mario Jr
7858ba94ba Avoid setting empty/undefined constraint
This removes the console warning about invalid constraint
2021-01-25 23:45:27 -03:00
Mario Jr
97c76900cb Add setting for enabling/disabling microphone audio filters
As explained in #11143, disabling audio filters is desired in some scenarios.
This basically adds an option for user to disable default constraints.
When user doesn't change this value in Settings > Application, the default
value for each audio constraints is retrieved from settings.yml.
When user changes this value in Settings > Application, audio
filters (AGC, Noise Supression and Echo Cancellation) are all set to
true/false, according to the value selected in the Settings GUI.

To start it simple, we decided to not to add a different setting in the GUI for
each audio contraint. This may be added in the future, though (perhaps in a
dedicated Audio Settings tab)
This is related to #4873
2021-01-22 16:30:42 -03:00
Mario Jr
92708da447 Allow audio constraints to be changed in bbb-html5's settings.yml
In some scenarios, there's no need for the browser to apply such audio filters. For example, when user's microphone already does audio filtering (echo cancellation, noise supression ...).
This commit doens't change the current behavior (filters still follow browser's default config): admins need to uncomment/set these values if disabling/enabling specific filters if desired.
This is related to #4873
2021-01-12 14:42:27 -03:00
Anton Georgiev
c1ffced27d Merge branch 'v2.2.x-release' of github.com:bigbluebutton/bigbluebutton into develop 2020-12-17 21:14:29 +00:00
Mario Jr
6113113af9 Add option to disable traceSip logs
Audio client logs already cover audio session progress the way we need.
This avoids keepAlive and other unnecessary messages to be logged in browser's console.
If setting is not present, default value is set to false.
2020-12-11 00:31:10 -03:00
Mario Jr
c65fa2b350 Add keep alive message to audio's websocket
This was added as an option (websocketKeepAliveInterval), which is the interval to send keep alive messages.
Setting websocketKeepAliveInterval to 0 disables the keep alive, producing the same old behavior.
This helps avoid websocket disconnection due to socket inactivity, preventing it to unnecessarily reconnect.
Also, sometimes reconnect fails and error 1005 is triggered.
Fixes problems reported in #10985.
Also reduces occurrences of error 1005.
2020-12-10 23:48:01 -03:00
Anton Georgiev
244a239810 Merge branch 'v2.2.x-release' of github.com:bigbluebutton/bigbluebutton into 2020-12-01-merge 2020-12-01 20:02:50 +00:00
prlanzarin
1bef5f37a6 [sip.js] Annotate every audio-manager callback call with a bridge name identifier
Useful when parsing logs to split errors by bridge type
2020-12-01 18:23:14 +00:00
Mario Jr
214cd12c59 Fix typo on dtmf log 2020-11-26 00:01:58 -03:00
Mario Jr
370e3cb39d Use INFO message as default for sending dtmf on call transfer
Instead of sending using rfc4733 standard, we use INFO message for all transfers
INFO message was used in older SIP.js version. Although this is not a standard for sending DTMF tones, this has more reliability (once it sent over TCP)
This might reduce occurrences of 1008
2020-11-25 18:33:45 -03:00
Mario Jr
af48c8977d Reduce delay for the first reconnection attempt of audio's websocket
This is the same behavior we used to have on older sip.js version code
By doing this we reduce errors when user try to perform join/hangup during an websocket reconnection
2020-11-23 12:40:38 -03:00
Mario Jr
2b89dd7db2 Do not trigger reconnect when ICE connection terminates before hanging up process is finished
This could leave users to have your audio reconnected in the main room, while joining a breakout room
Some information can be found in #10528
2020-11-20 00:25:46 -03:00