aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-06-12 13:49:07 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-07-12 23:42:46 +0200
commita942182e22f29963d025c62826dd942fa9c33287 (patch)
tree029e28d2a4f71bdd3a80d471a3fedf5babd44669
parentdbb53d4bc753f0c539d04921a757d453311c8f85 (diff)
osmo-bsc: Send USSD notification when an MSC loss is detected
the old sccp-lite based imlementation offered support for sending an USSD notification as soon as a loss of the MSC connection is detected. This is done before forcefully dropping the affected connection. This commit ports the feature to the new libosmo-sigtran implementation. NOTE: I do not know if this works and I also do not really understand how this is even possible. Sending an USSD notification would rquire the subscriber to be properly attached? When the MSC is lost this almost not possible since no backend to authenticate against is available. Change-Id: Idaadf8d708608843e3c36ed35b3661b48096c21b
-rw-r--r--src/osmo-bsc/osmo_bsc_sigtran.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 3d3037b8..10ae6c85 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -32,6 +32,7 @@
#include <openbsc/osmo_bsc_grace.h>
#include <openbsc/osmo_bsc_sigtran.h>
#include <openbsc/osmo_bsc_reset.h>
+#include <openbsc/gsm_04_80.h>
/* A pointer to a list with all involved MSCs
* (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */
@@ -327,6 +328,26 @@ int osmo_bsc_sigtran_del_conn(struct osmo_bsc_sccp_con *conn)
return 0;
}
+static void bsc_notify_msc_lost(struct osmo_bsc_sccp_con *con)
+{
+ struct gsm_subscriber_connection *conn = con->conn;
+
+ /* send USSD notification if string configured and con->data is set */
+ if (!conn)
+ return;
+
+ /* check for config string */
+ if (!con->msc->ussd_msc_lost_txt)
+ return;
+ if (con->msc->ussd_msc_lost_txt[0] == '\0')
+ return;
+
+ /* send USSD notification */
+ bsc_send_ussd_notify(conn, 1, conn->sccp_con->msc->ussd_msc_lost_txt);
+ bsc_send_ussd_release_complete(conn);
+}
+
+
/* close all open connections */
void osmo_bsc_sigtran_reset(struct bsc_msc_data *msc)
{
@@ -336,6 +357,7 @@ void osmo_bsc_sigtran_reset(struct bsc_msc_data *msc)
llist_for_each_entry_safe(conn, conn_temp, &active_connections, entry) {
if (conn->conn)
gsm0808_clear(conn->conn);
+ bsc_notify_msc_lost(conn);
osmo_bsc_sigtran_del_conn(conn);
}