From b8e802851dd586b3e08799886cf4b144463b970f Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 27 Mar 2016 16:49:23 +0200 Subject: mncc: Handle REJ_IND from the NITB In case a call can not be connected we will receive a REJ.IND. Inform the other leg and release the call. --- src/mncc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/mncc.c b/src/mncc.c index 1d97703..5531905 100644 --- a/src/mncc.c +++ b/src/mncc.c @@ -473,6 +473,23 @@ static void check_stp_cmpl_ind(struct mncc_connection *conn, char *buf, int rc) leg->state = MNCC_CC_CONNECTED; } +static void check_rej_ind(struct mncc_connection *conn, char *buf, int rc) +{ + struct gsm_mncc *data; + struct mncc_call_leg *leg; + struct call_leg *other_leg; + + leg = find_leg(conn, buf, rc, &data); + if (!leg) + return; + + other_leg = call_leg_other(&leg->base); + if (other_leg) + other_leg->release_call(other_leg); + LOGP(DMNCC, LOGL_DEBUG, "leg(%u) was rejected.\n", data->callref); + call_leg_release(&leg->base); +} + static void check_hello(struct mncc_connection *conn, char *buf, int rc) { struct gsm_mncc_hello *hello; @@ -609,6 +626,9 @@ static int mncc_data(struct osmo_fd *fd, unsigned int what) case MNCC_REL_IND: check_rel_ind(conn, buf, rc); break; + case MNCC_REJ_IND: + check_rej_ind(conn, buf, rc); + break; case MNCC_REL_CNF: check_rel_cnf(conn, buf, rc); break; -- cgit v1.2.3