Skip to content

Commit

Permalink
AudioBridge_List-Announcements_#3391 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
keremcadirci committed Jun 23, 2024
1 parent 53a6bd2 commit 0ff0216
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/plugins/janus_audiobridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ room-<unique room ID>: {
* you to edit who's allowed to join a room via ad-hoc tokens; \c list
* lists all the available rooms, while \c listparticipants lists all
* the participants of a specific room and their details; \c listannouncements
* list all playing announcements of a specific room and their details;
* lists all playing announcements of a specific room and their details;
* \c resetdecoder marks the Opus decoder for the participant as invalid, and
* forces it to be recreated (which might be needed if the audio for generated
* by the participant becomes garbled); \c rtp_forward allows you to forward
Expand Down Expand Up @@ -760,6 +760,7 @@ room-<unique room ID>: {
\verbatim
{
"request" : "listannouncements",
"secret" : "<room secret, mandatory if configured>",
"room" : <unique numeric ID of the room>
}
\endverbatim
Expand Down Expand Up @@ -5512,7 +5513,22 @@ static json_t *janus_audiobridge_process_synchronous_request(janus_audiobridge_s
g_snprintf(error_cause, 512, "No such room (%s)", room_id_str);
goto prepare_response;
}
if(audiobridge->destroyed) {
JANUS_LOG(LOG_ERR, "No such room (%s)\n", room_id_str);
error_code = JANUS_AUDIOBRIDGE_ERROR_NO_SUCH_ROOM;
g_snprintf(error_cause, 512, "No such room (%s)", room_id_str);
janus_mutex_unlock(&rooms_mutex);
goto prepare_response;
}
janus_refcount_increase(&audiobridge->ref);
/* A secret may be required for this action */
JANUS_CHECK_SECRET(audiobridge->room_secret, root, "secret", error_code, error_cause,
JANUS_AUDIOBRIDGE_ERROR_MISSING_ELEMENT, JANUS_AUDIOBRIDGE_ERROR_INVALID_ELEMENT, JANUS_AUDIOBRIDGE_ERROR_UNAUTHORIZED);
if(error_code != 0) {
janus_mutex_unlock(&rooms_mutex);
janus_refcount_decrease(&audiobridge->ref);
goto prepare_response;
}
/* Return a list of all announcements */
json_t *list = json_array();
GHashTableIter iter;
Expand Down

0 comments on commit 0ff0216

Please sign in to comment.