From a70ea0b55277211f4e7c13ed32ba7ef3d08c5bd0 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 5 Nov 2026 09:06:03 -0400 Subject: [PATCH] MT#55283 refactor into op_is_offer Change-Id: I956320866a7923e003c9b20772385ae5738ebd2a --- daemon/call.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 9b1a5dd05..ab28f6dea 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1655,6 +1655,12 @@ static void __sdes_keys(const sdp_ng_flags *flags, sdes_q *cpq) { } } + +static bool op_is_offer(enum ng_opmode op) { + return (op == OP_OFFER || op == OP_SUBSCRIBE_REQ || op == OP_CREATE); +} + + /** * Only generates SDES parameters for outgoing SDP, which is our media "out" direction. * `this` is the receiver of the message. @@ -1676,8 +1682,7 @@ static void __generate_crypto(const sdp_ng_flags *flags, struct call_media *this /* preferred crypto suites for the offerer - generated answer */ const str_q *offered_order = &flags->sdes_offerer_pref; - bool is_offer = (flags->opmode == OP_OFFER || flags->opmode == OP_SUBSCRIBE_REQ - || flags->opmode == OP_CREATE); + bool is_offer = op_is_offer(flags->opmode); if (!this->protocol || !this->protocol->srtp || MEDIA_ISSET(this, PASSTHRU)) { crypto_params_sdes_queue_clear(cpq);