From 567cd06454402643f8a6a3d44fc5b6946c21dcc2 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 30 Mar 2023 12:54:24 -0400 Subject: [PATCH] MT#56447 ensure consistent call IDs Use a convenience helper function to make sure the call IDs are the same across the board. Change-Id: I38d5b6a79e8e7478544aba396b4ee71f74567852 --- daemon/janus.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/daemon/janus.c b/daemon/janus.c index 595c15ce1..8e7070b40 100644 --- a/daemon/janus.c +++ b/daemon/janus.c @@ -155,6 +155,12 @@ static void janus_send_ack(struct websocket_message *wm, const char *transaction } +// returns g_malloc'd string +INLINE char *janus_call_id(uint64_t room_id) { + return g_strdup_printf("janus %" PRIu64, room_id); +} + + // global janus_lock is held static const char *janus_videoroom_create(struct janus_session *session, struct janus_handle *handle, JsonBuilder *builder, JsonReader *reader, int *retcode) @@ -196,7 +202,7 @@ static const char *janus_videoroom_create(struct janus_session *session, struct room->id = room_id; if (g_hash_table_lookup(janus_rooms, &room->id)) continue; - room->call_id.s = g_strdup_printf("janus %" PRIu64, room_id); + room->call_id.s = janus_call_id(room_id); room->call_id.len = strlen(room->call_id.s); struct call *call = call_get_or_create(&room->call_id, false, true); if (!call) {