summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-07-07 13:47:50 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2017-07-07 13:58:52 +0200
commitfac9c9e9d8682a0fe234b12cf94fc490596284eb (patch)
treee99b31ce17c1eb5d9901476ce41ea4ddd755b696
parent7a4855ac405284f3ee59f3e413bab5172fcc05b0 (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--openbsc/include/openbsc/a_iface.h3
-rw-r--r--openbsc/src/libmsc/a_iface.c11
-rw-r--r--openbsc/src/libmsc/osmo_msc.c2
3 files changed, 16 insertions, 0 deletions
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 <openbsc/vlr.h>
#include <openbsc/osmo_msc.h>
#include <openbsc/iu.h>
+#include <openbsc/a_iface.h>
#include <openbsc/gsm_04_11.h>
@@ -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);