Browse Source

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
pull/1642/head
Richard Fuchs 3 years ago
parent
commit
567cd06454
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      daemon/janus.c

+ 7
- 1
daemon/janus.c View File

@ -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 // global janus_lock is held
static const char *janus_videoroom_create(struct janus_session *session, struct janus_handle *handle, static const char *janus_videoroom_create(struct janus_session *session, struct janus_handle *handle,
JsonBuilder *builder, JsonReader *reader, int *retcode) 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; room->id = room_id;
if (g_hash_table_lookup(janus_rooms, &room->id)) if (g_hash_table_lookup(janus_rooms, &room->id))
continue; 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); room->call_id.len = strlen(room->call_id.s);
struct call *call = call_get_or_create(&room->call_id, false, true); struct call *call = call_get_or_create(&room->call_id, false, true);
if (!call) { if (!call) {


Loading…
Cancel
Save