From fac9c9e9d8682a0fe234b12cf94fc490596284eb Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 7 Jul 2017 13:47:50 +0200 Subject: a_iface: fix missing clear command When a subscriber connection is freed on the MSC side (the conversion is over) the MSC should send a clear command to the BSC in order to inform the BSC that the connection is over. Currently this step is missing. Instead we wait for the BSC to issue a clear request. This is not as it should be, connections should be actively cleared by the MSC. Add the missing clear command --- openbsc/include/openbsc/a_iface.h | 3 +++ openbsc/src/libmsc/a_iface.c | 11 +++++++++++ openbsc/src/libmsc/osmo_msc.c | 2 ++ 3 files changed, 16 insertions(+) (limited to 'openbsc') diff --git a/openbsc/include/openbsc/a_iface.h b/openbsc/include/openbsc/a_iface.h index 4c51a7f4a..149f1c71e 100644 --- a/openbsc/include/openbsc/a_iface.h +++ b/openbsc/include/openbsc/a_iface.h @@ -64,6 +64,9 @@ int a_iface_tx_paging(const char *imsi, uint32_t tmsi, uint16_t lac); /* Send assignment request via A-interface */ int a_iface_tx_assignment(const struct gsm_trans *trans); +/* Send clear command via A-interface */ +int a_iface_tx_clear_cmd(struct gsm_subscriber_connection *conn); + /* Clear all subscriber connections on a specified BSC * (Helper function for a_iface_bssap.c) */ void a_clear_all(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *bsc_addr); diff --git a/openbsc/src/libmsc/a_iface.c b/openbsc/src/libmsc/a_iface.c index 2a28803dd..b16936f50 100644 --- a/openbsc/src/libmsc/a_iface.c +++ b/openbsc/src/libmsc/a_iface.c @@ -405,6 +405,17 @@ int a_iface_tx_assignment(const struct gsm_trans *trans) return osmo_sccp_tx_data_msg(conn->a.scu, conn->a.conn_id, msg); } +/* Send clear command via A-interface */ +int a_iface_tx_clear_cmd(struct gsm_subscriber_connection *conn) +{ + struct msgb *msg; + + LOGP(DMSC, LOGL_NOTICE, "Sendig clear command to BSC (conn_id=%u)\n", conn->a.conn_id); + + msg = gsm0808_create_clear_command(GSM0808_CAUSE_CALL_CONTROL); + return osmo_sccp_tx_data_msg(conn->a.scu, conn->a.conn_id, msg); +} + /* Callback function: Close all open connections */ static void a_reset_cb(const void *priv) { diff --git a/openbsc/src/libmsc/osmo_msc.c b/openbsc/src/libmsc/osmo_msc.c index b9607e3ec..dc62f2fc9 100644 --- a/openbsc/src/libmsc/osmo_msc.c +++ b/openbsc/src/libmsc/osmo_msc.c @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -207,6 +208,7 @@ void msc_subscr_con_cleanup(struct gsm_subscriber_connection *conn) return; if (conn->vsub) { + a_iface_tx_clear_cmd(conn); DEBUGP(DRLL, "subscr %s: Freeing subscriber connection\n", vlr_subscr_name(conn->vsub)); msc_subscr_cleanup(conn->vsub); -- cgit v1.2.3