From a942182e22f29963d025c62826dd942fa9c33287 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Mon, 12 Jun 2017 13:49:07 +0200 Subject: 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 --- src/osmo-bsc/osmo_bsc_sigtran.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 3d3037b80..10ae6c85d 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -32,6 +32,7 @@ #include #include #include +#include /* 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); } -- cgit v1.2.3