Skip to content

Commit

Permalink
Support for strings as unique IDs in AudioBridge, VideoRoom, TextRoom (
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero authored Feb 28, 2020
1 parent 5680b40 commit 761e47a
Show file tree
Hide file tree
Showing 8 changed files with 1,898 additions and 694 deletions.
4 changes: 4 additions & 0 deletions conf/janus.plugin.audiobridge.jcfg.sample
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ general: {
# .wav --> .wav.tmp until the file is closed
#events = false # Whether events should be sent to event
# handlers (default=true)

# By default, integers are used as a unique ID for both rooms and participants.
# In case you want to use strings instead (e.g., a UUID), set string_ids to true.
#string_ids = true
}

room-1234: {
Expand Down
4 changes: 4 additions & 0 deletions conf/janus.plugin.textroom.jcfg.sample
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ general: {
# plain (no indentation) or compact (no indentation and no spaces)
#events = false # Whether events should be sent to event
# handlers (default=true)

# By default, integers are used as a unique ID for rooms. In case you
# want to use strings instead (e.g., a UUID), set string_ids to true.
#string_ids = true
}

room-1234: {
Expand Down
4 changes: 4 additions & 0 deletions conf/janus.plugin.videoroom.jcfg.sample
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ general: {
# enforced for RTP forwarding requests too
#events = false # Whether events should be sent to event
# handlers (default=true)

# By default, integers are used as a unique ID for both rooms and participants.
# In case you want to use strings instead (e.g., a UUID), set string_ids to true.
#string_ids = true
}

room-1234: {
Expand Down
1,069 changes: 780 additions & 289 deletions plugins/janus_audiobridge.c

Large diffs are not rendered by default.

551 changes: 413 additions & 138 deletions plugins/janus_textroom.c

Large diffs are not rendered by default.

952 changes: 685 additions & 267 deletions plugins/janus_videoroom.c

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ guint64 janus_random_uint64(void) {
return num;
}

char *janus_random_uuid(void) {
return g_uuid_string_random();
}

guint64 *janus_uint64_dup(guint64 num) {
guint64 *numdup = g_malloc(sizeof(guint64));
*numdup = num;
Expand Down
4 changes: 4 additions & 0 deletions utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ guint32 janus_random_uint32(void);
* @returns A random 64-bit unsigned integer */
guint64 janus_random_uint64(void);

/*! \brief Helper to generate random UUIDs (needed by some plugins)
* @returns A random UUID string, which must be deallocated with \c g_free */
char *janus_random_uuid(void);

/*! \brief Helper to generate an allocated copy of a guint64 number
* @note While apparently silly, this is needed in order to make sure guint64 values
* used as keys in GHashTable operations are not lost: using temporary guint64 numbers
Expand Down

0 comments on commit 761e47a

Please sign in to comment.