summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-06-12 13:49:07 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-18 17:50:09 +0200
commit151feb99c3cd3bb1146e7b5a03e44f4bf2b05512 (patch)
tree0ab9b69c187af48a226f9fb36992c168ba15eeec
parentb64c23440e3f41c47269a3dc58ddddd765f38c84 (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.
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_sigtran.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sigtran.c b/openbsc/src/osmo-bsc/osmo_bsc_sigtran.c
index 3d3037b..10ae6c8 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/openbsc/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);
}