aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-05-22 01:08:26 +0200
committerneels <nhofmeyr@sysmocom.de>2020-05-29 20:16:40 +0000
commit6a8955b741f50afd39e9471c026fe15abc858762 (patch)
treee47600732a8a8bdc8a343c7816a2e5bc8fce735a
parentdbc7a3c9b995a18b1c4cc76335936a8aa4feb4ec (diff)
drop all BSC originated USSD notification features
The BSC is the wrong network component to originate USSD messaging, as can be seen in the hacks in the USSD code: for example, the BSC would send a CM Service Accept message as if an MSC had accepted the connection, dispatch a USSD and directly send some RR release message (without proper tear down messaging like the lchan_fsm does these days). This made sense in the osmo-nitb world, but by now we are aiming for solid 3GPP compliance. The BSC shall not originate USSD messages. Deprecate all VTY and CTRL commands related to USSD: VTY [no] bsc-welcome-text [no] bsc-msc-lost-text [no] bsc-grace-text [no] missing-msc-text (the commands with 'no' are ignored, without 'no' lead to an error) CTRL ussd-notify-v1 Drop (already unused) ussd.h. Drop gsm_04_80.h, gsm_04_80_utils.c, and all calling code. Drop "RF grace" notification, where osmo-bsc was able to notify active subscribers that the RF was being turned off. Change-Id: Iaef6f2e01b4dbf2bff0a0bb50d6851f50ae79f6a
-rw-r--r--doc/manuals/chapters/control.adoc7
-rw-r--r--include/osmocom/bsc/Makefile.am2
-rw-r--r--include/osmocom/bsc/bsc_msc_data.h13
-rw-r--r--include/osmocom/bsc/gsm_04_80.h7
-rw-r--r--include/osmocom/bsc/gsm_data.h3
-rw-r--r--include/osmocom/bsc/osmo_bsc.h3
-rw-r--r--include/osmocom/bsc/ussd.h10
-rw-r--r--src/osmo-bsc/Makefile.am1
-rw-r--r--src/osmo-bsc/gsm_04_80_utils.c43
-rw-r--r--src/osmo-bsc/gsm_08_08.c68
-rw-r--r--src/osmo-bsc/osmo_bsc_bssap.c15
-rw-r--r--src/osmo-bsc/osmo_bsc_ctrl.c68
-rw-r--r--src/osmo-bsc/osmo_bsc_filter.c14
-rw-r--r--src/osmo-bsc/osmo_bsc_grace.c76
-rw-r--r--src/osmo-bsc/osmo_bsc_sigtran.c22
-rw-r--r--src/osmo-bsc/osmo_bsc_vty.c152
-rw-r--r--tests/bsc/bsc_test.c1
-rw-r--r--tests/codec_pref/codec_pref_test.c1
-rw-r--r--tests/handover/Makefile.am1
-rwxr-xr-xtests/vty_test_runner.py62
20 files changed, 27 insertions, 542 deletions
diff --git a/doc/manuals/chapters/control.adoc b/doc/manuals/chapters/control.adoc
index 327e5b4af..6b1609ae5 100644
--- a/doc/manuals/chapters/control.adoc
+++ b/doc/manuals/chapters/control.adoc
@@ -25,7 +25,6 @@ TRX-specific commands are additionally prefixed with TRX number e. g.
|mcc-mnc-apply|WO|No|"<mcc>,<mnc>"|Apply new MCC/MNC values if different from currently used one.
|notification|WO|Yes|Arbitrary value| See <<notif>> for details.
|inform-msc-v1|WO|Yes|Arbitrary value| See <<infomsc>> for details.
-|ussd-notify-v1|WO|No|"<cic>,<alert>,<text>"| See <<ussdnot>> for details.
|rf_locked|RW|No|"0","1"|See <<rfl>> for details.
|number-of-bts|RO|No|"<num>"|Get number of configured BTS.
|bts.N.location-area-code|RW|No|"<lac>"|Set/Get LAC (value between (0, 65535)).
@@ -54,12 +53,6 @@ intended to be used outside of local systems.
Setting this variable initiate TRAP "inform-msc-v1" to all connected MSCs
control interfaces with the value supplied in SET operation.
-[[ussdnot]]
-=== ussd-notify-v1
-
-Setting this variable will send USSD Notify message to subscriber specified in
-command parameters with the text specified in command parameters.
-
[[chanlo]]
=== channel-load
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 509df9a64..7a296e474 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -17,7 +17,6 @@ noinst_HEADERS = \
debug.h \
e1_config.h \
gsm_04_08_rr.h \
- gsm_04_80.h \
gsm_data.h \
handover.h \
handover_cfg.h \
@@ -49,7 +48,6 @@ noinst_HEADERS = \
signal.h \
system_information.h \
timeslot_fsm.h \
- ussd.h \
vty.h \
gsm_08_08.h \
penalty_timers.h \
diff --git a/include/osmocom/bsc/bsc_msc_data.h b/include/osmocom/bsc/bsc_msc_data.h
index 27eb75d51..b4973451f 100644
--- a/include/osmocom/bsc/bsc_msc_data.h
+++ b/include/osmocom/bsc/bsc_msc_data.h
@@ -133,17 +133,8 @@ struct bsc_msc_data {
enum bsc_lcls_mode lcls_mode;
bool lcls_codec_mismatch_allow;
- /* ussd welcome text */
- char *ussd_welcome_txt;
-
int nr;
- /* ussd msc connection lost text */
- char *ussd_msc_lost_txt;
-
- /* ussd text when MSC has entered the grace period */
- char *ussd_grace_txt;
-
/* structures for keeping rate counters and gauge stats */
struct rate_ctr_group *msc_ctrs;
struct osmo_stat_item_group *msc_statg;
@@ -207,15 +198,11 @@ struct osmo_bsc_data {
struct llist_head mscs;
/* rf ctl related bits */
- char *mid_call_txt;
int mid_call_timeout;
char *rf_ctrl_name;
struct osmo_bsc_rf *rf_ctrl;
int auto_off_timeout;
- /* ussd text when there is no MSC available */
- char *ussd_no_msc_txt;
-
struct bsc_cbc_link *cbc;
};
diff --git a/include/osmocom/bsc/gsm_04_80.h b/include/osmocom/bsc/gsm_04_80.h
deleted file mode 100644
index 649ffe19f..000000000
--- a/include/osmocom/bsc/gsm_04_80.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma once
-
-struct gsm_subscriber_connection;
-
-int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level,
- const char *text);
-int bsc_send_ussd_release_complete(struct gsm_subscriber_connection *conn);
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 47849357f..d801d2c77 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -260,9 +260,6 @@ struct gsm_subscriber_connection {
/* flag to prevent multiple simultaneous ciphering commands */
int ciphering_handled;
- /* state related to welcome USSD */
- uint8_t new_subscriber;
-
/* SCCP connection associatd with this subscriber_connection */
struct {
/* for advanced ping/pong */
diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 8999a2e80..afc319b25 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -2,8 +2,6 @@
#include <osmocom/gsm/protocol/gsm_04_08.h>
-#define BSS_SEND_USSD 1
-
enum bsc_con {
BSC_CON_SUCCESS,
BSC_CON_REJECT_NO_LINK,
@@ -29,7 +27,6 @@ int bsc_delete_connection(struct gsm_subscriber_connection *sccp);
int bsc_scan_bts_msg(struct gsm_subscriber_connection *conn, struct msgb *msg);
int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg);
-int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn);
int bsc_handle_udt(struct bsc_msc_data *msc, struct msgb *msg, unsigned int length);
int bsc_handle_dt(struct gsm_subscriber_connection *conn, struct msgb *msg, unsigned int len);
diff --git a/include/osmocom/bsc/ussd.h b/include/osmocom/bsc/ussd.h
deleted file mode 100644
index 266546811..000000000
--- a/include/osmocom/bsc/ussd.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _USSD_H
-#define _USSD_H
-
-/* Handler function for mobile-originated USSD messages */
-
-#include <osmocom/core/msgb.h>
-
-int handle_rcv_ussd(struct gsm_subscriber_connection *conn, struct msgb *msg);
-
-#endif
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index 6009e1d44..51e0e7f93 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -55,7 +55,6 @@ osmo_bsc_SOURCES = \
codec_pref.c \
e1_config.c \
gsm_04_08_rr.c \
- gsm_04_80_utils.c \
gsm_data.c \
handover_cfg.c \
handover_decision.c \
diff --git a/src/osmo-bsc/gsm_04_80_utils.c b/src/osmo-bsc/gsm_04_80_utils.c
deleted file mode 100644
index 5ac022689..000000000
--- a/src/osmo-bsc/gsm_04_80_utils.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* OpenBSC utility functions for 3GPP TS 04.80 */
-
-/* (C) 2016 by sysmocom s.m.f.c. GmbH <info@sysmocom.de>
- *
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include <osmocom/gsm/gsm0480.h>
-#include <osmocom/bsc/bsc_subscr_conn_fsm.h>
-
-int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level,
- const char *text)
-{
- struct msgb *msg = gsm0480_create_ussd_notify(level, text);
- if (!msg)
- return -1;
- gscon_submit_rsl_dtap(conn, msg, 0, 0);
- return 0;
-}
-
-int bsc_send_ussd_release_complete(struct gsm_subscriber_connection *conn)
-{
- /* ugly: we obviously don't know if TID 0 is currently in user for the given subscriber... */
- struct msgb *msg = gsm0480_create_release_complete(0);
- if (!msg)
- return -1;
- gscon_submit_rsl_dtap(conn, msg, 0, 0);
- return 0;
-}
diff --git a/src/osmo-bsc/gsm_08_08.c b/src/osmo-bsc/gsm_08_08.c
index 7295f0cba..70559c065 100644
--- a/src/osmo-bsc/gsm_08_08.c
+++ b/src/osmo-bsc/gsm_08_08.c
@@ -26,7 +26,6 @@
#include <osmocom/bsc/gsm_08_08.h>
#include <osmocom/bsc/codec_pref.h>
-#include <osmocom/bsc/gsm_04_80.h>
#include <osmocom/bsc/gsm_04_08_rr.h>
#include <osmocom/bsc/a_reset.h>
@@ -106,50 +105,6 @@ int gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn)
return 0;
}
-static void bsc_send_ussd_no_srv(struct gsm_subscriber_connection *conn,
- struct msgb *msg, const char *text)
-{
- struct gsm48_hdr *gh;
- int8_t pdisc;
- uint8_t mtype;
- int drop_message = 1;
-
- if (!text)
- return;
-
- if (!msg || msgb_l3len(msg) < sizeof(*gh))
- return;
-
- gh = msgb_l3(msg);
- pdisc = gsm48_hdr_pdisc(gh);
- mtype = gsm48_hdr_msg_type(gh);
-
- /* Is CM service request? */
- if (pdisc == GSM48_PDISC_MM && mtype == GSM48_MT_MM_CM_SERV_REQ) {
- struct gsm48_service_request *cm;
-
- cm = (struct gsm48_service_request *) &gh->data[0];
-
- /* Is type SMS or call? */
- if (cm->cm_service_type == GSM48_CMSERV_SMS)
- drop_message = 0;
- else if (cm->cm_service_type == GSM48_CMSERV_MO_CALL_PACKET)
- drop_message = 0;
- }
-
- if (drop_message) {
- LOGP(DMSC, LOGL_DEBUG, "Skipping (not sending) USSD message: '%s'\n", text);
- return;
- }
-
- LOGP(DMSC, LOGL_INFO, "Sending CM Service Accept\n");
- gsm48_tx_mm_serv_ack(conn);
-
- LOGP(DMSC, LOGL_INFO, "Sending USSD message: '%s'\n", text);
- bsc_send_ussd_notify(conn, 1, text);
- bsc_send_ussd_release_complete(conn);
-}
-
static int is_cm_service_for_emerg(struct msgb *msg)
{
struct gsm48_service_request *cm;
@@ -319,7 +274,6 @@ static void handle_lu_request(struct gsm_subscriber_connection *conn,
{
struct gsm48_hdr *gh;
struct gsm48_loc_upd_req *lu;
- struct gsm48_loc_area_id lai;
int8_t rc8;
struct gsm_bts *bts = conn_get_bts(conn);
@@ -332,13 +286,6 @@ static void handle_lu_request(struct gsm_subscriber_connection *conn,
gh = msgb_l3(msg);
lu = (struct gsm48_loc_upd_req *) gh->data;
- gsm48_generate_lai2(&lai, bts_lai(conn_get_bts(conn)));
-
- if (memcmp(&lai, &lu->lai, sizeof(lai)) != 0) {
- LOGP(DMSC, LOGL_DEBUG, "Marking con for welcome USSD.\n");
- conn->new_subscriber = 1;
- }
-
rc8 = osmo_gsm48_rfpowercap2powerclass(bts->band, lu->classmark1.pwr_lev);
if (rc8 < 0) {
LOGP(DMSC, LOGL_NOTICE,
@@ -405,7 +352,6 @@ int bsc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, uint1
{
struct bsc_msc_data *msc;
struct msgb *resp;
- enum bsc_con ret;
struct gsm0808_speech_codec_list scl;
int rc = -2;
@@ -417,25 +363,13 @@ int bsc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, uint1
msc = bsc_find_msc(conn, msg);
if (!msc) {
LOGP(DMSC, LOGL_ERROR, "Failed to find a MSC for a connection.\n");
- bsc_send_ussd_no_srv(conn, msg,
- conn_get_bts(conn)->network->bsc_data->ussd_no_msc_txt);
rc = -1;
goto early_fail;
}
/* allocate resource for a new connection */
- ret = osmo_bsc_sigtran_new_conn(conn, msc);
-
- if (ret != BSC_CON_SUCCESS) {
- /* allocation has failed */
- if (ret == BSC_CON_REJECT_NO_LINK)
- bsc_send_ussd_no_srv(conn, msg, msc->ussd_msc_lost_txt);
- else if (ret == BSC_CON_REJECT_RF_GRACE)
- bsc_send_ussd_no_srv(conn, msg, msc->ussd_grace_txt);
+ if (osmo_bsc_sigtran_new_conn(conn, msc) != BSC_CON_SUCCESS)
goto early_fail;
- }
-
- /* check return value, if failed check msg for and send USSD */
bsc_scan_bts_msg(conn, msg);
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 388ad14fc..e65d0cf91 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -29,7 +29,6 @@
#include <osmocom/bsc/bsc_subscriber.h>
#include <osmocom/bsc/paging.h>
#include <osmocom/bsc/gsm_04_08_rr.h>
-#include <osmocom/bsc/gsm_04_80.h>
#include <osmocom/bsc/bsc_subscr_conn_fsm.h>
#include <osmocom/bsc/codec_pref.h>
#include <osmocom/bsc/abis_rsl.h>
@@ -1146,21 +1145,13 @@ static int bssmap_rcvmsg_dt1(struct gsm_subscriber_connection *conn,
return ret;
}
-int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn)
-{
- bsc_send_ussd_notify(conn, 1, conn->sccp.msc->ussd_welcome_txt);
- bsc_send_ussd_release_complete(conn);
-
- return 0;
-}
-
static int dtap_rcvmsg(struct gsm_subscriber_connection *conn,
struct msgb *msg, unsigned int length)
{
struct dtap_header *header;
struct msgb *gsm48;
uint8_t *data;
- int rc, dtap_rc;
+ int dtap_rc;
struct rate_ctr *ctrs;
LOGP(DMSC, LOGL_DEBUG, "Rx MSC DTAP: %s\n",
@@ -1202,12 +1193,10 @@ static int dtap_rcvmsg(struct gsm_subscriber_connection *conn,
memcpy(data, msg->l3h + sizeof(*header), length - sizeof(*header));
/* pass it to the filter for extra actions */
- rc = bsc_scan_msc_msg(conn, gsm48);
+ bsc_scan_msc_msg(conn, gsm48);
/* Store link_id in msgb->cb */
OBSC_LINKID_CB(gsm48) = header->link_id;
dtap_rc = osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_MT_DTAP, gsm48);
- if (rc == BSS_SEND_USSD)
- bsc_send_welcome_ussd(conn);
return dtap_rc;
}
diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c
index afe061ecc..eb82a7c90 100644
--- a/src/osmo-bsc/osmo_bsc_ctrl.c
+++ b/src/osmo-bsc/osmo_bsc_ctrl.c
@@ -26,7 +26,6 @@
#include <osmocom/bsc/osmo_bsc_rf.h>
#include <osmocom/bsc/bsc_msc_data.h>
#include <osmocom/bsc/signal.h>
-#include <osmocom/bsc/gsm_04_80.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/signal.h>
@@ -672,70 +671,6 @@ static int set_net_inform_msc(struct ctrl_cmd *cmd, void *data)
return CTRL_CMD_HANDLED;
}
-CTRL_CMD_DEFINE_WO(net_ussd_notify, "ussd-notify-v1");
-static int set_net_ussd_notify(struct ctrl_cmd *cmd, void *data)
-{
- struct gsm_subscriber_connection *conn;
- struct gsm_network *net;
- char *saveptr = NULL;
- char *cic_str, *alert_str, *text_str;
- int cic, alert;
-
- /* Verify has done the test for us */
- cic_str = strtok_r(cmd->value, ",", &saveptr);
- alert_str = strtok_r(NULL, ",", &saveptr);
- text_str = strtok_r(NULL, ",", &saveptr);
-
- if (!cic_str || !alert_str || !text_str) {
- cmd->reply = "Programming issue. How did this pass verify?";
- return CTRL_CMD_ERROR;
- }
-
- cmd->reply = "No connection found";
-
- cic = atoi(cic_str);
- alert = atoi(alert_str);
-
- net = cmd->node;
- llist_for_each_entry(conn, &net->subscr_conns, entry) {
- if (conn->user_plane.msc_assigned_cic != cic)
- continue;
-
- /*
- * This is a hack. My E71 does not like to immediately
- * receive a release complete on a TCH. So schedule a
- * release complete to clear any previous attempt. The
- * right thing would be to track invokeId and only send
- * the release complete when we get a returnResultLast
- * for this invoke id.
- */
- bsc_send_ussd_release_complete(conn);
- bsc_send_ussd_notify(conn, alert, text_str);
- cmd->reply = "Found a connection";
- break;
- }
-
- return CTRL_CMD_REPLY;
-}
-
-static int verify_net_ussd_notify(struct ctrl_cmd *cmd, const char *value, void *data)
-{
- char *saveptr = NULL;
- char *inp, *cic, *alert, *text;
-
- OSMO_ASSERT(cmd);
- inp = talloc_strdup(cmd, value);
-
- cic = strtok_r(inp, ",", &saveptr);
- alert = strtok_r(NULL, ",", &saveptr);
- text = strtok_r(NULL, ",", &saveptr);
-
- talloc_free(inp);
- if (!cic || !alert || !text)
- return 1;
- return 0;
-}
-
static int msc_signal_handler(unsigned int subsys, unsigned int signal,
void *handler_data, void *signal_data)
{
@@ -791,9 +726,6 @@ int bsc_ctrl_cmds_install(struct gsm_network *net)
rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_inform_msc);
if (rc)
goto end;
- rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_ussd_notify);
- if (rc)
- goto end;
rc = osmo_signal_register_handler(SS_L_INPUT, &bts_connection_status_trap_cb, net);
end:
diff --git a/src/osmo-bsc/osmo_bsc_filter.c b/src/osmo-bsc/osmo_bsc_filter.c
index b4985f286..98b51485c 100644
--- a/src/osmo-bsc/osmo_bsc_filter.c
+++ b/src/osmo-bsc/osmo_bsc_filter.c
@@ -21,7 +21,6 @@
#include <osmocom/bsc/osmo_bsc.h>
#include <osmocom/bsc/bsc_msc_data.h>
-#include <osmocom/bsc/gsm_04_80.h>
#include <osmocom/bsc/gsm_04_08_rr.h>
#include <osmocom/bsc/bsc_subscriber.h>
#include <osmocom/bsc/debug.h>
@@ -30,16 +29,6 @@
#include <stdlib.h>
-static int send_welcome_ussd(struct gsm_subscriber_connection *conn)
-{
- if (!conn->sccp.msc->ussd_welcome_txt) {
- LOGP(DMSC, LOGL_DEBUG, "No USSD Welcome text defined.\n");
- return 0;
- }
-
- return BSS_SEND_USSD;
-}
-
static int bsc_patch_mm_info(struct gsm_subscriber_connection *conn,
uint8_t *data, unsigned int length)
{
@@ -150,9 +139,6 @@ int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg)
gsm48_generate_lai2(lai, bts_lai(conn_get_bts(conn)));
}
}
-
- if (conn->new_subscriber)
- return send_welcome_ussd(conn);
return 0;
} else if (mtype == GSM48_MT_MM_INFO) {
bsc_patch_mm_info(conn, &gh->data[0], length);
diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c
index 2cc3d1a4e..9ee84d4cf 100644
--- a/src/osmo-bsc/osmo_bsc_grace.c
+++ b/src/osmo-bsc/osmo_bsc_grace.c
@@ -21,7 +21,6 @@
#include <osmocom/bsc/osmo_bsc_grace.h>
#include <osmocom/bsc/osmo_bsc_rf.h>
#include <osmocom/bsc/bsc_msc_data.h>
-#include <osmocom/bsc/gsm_04_80.h>
#include <osmocom/bsc/bsc_subscriber.h>
#include <osmocom/bsc/paging.h>
#include <osmocom/bsc/signal.h>
@@ -72,78 +71,3 @@ int bsc_grace_paging_request(enum signal_rf rf_policy,
return paging_request_bts(bts, subscr, chan_needed, msc);
return locked_paging_bts(bts, subscr, chan_needed, msc);
}
-
-static int handle_sub(struct gsm_lchan *lchan, const char *text)
-{
- struct gsm_subscriber_connection *conn;
-
- /* only send it to TCH */
- if (lchan->type != GSM_LCHAN_TCH_H && lchan->type != GSM_LCHAN_TCH_F)
- return -1;
-
- /* only send on the primary channel */
- conn = lchan->conn;
- if (!conn)
- return -1;
-
- if (conn->lchan != lchan)
- return -1;
-
- /* only when active */
- if (lchan->fi->state != LCHAN_ST_ESTABLISHED)
- return -1;
-
- bsc_send_ussd_notify(conn, 0, text);
- bsc_send_ussd_release_complete(conn);
-
- return 0;
-}
-
-/*
- * The place to handle the grace mode. Right now we will send
- * USSD messages to the subscriber, in the future we might start
- * a timer to have different modes for the grace period.
- */
-static int handle_grace(struct gsm_network *network)
-{
- int ts_nr, lchan_nr;
- struct gsm_bts *bts;
- struct gsm_bts_trx *trx;
-
- if (!network->bsc_data->mid_call_txt)
- return 0;
-
- llist_for_each_entry(bts, &network->bts_list, list) {
- llist_for_each_entry(trx, &bts->trx_list, list) {
- for (ts_nr = 0; ts_nr < TRX_NR_TS; ++ts_nr) {
- struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr];
- for (lchan_nr = 0; lchan_nr < TS_MAX_LCHAN; ++lchan_nr) {
- handle_sub(&ts->lchan[lchan_nr],
- network->bsc_data->mid_call_txt);
- }
- }
- }
- }
- return 0;
-}
-
-static int handle_rf_signal(unsigned int subsys, unsigned int signal,
- void *handler_data, void *signal_data)
-{
- struct rf_signal_data *sig;
-
- if (subsys != SS_RF)
- return -1;
-
- sig = signal_data;
-
- if (signal == S_RF_GRACE)
- handle_grace(sig->net);
-
- return 0;
-}
-
-static __attribute__((constructor)) void on_dso_load_grace(void)
-{
- osmo_signal_register_handler(SS_RF, handle_rf_signal, NULL);
-}
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index d36c85dd9..cbf0fec1a 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -32,7 +32,6 @@
#include <osmocom/bsc/osmo_bsc_grace.h>
#include <osmocom/bsc/osmo_bsc_sigtran.h>
#include <osmocom/bsc/a_reset.h>
-#include <osmocom/bsc/gsm_04_80.h>
#include <osmocom/bsc/bsc_subscr_conn_fsm.h>
#include <osmocom/bsc/gsm_data.h>
#include <osmocom/mgcp_client/mgcp_common.h>
@@ -426,24 +425,6 @@ int osmo_bsc_sigtran_send(struct gsm_subscriber_connection *conn, struct msgb *m
return rc;
}
-/* Send an USSD notification in case we loose the connection to the MSC */
-static void bsc_notify_msc_lost(struct gsm_subscriber_connection *conn)
-{
- /* Check if sccp conn is still present */
- if (!conn)
- return;
-
- /* check for config string */
- if (!conn->sccp.msc->ussd_msc_lost_txt)
- return;
- if (conn->sccp.msc->ussd_msc_lost_txt[0] == '\0')
- return;
-
- /* send USSD notification */
- bsc_send_ussd_notify(conn, 1, conn->sccp.msc->ussd_msc_lost_txt);
- bsc_send_ussd_release_complete(conn);
-}
-
/* Close all open sigtran connections and channels */
void osmo_bsc_sigtran_reset(const struct bsc_msc_data *msc)
{
@@ -456,9 +437,6 @@ void osmo_bsc_sigtran_reset(const struct bsc_msc_data *msc)
/* We only may close connections which actually belong to this
* MSC. All other open connections are left untouched */
if (conn->sccp.msc == msc) {
- /* Notify active connection users via USSD that the MSC is down */
- bsc_notify_msc_lost(conn);
-
/* Take down all occopied RF channels */
/* Disconnect all Sigtran connections */
/* Delete subscriber connection */
diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c
index 779121220..f6f512f72 100644
--- a/src/osmo-bsc/osmo_bsc_vty.c
+++ b/src/osmo-bsc/osmo_bsc_vty.c
@@ -120,21 +120,6 @@ static void write_msc(struct vty *vty, struct bsc_msc_data *msc)
vty_out(vty, " core-cell-identity %d%s",
msc->core_ci, VTY_NEWLINE);
- if (msc->ussd_welcome_txt)
- vty_out(vty, " bsc-welcome-text %s%s", msc->ussd_welcome_txt, VTY_NEWLINE);
- else
- vty_out(vty, " no bsc-welcome-text%s", VTY_NEWLINE);
-
- if (msc->ussd_msc_lost_txt && msc->ussd_msc_lost_txt[0])
- vty_out(vty, " bsc-msc-lost-text %s%s", msc->ussd_msc_lost_txt, VTY_NEWLINE);
- else
- vty_out(vty, " no bsc-msc-lost-text%s", VTY_NEWLINE);
-
- if (msc->ussd_grace_txt && msc->ussd_grace_txt[0])
- vty_out(vty, " bsc-grace-text %s%s", msc->ussd_grace_txt, VTY_NEWLINE);
- else
- vty_out(vty, " no bsc-grace-text%s", VTY_NEWLINE);
-
if (msc->audio_length != 0) {
int i;
@@ -210,8 +195,6 @@ static int config_write_bsc(struct vty *vty)
struct osmo_bsc_data *bsc = osmo_bsc_data(vty);
vty_out(vty, "bsc%s", VTY_NEWLINE);
- if (bsc->mid_call_txt)
- vty_out(vty, " mid-call-text %s%s", bsc->mid_call_txt, VTY_NEWLINE);
vty_out(vty, " mid-call-timeout %d%s", bsc->mid_call_timeout, VTY_NEWLINE);
if (bsc->rf_ctrl_name)
vty_out(vty, " bsc-rf-socket %s%s",
@@ -221,11 +204,6 @@ static int config_write_bsc(struct vty *vty)
vty_out(vty, " bsc-auto-rf-off %d%s",
bsc->auto_off_timeout, VTY_NEWLINE);
- if (bsc->ussd_no_msc_txt && bsc->ussd_no_msc_txt[0])
- vty_out(vty, " missing-msc-text %s%s", bsc->ussd_no_msc_txt, VTY_NEWLINE);
- else
- vty_out(vty, " no missing-msc-text%s", VTY_NEWLINE);
-
return CMD_SUCCESS;
}
@@ -339,118 +317,49 @@ error:
return CMD_ERR_INCOMPLETE;
}
-DEFUN(cfg_net_msc_welcome_ussd,
+#define LEGACY_STR "This command has no effect, it is kept to support legacy config files\n"
+
+DEFUN_DEPRECATED(deprecated_ussd_text,
cfg_net_msc_welcome_ussd_cmd,
- "bsc-welcome-text .TEXT",
- "Set the USSD notification to be sent\n" "Text to be sent\n")
+ "bsc-welcome-text .TEXT", LEGACY_STR LEGACY_STR)
{
- struct bsc_msc_data *data = bsc_msc_data(vty);
- char *str = argv_concat(argv, argc, 0);
- if (!str)
- return CMD_WARNING;
-
- osmo_talloc_replace_string(osmo_bsc_data(vty), &data->ussd_welcome_txt, str);
- talloc_free(str);
- return CMD_SUCCESS;
+ vty_out(vty, "%% osmo-bsc no longer supports USSD notification. These commands have no effect:%s"
+ "%% bsc-welcome-text, bsc-msc-lost-text, mid-call-text, bsc-grace-text, missing-msc-text%s",
+ VTY_NEWLINE, VTY_NEWLINE);
+ return CMD_WARNING;
}
-DEFUN(cfg_net_msc_no_welcome_ussd,
+DEFUN_DEPRECATED(deprecated_no_ussd_text,
cfg_net_msc_no_welcome_ussd_cmd,
"no bsc-welcome-text",
- NO_STR "Clear the USSD notification to be sent\n")
+ NO_STR LEGACY_STR)
{
- struct bsc_msc_data *data = bsc_msc_data(vty);
-
- talloc_free(data->ussd_welcome_txt);
- data->ussd_welcome_txt = NULL;
-
return CMD_SUCCESS;
}
-DEFUN(cfg_net_msc_lost_ussd,
+ALIAS_DEPRECATED(deprecated_ussd_text,
cfg_net_msc_lost_ussd_cmd,
- "bsc-msc-lost-text .TEXT",
- "Set the USSD notification to be sent on MSC connection loss\n" "Text to be sent\n")
-{
- struct bsc_msc_data *data = bsc_msc_data(vty);
- char *str = argv_concat(argv, argc, 0);
- if (!str)
- return CMD_WARNING;
-
- osmo_talloc_replace_string(osmo_bsc_data(vty), &data->ussd_msc_lost_txt, str);
- talloc_free(str);
- return CMD_SUCCESS;
-}
+ "bsc-msc-lost-text .TEXT", LEGACY_STR LEGACY_STR);
-DEFUN(cfg_net_msc_no_lost_ussd,
+ALIAS_DEPRECATED(deprecated_no_ussd_text,
cfg_net_msc_no_lost_ussd_cmd,
- "no bsc-msc-lost-text",
- NO_STR "Clear the USSD notification to be sent on MSC connection loss\n")
-{
- struct bsc_msc_data *data = bsc_msc_data(vty);
-
- talloc_free(data->ussd_msc_lost_txt);
- data->ussd_msc_lost_txt = 0;
-
- return CMD_SUCCESS;
-}
+ "no bsc-msc-lost-text", NO_STR LEGACY_STR);
-DEFUN(cfg_net_msc_grace_ussd,
+ALIAS_DEPRECATED(deprecated_ussd_text,
cfg_net_msc_grace_ussd_cmd,
- "bsc-grace-text .TEXT",
- "Set the USSD notification to be sent when the MSC has entered the grace period\n" "Text to be sent\n")
-{
- struct bsc_msc_data *data = bsc_msc_data(vty);
- char *str = argv_concat(argv, argc, 0);
- if (!str)
- return CMD_WARNING;
-
- osmo_talloc_replace_string(osmo_bsc_data(vty), &data->ussd_grace_txt, str);
- talloc_free(str);
- return CMD_SUCCESS;
-}
+ "bsc-grace-text .TEXT", LEGACY_STR LEGACY_STR);
-DEFUN(cfg_net_msc_no_grace_ussd,
+ALIAS_DEPRECATED(deprecated_no_ussd_text,
cfg_net_msc_no_grace_ussd_cmd,
- "no bsc-grace-text",
- NO_STR "Clear the USSD notification to be sent when the MSC has entered the grace period\n")
-{
- struct bsc_msc_data *data = bsc_msc_data(vty);
-
- talloc_free(data->ussd_grace_txt);
- data->ussd_grace_txt = NULL;
-
- return CMD_SUCCESS;
-}
+ "no bsc-grace-text", NO_STR LEGACY_STR);
-DEFUN(cfg_net_bsc_missing_msc_ussd,
+ALIAS_DEPRECATED(deprecated_ussd_text,
cfg_net_bsc_missing_msc_ussd_cmd,
- "missing-msc-text .TEXT",
- "Set the USSD notification to be send when a MSC has not been found.\n" "Text to be sent\n")
-{
- struct osmo_bsc_data *data = osmo_bsc_data(vty);
- char *txt = argv_concat(argv, argc, 0);
- if (!txt)
- return CMD_WARNING;
-
- osmo_talloc_replace_string(data, &data->ussd_no_msc_txt, txt);
- talloc_free(txt);
- return CMD_SUCCESS;
-}
+ "missing-msc-text .TEXT", LEGACY_STR LEGACY_STR);
-DEFUN(cfg_net_bsc_no_missing_msc_text,
+ALIAS_DEPRECATED(deprecated_no_ussd_text,
cfg_net_bsc_no_missing_msc_text_cmd,
- "no missing-msc-text",
- NO_STR "Clear the USSD notification to be send when a MSC has not been found.\n")
-{
- struct osmo_bsc_data *data = osmo_bsc_data(vty);
-
- talloc_free(data->ussd_no_msc_txt);
- data->ussd_no_msc_txt = 0;
-
- return CMD_SUCCESS;
-}
-
+ "no missing-msc-text", NO_STR LEGACY_STR);
DEFUN(cfg_net_msc_type,
cfg_net_msc_type_cmd,
@@ -670,21 +579,10 @@ DEFUN(cfg_msc_osmux,
return CMD_SUCCESS;
}
-DEFUN(cfg_net_bsc_mid_call_text,
+ALIAS_DEPRECATED(deprecated_ussd_text,
cfg_net_bsc_mid_call_text_cmd,
"mid-call-text .TEXT",
- "Set the USSD notification sent to running calls when switching from Grace to Off.\n"
- "Text to be sent\n")
-{
- struct osmo_bsc_data *data = osmo_bsc_data(vty);
- char *txt = argv_concat(argv, argc, 0);
- if (!txt)
- return CMD_WARNING;
-
- osmo_talloc_replace_string(data, &data->mid_call_txt, txt);
- talloc_free(txt);
- return CMD_SUCCESS;
-}
+ LEGACY_STR LEGACY_STR);
DEFUN(cfg_net_bsc_mid_call_timeout,
cfg_net_bsc_mid_call_timeout_cmd,
@@ -866,8 +764,6 @@ DEFUN(show_subscr_all,
return CMD_SUCCESS;
}
-#define LEGACY_STR "This command has no effect, it is kept to support legacy config files\n"
-
DEFUN_DEPRECATED(cfg_net_msc_ping_time, cfg_net_msc_ping_time_cmd,
"timeout-ping ARG", LEGACY_STR "-\n")
{
diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c
index 5d8711838..164f78fe5 100644
--- a/tests/bsc/bsc_test.c
+++ b/tests/bsc/bsc_test.c
@@ -29,7 +29,6 @@
#include <osmocom/bsc/osmo_bsc.h>
#include <osmocom/bsc/bsc_msc_data.h>
-#include <osmocom/bsc/gsm_04_80.h>
#include <osmocom/core/application.h>
#include <osmocom/core/backtrace.h>
diff --git a/tests/codec_pref/codec_pref_test.c b/tests/codec_pref/codec_pref_test.c
index 8bc31cd0e..f163f35a6 100644
--- a/tests/codec_pref/codec_pref_test.c
+++ b/tests/codec_pref/codec_pref_test.c
@@ -22,7 +22,6 @@
#include <osmocom/bsc/gsm_data.h>
#include <osmocom/bsc/osmo_bsc.h>
#include <osmocom/bsc/bsc_msc_data.h>
-#include <osmocom/bsc/gsm_04_80.h>
#include <osmocom/core/application.h>
#include <osmocom/bsc/codec_pref.h>
diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am
index 901d5231e..84865a06d 100644
--- a/tests/handover/Makefile.am
+++ b/tests/handover/Makefile.am
@@ -63,7 +63,6 @@ handover_test_LDADD = \
$(top_builddir)/src/osmo-bsc/chan_alloc.o \
$(top_builddir)/src/osmo-bsc/codec_pref.o \
$(top_builddir)/src/osmo-bsc/gsm_04_08_rr.o \
- $(top_builddir)/src/osmo-bsc/gsm_04_80_utils.o \
$(top_builddir)/src/osmo-bsc/gsm_data.o \
$(top_builddir)/src/osmo-bsc/handover_cfg.o \
$(top_builddir)/src/osmo-bsc/handover_decision.o \
diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py
index a99bf4b63..c96965cdc 100755
--- a/tests/vty_test_runner.py
+++ b/tests/vty_test_runner.py
@@ -135,68 +135,6 @@ class TestVTYBSC(TestVTYGenericBSC):
self.assertTrue(self.vty.verify("exit", ['']))
self.assertTrue(self.vty.node() is None)
- def testUssdNotificationsMsc(self):
- self.vty.enable()
- self.vty.command("configure terminal")
- self.vty.command("msc")
-
- # Test invalid input
- self.vty.verify("bsc-msc-lost-text", ['% Command incomplete.'])
- self.vty.verify("bsc-welcome-text", ['% Command incomplete.'])
- self.vty.verify("bsc-grace-text", ['% Command incomplete.'])
-
- # Enable USSD notifications
- self.vty.verify("bsc-msc-lost-text MSC disconnected", [''])
- self.vty.verify("bsc-welcome-text Hello MS", [''])
- self.vty.verify("bsc-grace-text In grace period", [''])
-
- # Verify settings
- res = self.vty.command("write terminal")
- self.assertTrue(res.find('bsc-msc-lost-text MSC disconnected') > 0)
- self.assertEqual(res.find('no bsc-msc-lost-text'), -1)
- self.assertTrue(res.find('bsc-welcome-text Hello MS') > 0)
- self.assertEqual(res.find('no bsc-welcome-text'), -1)
- self.assertTrue(res.find('bsc-grace-text In grace period') > 0)
- self.assertEqual(res.find('no bsc-grace-text'), -1)
-
- # Now disable it..
- self.vty.verify("no bsc-msc-lost-text", [''])
- self.vty.verify("no bsc-welcome-text", [''])
- self.vty.verify("no bsc-grace-text", [''])
-
- # Verify settings
- res = self.vty.command("write terminal")
- self.assertEqual(res.find('bsc-msc-lost-text MSC disconnected'), -1)
- self.assertTrue(res.find('no bsc-msc-lost-text') > 0)
- self.assertEqual(res.find('bsc-welcome-text Hello MS'), -1)
- self.assertTrue(res.find('no bsc-welcome-text') > 0)
- self.assertEqual(res.find('bsc-grace-text In grace period'), -1)
- self.assertTrue(res.find('no bsc-grace-text') > 0)
-
- def testUssdNotificationsBsc(self):
- self.vty.enable()
- self.vty.command("configure terminal")
- self.vty.command("bsc")
-
- # Test invalid input
- self.vty.verify("missing-msc-text", ['% Command incomplete.'])
-
- # Enable USSD notifications
- self.vty.verify("missing-msc-text No MSC found", [''])
-
- # Verify settings
- res = self.vty.command("write terminal")
- self.assertTrue(res.find('missing-msc-text No MSC found') > 0)
- self.assertEqual(res.find('no missing-msc-text'), -1)
-
- # Now disable it..
- self.vty.verify("no missing-msc-text", [''])
-
- # Verify settings
- res = self.vty.command("write terminal")
- self.assertEqual(res.find('missing-msc-text No MSC found'), -1)
- self.assertTrue(res.find('no missing-msc-text') > 0)
-
def testNetworkTimezone(self):
self.vty.enable()
self.vty.verify("configure terminal", [''])