diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2017-07-07 13:47:50 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-07-25 15:14:15 +0200 |
commit | b67fb4fc63def9acc6eaf69c13841890703b1d45 (patch) | |
tree | d5c8a17c2c69f61a9e49651324ac305b9ae9e93a | |
parent | 4b36c7a34e461d073a4685358e64f1fb945566ae (diff) |
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
-rw-r--r-- | include/openbsc/a_iface.h | 3 | ||||
-rw-r--r-- | src/libmsc/a_iface.c | 11 | ||||
-rw-r--r-- | src/libmsc/osmo_msc.c | 2 |
3 files changed, 16 insertions, 0 deletions
diff --git a/include/openbsc/a_iface.h b/include/openbsc/a_iface.h index 4c51a7f4a..149f1c71e 100644 --- a/include/openbsc/a_iface.h +++ b/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/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 2a28803dd..b16936f50 100644 --- a/src/libmsc/a_iface.c +++ b/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/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 3eedd8257..db6a6ca72 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -29,6 +29,7 @@ #include <openbsc/vlr.h> #include <openbsc/osmo_msc.h> #include <openbsc/iu.h> +#include <openbsc/a_iface.h> #include <openbsc/gsm_04_11.h> @@ -219,6 +220,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); |