diff options
author | Harald Welte <laforge@gnumonks.org> | 2019-04-19 10:22:57 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2019-04-21 08:03:38 +0000 |
commit | 73f99bc4424d8b72b88f7f58f418c698a5c29ffc (patch) | |
tree | f96b88942e39ea1f059bc91ae83e870f5547f031 | |
parent | 38ab0528b6f95efebe9d481b6e1d6130dc961390 (diff) |
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
-rw-r--r-- | src/mncc.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -104,6 +104,17 @@ static struct mncc_call_leg *mncc_find_leg(uint32_t callref) 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 @@ static void check_rtp_connect(struct mncc_connection *conn, const char *buf, int } 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 @@ static void check_rtp_create(struct mncc_connection *conn, const char *buf, int } 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); |