Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Apr 21 08:03:38 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11194 )

Change subject: MNCC: Do not continue with B leg if A leg is cancelled.
......................................................................

MNCC: Do not continue with B leg if A leg is cancelled.

In case we receive MNCC_RTP_CREATE after MNCC_DISC_IND,
check if the call is already marked in_release
and if so, send MNCC_REJ_REQ and do not proceed with
the B leg.

Related: OS#3518
Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37
---
M src/mncc.c
1 file changed, 13 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Keith Whyte: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/mncc.c b/src/mncc.c
index b7977c4..ab2bed6 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -104,6 +104,17 @@
 	return NULL;
 }
 
+/* Find a MNCC Call leg (by callref) which is not yet in release */
+static struct mncc_call_leg *mncc_find_leg_not_released(uint32_t callref)
+{
+	struct mncc_call_leg *leg = mncc_find_leg(callref);
+	if (!leg)
+		return NULL;
+	if (leg->base.in_release)
+		return NULL;
+	return leg;
+}
+
 static void mncc_fill_header(struct gsm_mncc *mncc, uint32_t msg_type, uint32_t callref)
 {
 	struct mncc_call_leg *mncc_leg;
@@ -343,7 +354,7 @@
 	}
 
 	rtp = (const struct gsm_mncc_rtp *) buf;
-	leg = mncc_find_leg(rtp->callref);
+	leg = mncc_find_leg_not_released(rtp->callref);
 	if (!leg) {
 		LOGP(DMNCC, LOGL_ERROR, "leg(%u) can not be found\n", rtp->callref);
 		return mncc_send(conn, MNCC_REJ_REQ, rtp->callref);
@@ -373,7 +384,7 @@
 	}
 
 	rtp = (const struct gsm_mncc_rtp *) buf;
-	leg = mncc_find_leg(rtp->callref);
+	leg = mncc_find_leg_not_released(rtp->callref);
 	if (!leg) {
 		LOGP(DMNCC, LOGL_ERROR, "call(%u) can not be found\n", rtp->callref);
 		return mncc_send(conn, MNCC_REJ_REQ, rtp->callref);

-- 
To view, visit https://gerrit.osmocom.org/11194
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37
Gerrit-Change-Number: 11194
Gerrit-PatchSet: 5
Gerrit-Owner: Keith Whyte <keith at rhizomatica.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Keith Whyte <keith at rhizomatica.org>
Gerrit-Reviewer: Rafael Diniz <rafael at rhizomatica.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190421/6280143f/attachment.html>


More information about the gerrit-log mailing list