From 98c037baf320fc423c0c2f4e879b7635a87a63ea Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 28 Oct 2024 08:38:42 -0400 Subject: [PATCH] MT#61372 add `SIP code` support to protocol Change-Id: Id7982aadf090db18561c50aec127f42860ebb6a4 --- daemon/call_interfaces.c | 10 ++++++++++ docs/ng_control_protocol.md | 5 +++++ include/call_interfaces.h | 1 + 3 files changed, 16 insertions(+) diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index a773ef6bf..75eddbd48 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -1886,6 +1886,16 @@ void call_ng_main_flags(const ng_parser_t *parser, str *key, parser_arg value, h case CSH_LOOKUP("set-label"): out->set_label = s; break; + case CSH_LOOKUP("sip-code"): + case CSH_LOOKUP("sip_code"): + case CSH_LOOKUP("SIP-code"): + case CSH_LOOKUP("SIP_code"): + case CSH_LOOKUP("sip-response-code"): + case CSH_LOOKUP("sip_response_code"): + case CSH_LOOKUP("SIP-response-code"): + case CSH_LOOKUP("SIP_response_code"): + out->code = parser->get_int_str(value, out->code); + break; case CSH_LOOKUP("sip-message-type"): case CSH_LOOKUP("sip_message_type"): case CSH_LOOKUP("SIP-message-type"): diff --git a/docs/ng_control_protocol.md b/docs/ng_control_protocol.md index c5ed325cd..b90bd7b0a 100644 --- a/docs/ng_control_protocol.md +++ b/docs/ng_control_protocol.md @@ -577,6 +577,11 @@ Optionally included keys are: Contains a string indicating whether the SIP message that triggered this signalling message was either a `SIP request` or a `SIP response`. +* `SIP code` + + Contains an integer corresponding to the SIP response code (e.g. 180 or + 200) if this signalling message was triggered by a SIP response. + * `via-branch` The SIP `Via` branch as string. Used to additionally refine the matching logic between media streams diff --git a/include/call_interfaces.h b/include/call_interfaces.h index f2a32f9e7..438ccb37f 100644 --- a/include/call_interfaces.h +++ b/include/call_interfaces.h @@ -16,6 +16,7 @@ struct sockaddr_in6; struct sdp_ng_flags { enum call_opmode opmode; enum message_type message_type; + unsigned int code; str call_id; str from_tag; str_q from_tags;