Commit graph

31 commits

Author SHA1 Message Date
Dorra Jaouad
5583d17ffa fix(strings): use Constant Format String
Signed-off-by: Dorra Jaouad <dorra.jaoued7@gmail.com>
2025-04-01 09:13:41 +02:00
Joas Schilling
1ccbf67da2
chore: Run SPDX convertor
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-04-26 13:02:15 +02:00
Daniel Calviño Sánchez
c9878ac810 Expose connections and virtual participants to CLI
The variables need to be exposed through a function, as the CLI has to
copy the elements defined by Talkbuchet.js to the global scope when
loading it, but if a variable is later overwritten the copied one would
not reflect it.

Note that CLI does not directly use the exposed publishers, subscribers
and virtual participants; they are just exposed in case they need to be
used by custom scripts.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-21 17:55:47 +02:00
Daniel Calviño Sánchez
7fbda09fac Add support for virtual participant mode to CLI
Siege and virtual participant modes are independent one from the other,
so at any given time the CLI only provides the global functions that
belong to the mode currently active. By default the CLI starts in siege
mode.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-21 17:55:19 +02:00
Daniel Calviño Sánchez
c042d67ac0 Add virtual participant mode
In the virtual participant mode Talkbuchet can be used to add
participants to a call and thus perform load test in clients. Virtual
participants require much less resources than real participants in the
system running Talkbuchet, so it makes possible to add a lot more
participants than what would be possible with real participants.

Note, however, that a single browser can run just a single virtual
participant. Therefore, virtual participants are recommended to be used
through the CLI (the support will be introduced in a following commit).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:04 +02:00
Daniel Calviño Sánchez
4eee6dfb96 Add helper methods to join calls and leave calls and rooms
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:04 +02:00
Daniel Calviño Sánchez
114f4522f6 Take credentials into account when joining a room
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:04 +02:00
Daniel Calviño Sánchez
e0ea252b4e Wait until the room is joined in the HPB before returning
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:04 +02:00
Daniel Calviño Sánchez
8682aa27bc Remove half-working code related to sieges with guest users
Automatically joining the room after getting the "hello" message is
needed only for guest users. However, sieges as guest users are not
possible, as joining the room a second time from the same browser causes
the first guest to be unregistered. Due to this the code to
automatically join the room is removed.

The method to join the room, however, is kept, as it will be used by the
"Virtual participant" mode to be introduced in a later commit.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:03 +02:00
Daniel Calviño Sánchez
22f7bc66c3 Show hint about settings when subscribers are not allowed to connect
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:03 +02:00
Daniel Calviño Sánchez
1d6cfd52d2 Add helper functions to print connection stats
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:03 +02:00
Daniel Calviño Sánchez
782b67c564 Print connection ID when checking them
This makes possible to identify which connection has a problem and
further investigate it if desired.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:03 +02:00
Daniel Calviño Sánchez
9ea395f5e0 Print progress while starting the connections of a siege
Starting tens or hundreds of connections may take a while, so the
progress is now printed to prevent the user from wondering if it is
working or not.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:03 +02:00
Daniel Calviño Sánchez
9ddae8784a Nullify stream when starting media again
This ensures that if media can not be started again for some reason (for
example, if neither audio nor video are now enabled) the old stream will
not be kept.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:03 +02:00
Daniel Calviño Sánchez
af503bc6a1 Guard against null streams
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:03 +02:00
Daniel Calviño Sánchez
0640c372a8 Fix configured warning timeout not honoured when starting a siege
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:03 +02:00
Daniel Calviño Sánchez
b31bae26f0 Add helper script to run Talkbuchet in a Docker container
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:03 +02:00
Daniel Calviño Sánchez
102124ef85 Add CLI to run Talkbuchet
Talkbuchet is a JavaScript script meant to be loaded and run in a
browser. However, until now that required manually copying and pasting
the script in a browser console. This commit adds a Python script that
uses Selenium to launch a new browser, load Talkbuchet in it and control
it through the Python script.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-06-20 18:38:03 +02:00
Daniel Calviño Sánchez
97d51f1ca9 Add functions to configure the different parameters
Until now the script had to be edited to set the right configuration
parameters and then copied and pasted on the browser console; running
the script again required reloading the page and pasting it again, even
if the parameters where not modified. Now the constants were changed to
variables and helper functions were added to set them, so the script can
be pasted without changes and the configuration can be adjusted by
calling the helper functions. Moreover, as there is now an explicit
function to start the siege the script can be run several times and with
different parameters without having to reload the page and paste it
again.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-04-08 03:05:13 +02:00
Daniel Calviño Sánchez
eca059cbf4 Get API version from capabilities
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-04-08 03:05:13 +02:00
Daniel Calviño Sánchez
48068f5375 Extract variable for host
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-04-08 03:05:13 +02:00
Tobias Speicher
68b340fe23
Replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
2022-03-24 21:53:23 +01:00
Joas Schilling
32b3737ccd
Replace password with apptoken
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-06-14 11:33:13 +02:00
Daniel Calviño Sánchez
4b0a2afbf6
Add helper functions
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-06-14 11:33:13 +02:00
Joas Schilling
cd7e849d78
Catch the exception on creating the signaling connection
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-06-14 11:33:13 +02:00
Joachim Bauch
2a702c6da1
Add support for trickle candidates.
This is option "full_trickle" in Janus.

Signed-off-by: Joachim Bauch <bauch@struktur.de>
2021-06-14 11:33:13 +02:00
Joas Schilling
ee191d3f24
Simplify configuration
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-06-14 11:33:13 +02:00
Joas Schilling
9a6af81a52
First define all things before starting to call functions
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-06-14 11:33:12 +02:00
Joas Schilling
07cd488ce2
Move config values to the top
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-06-14 11:33:12 +02:00
Joas Schilling
436b636d61
Define closeConnections() before starting siege
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-06-14 11:33:12 +02:00
Joas Schilling
3ee0ac0580
Initial Talkbuchet version
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-06-14 11:33:12 +02:00