From beb28be6575a3c110d10b6b5b5b15de193299183 Mon Sep 17 00:00:00 2001 From: Tvildo Date: Mon, 22 Feb 2021 09:46:25 -0800 Subject: [PATCH] add call_id in received sip message (#2563) Add call_id in received SIP MESSAGE and INFO --- plugins/janus_sip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/janus_sip.c b/plugins/janus_sip.c index aa8154118e..41026131d9 100644 --- a/plugins/janus_sip.c +++ b/plugins/janus_sip.c @@ -5097,6 +5097,8 @@ void janus_sip_sofia_callback(nua_event_t event, int status, char const *phrase, json_t *headers = janus_sip_get_incoming_headers(sip, session); json_object_set_new(result, "headers", headers); } + if(session->callid) + json_object_set_new(info, "call_id", json_string(session->callid)); json_object_set_new(info, "result", result); int ret = gateway->push_event(session->handle, &janus_sip_plugin, session->transaction, info, NULL); JANUS_LOG(LOG_VERB, " >> Pushing event to peer: %d (%s)\n", ret, janus_get_api_error(ret)); @@ -5131,6 +5133,8 @@ void janus_sip_sofia_callback(nua_event_t event, int status, char const *phrase, json_t *headers = janus_sip_get_incoming_headers(sip, session); json_object_set_new(result, "headers", headers); } + if(session->callid) + json_object_set_new(message, "call_id", json_string(session->callid)); json_object_set_new(message, "result", result); int ret = gateway->push_event(session->handle, &janus_sip_plugin, session->transaction, message, NULL); JANUS_LOG(LOG_VERB, " >> Pushing event to peer: %d (%s)\n", ret, janus_get_api_error(ret));