From 8a6ef55ec5838bdac3b5780bfc404c9b732d944f Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Tue, 12 Jun 2018 08:21:20 +0700 Subject: libmsc/gsm_09_11.c: forward SS/USSD messages to HLR over GSUP In order to be able to support external SS/USSD gateway, we should not terminate the GSM 04.80 messages at OsmoMSC. Instead, we need to follow the GSM TS 09.11 specification, and forward all messages unhandled by OsmoMSC to OsmoHLR over GSUP protocol. This change implements forwarding of MO SS/USSD messages. The forwarding assumes transcoding between GSM 04.80 messages and GSUP messages. The payload of Facility IE is carried 'as is'. As a side-effect, this will disable the osmo-msc internal handler implementing the "*#100#" for obtaining the subscribers own phone number. In order to re-gain this functionality, you will need a modern osmo-hlr (Change-Id I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9) and the following line in your osmo-hlr.cfg: hlr ussd route prefix *#100# internal own-msisdn TTCN-3 test case: I01de73aced6057328a121577a5a83bc2615fb2d4 Change-Id: Ide5f7e350b537db80cd8326fc59c8bf2e01cb68c --- tests/msc_vlr/msc_vlr_test_ss.c | 10 ++++++++++ tests/msc_vlr/msc_vlr_test_ss.err | 19 ++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/msc_vlr/msc_vlr_test_ss.c b/tests/msc_vlr/msc_vlr_test_ss.c index f3a1f68e5..f0652b07b 100644 --- a/tests/msc_vlr/msc_vlr_test_ss.c +++ b/tests/msc_vlr/msc_vlr_test_ss.c @@ -94,11 +94,21 @@ static void _test_ss_ussd(enum ran_type via_ran) EXPECT_ACCEPTED(true); /* MT: GSM 04.80 RELEASE COMPLETE with Facility IE */ + gsup_expect_tx("20" /* OSMO_GSUP_MSGT_PROC_SS_REQUEST */ + "0108" "09710000004026f0" /* IMSI TLV */ + "3004" "20000001" /* Session ID TLV */ + "3101" "01" /* Session state: BEGIN */ + "3515" FACILITY_IE_REQ); dtap_expect_tx("8b2a" "1c27" FACILITY_IE_RSP); expect_release_clear(via_ran); /* MO: GSM 04.80 REGISTER with Facility IE and SS version IE */ ms_sends_msg("0b7b" "1c15" FACILITY_IE_REQ "7f0100"); + gsup_rx("20" /* OSMO_GSUP_MSGT_PROC_SS_REQUEST */ + "0108" "09710000004026f0" /* IMSI TLV */ + "3004" "20000001" /* Session ID TLV */ + "3101" "03" /* Session state: END */ + "3527" FACILITY_IE_RSP, NULL); VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); ASSERT_RELEASE_CLEAR(via_ran); diff --git a/tests/msc_vlr/msc_vlr_test_ss.err b/tests/msc_vlr/msc_vlr_test_ss.err index c7f77119e..fce5bb6a6 100644 --- a/tests/msc_vlr/msc_vlr_test_ss.err +++ b/tests/msc_vlr/msc_vlr_test_ss.err @@ -162,22 +162,27 @@ DREF VLR subscr MSISDN:46071 usage increases to: 3 DREF MSISDN:46071: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) DMM MSISDN:46071: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false DREF MSISDN:46071: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) +GSUP --> HLR: OSMO_GSUP_MSGT_PROC_SS_REQUEST: 20010809710000004026f03004200000013101013515a11302010102013b300b04010f0406aa510c061b01 DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:46071: MSISDN = 46071 +DREF MSISDN:46071: MSC conn use - dtap == 1 (0x40: trans_nc_ss) +<-- GSUP rx OSMO_GSUP_MSGT_PROC_SS_REQUEST: 20010809710000004026f03004200000013101033527a225020101302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +DVLR GSUP rx 61: 20010809710000004026f03004200000013101033527a225020101302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +DREF VLR subscr MSISDN:46071 usage increases to: 4 +DMSC Routed to GSM 09.11 SS/USSD handler DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A - DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020101302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message -DREF VLR subscr MSISDN:46071 usage decreases to: 2 -DREF MSISDN:46071: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:46071: MSC conn use - dtap == 0 (0x0: ) +DREF VLR subscr MSISDN:46071 usage decreases to: 3 +DREF MSISDN:46071: MSC conn use - trans_nc_ss == 0 (0x0: ) DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:46071: MSC conn use + release == 1 (0x100: release) -DREF VLR subscr MSISDN:46071 usage increases to: 3 -DREF VLR subscr MSISDN:46071 usage decreases to: 2 +DREF VLR subscr MSISDN:46071 usage increases to: 4 +DREF VLR subscr MSISDN:46071 usage decreases to: 3 - BSSAP Clear --RAN_GERAN_A--> MS +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_PROC_SS_REQUEST: vlr_gsupc_read_cb() returns 0 dtap_tx_confirmed == 1 bssap_clear_sent == 1 - all requests serviced, conn has been released -- cgit v1.2.3