From ad96f4598d6e3ec792534c8fb2b7e15af04e8c9f Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Thu, 27 Jun 2024 17:38:37 +0200 Subject: [PATCH] MT#60408 CallLeg: `isHoldRequest()` has to deal with const sdp Make the `isHoldRequest()` safer in terms of operating on a given `AmSdp &sdp`, we still don't change anything in the body, but just checking if the request is a hold one. Change-Id: I82fa3da1a11c686050dc482106735139b800ff2d --- apps/sbc/CallLeg.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/sbc/CallLeg.cpp b/apps/sbc/CallLeg.cpp index e468ced3..953dcb79 100644 --- a/apps/sbc/CallLeg.cpp +++ b/apps/sbc/CallLeg.cpp @@ -163,7 +163,7 @@ static bool isSDPBodyHold(const AmSdp &sdp) return false; } -static bool isHoldRequest(AmSdp &sdp, HoldMethod &method) +static bool isHoldRequest(const AmSdp &sdp, HoldMethod &method) { /* set defaults from session parameters and attributes * inactive/sendonly/sendrecv/recvonly may be given as session attributes, @@ -171,8 +171,8 @@ static bool isHoldRequest(AmSdp &sdp, HoldMethod &method) bool connection_active = connectionActive(sdp.conn, false /* empty connection like inactive? */); MediaActivity session_activity = getMediaActivity(sdp.attributes, Sendrecv); - for (std::vector::iterator m = sdp.media.begin(); - m != sdp.media.end(); ++m) + for (std::vector::const_iterator m = sdp.media.begin(); + m != sdp.media.end(); ++m) { if (m->port == 0) continue; /* this stream is disabled, handle like inactive (?) */ if (!connectionActive(m->conn, connection_active)) {