From c41188c0cac60c79b2fe2d2c09fbf526f59c2b48 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 20 Jan 2023 12:42:04 -0500 Subject: [PATCH] MT#56447 more generic websocket_janus_process_json To allow supplying the handle ID and session ID separately without requiring it to be in the JSON. Change-Id: I4a6f18410084add2a37cdf1ea3375072a8e192ca --- daemon/janus.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/daemon/janus.c b/daemon/janus.c index 37caa9fd5..ae4109be4 100644 --- a/daemon/janus.c +++ b/daemon/janus.c @@ -1485,15 +1485,15 @@ static void janus_finish_response(JsonBuilder *builder, const char *success, con } -const char *websocket_janus_process(struct websocket_message *wm) { +static const char *websocket_janus_process_json(struct websocket_message *wm, + uint64_t session_id, uint64_t handle_id) +{ JsonParser *parser = NULL; JsonReader *reader = NULL; const char *err = NULL; int retcode = 200; const char *transaction = NULL; const char *success = "success"; - uint64_t session_id = 0; - uint64_t handle_id = 0; struct janus_session *session = NULL; ilog(LOG_DEBUG, "Processing Janus message: '%.*s'", (int) wm->body->len, wm->body->str); @@ -1662,6 +1662,11 @@ err: } +const char *websocket_janus_process(struct websocket_message *wm) { + return websocket_janus_process_json(wm, 0, 0); +} + + const char *websocket_janus_get(struct websocket_message *wm) { str uri; str_init(&uri, wm->uri);