aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2019-01-16Enable SMS-related log in VLR testsMax7-1/+589
The likely reason why it was disabled is due to paging_cb_mmsms_est_req() logging pointers which results in unstable log output. Fixing this allows us to track SMS-related regressions properly. Change-Id: I44ae817d9edb73d182ff33ff5a2fd942e224e344
2019-01-16VLR: send CHECK-IMEI to EIR/HLROliver Smith6-56/+853
When check-imei-req is enabled in the VTY config, do not accept IMEIs sent by the ME directly anymore. Send the IMEI to the EIR/HLR and wait for its ACK or NACK. OsmoHLR also accepts all IMEIs at this point, but this allows to optionally store the IMEI in the HLR DB. Depends: Ib240474b0c3c603ba840cf26babb38a44dfc9364 (osmo-hlr) Related: OS#3733 Change-Id: Ife868ed71c36cdd02638072abebf61fc949080a7
2019-01-12msc_vlr_tests: tweak logging in verbose modeNeels Hofmeyr1-2/+7
Change-Id: Ia06245f3adc6cf4c483d9c12c387cd5169582353
2019-01-12mm_rx_id_resp(): use osmo_mi_name()Neels Hofmeyr4-14/+14
Change-Id: I6bb053def223ed698351ad9f52c1e36293df5d59
2019-01-12refactor log ctx for vlr_subscr and ran_connNeels Hofmeyr12-11351/+11648
ran_conn_get_conn_id(): instead of a talloc allocated string, return a static buffer in ran_conn_get_conn_id(). So far this function had no callers. Refactor ran_conn_update_id() API: during early L3-Complete, when no subscriber is associated yet, update the FSM Id by the MI type seen in the L3 Complete message: ran_conn_update_id_from_mi(). Later on set the vsub and re-update. Call vlr.ops->subscr_update when the TMSI is updated, so that log context includes the TMSI from then on. Enrich context for vlr_subscr_name and ran_conn fi name. Include all available information in vlr_subscr_name(); instead of either IMSI or MSISDN or TMSI, print all of them when present. Instead of a short log, rather have more valuable context. A context info would now look like: Process_Access_Request_VLR(IMSI-901700000014706:MSISDN-2023:TMSI-0x08BDE4EC:GERAN-A-3:PAGING_RESP) It does get quite long, but ensures easy correlation of any BSSAP / IuCS messages with log output, especially if multiple subscribers are busy at the same time. Print TMSI and TMSInew in uppercase hexadecimal, which is the typical representation in the telecom world. When showing the RAN conn id GERAN_A-00000017 becomes GERAN-A-23 - We usually write the conn_id in decimal. - Leading zeros are clutter and might suggest hexadecimal format. - 'GERAN-A' and 'UTRAN-Iu' are the strings defined by osmo_rat_type_name(). Depends: I7798c3ef983c2e333b2b9cbffef6f366f370bd81 (libosmocore) Depends: Ica25919758ef6cba8348da199b0ae7e0ba628798 (libosmocore) Change-Id: I66a68ce2eb8957a35855a3743d91a86299900834
2019-01-12rx CM Service Req: reject double use soonerNeels Hofmeyr1-2/+1
When a CM Service Req is being rejected, we should do so before changing the state of the current conn. Concerning multiple CM Service Requests: in fact we should store multiple requests, but first fix the status quo of rejecting multiple requests. Change-Id: I39209ee6662694aa054a2fc0d21eae76fb33e2f1
2019-01-12add LOG_RAN_CONN() to use the conn->fi->id for contextNeels Hofmeyr13-219/+237
For each conn, set a default logging category, to distinguish categories for BSSMAP and RANAP based conns. LOG_RAN_CONN(): log with the conn's default category, LOG_RAN_CONN_CAT(): log with a manually set category (mostly for keeping previous DMM logging on the same category). In some places, replace LOGP() using manual context with LOG_RAN_CONN(), and remove the manual context info, now provided by the conn->fi->id. This is loosely related to inter-BSC and inter-MSC handover: to speed up refactoring, I want to avoid the need for manual logging context and just use this LOG_RAN_CONN(). Change-Id: I0a7809840428b1e028df6eb683bc5ffcc8df474a
2019-01-12use osmo_lu_type_name() from libosmocoreNeels Hofmeyr9-60/+60
Change-Id: Ib562bb5fb272c0c3ae0849f32b28faa2c26f9bb7
2019-01-09msc_vty.c: make check-imei-rqd configurableOliver Smith1-0/+1
Related: OS#3189 Change-Id: Iee516b9cd7877b21207ce9a6d954109f19558163
2019-01-04use osmo_rat_type from libosmocoreNeels Hofmeyr24-792/+792
Replace locally defined enum ran_type with libosmocore's new enum osmo_rat_type, and value_string ran_type_names with osmo_rat_type_names. The string representations change, which has cosmetic effects on the test suite expectations. Depends: I659687aef7a4d67ca372a39fef31dee07aed7631 (libosmocore) Change-Id: I2c78c265dc99df581e1b00e563d6912c7ffdb36b
2019-01-04vty cfg: move 'ipa-name' from 'msc' to 'hlr' sectionNeels Hofmeyr1-1/+1
during code review, I completely overlooked this: We've added the 'ipa-name', which identifies the MSC on the GSUP link to the HLR, under the 'msc' section, while all other GSUP/HLR related config is under the 'hlr' section. Before we roll that out in a release, move it over to 'hlr'. Related: OS#3355 Change-Id: I1a572865aa90c5fa43c6f57282a6e2b06776e425
2019-01-04remove code dup: add msc_mgcp_try_call_assignment()Neels Hofmeyr2-4/+4
Various places in the code check a flag whether assignment was started and launch it. To fix incoming-call-during-ongoing-call, I will tweak that logic. To be able to do that only in one place, remove code dup. Cosmetic preparation for I1f8746e7babfcd3028a4d2c0ba260c608c686c76 and I0ba216b737909e92080a722db26e3577726c63cb/ Depends: I11b182a03f5ecb6df7cd8f260757d3626c8e945d (libosmocore: LOGPFSMSL) Change-Id: I11c0b7dc3f1a747028629b48e522bb3b864884ba
2018-12-30libmsc/VTY: introduce kill-switch for routing SMS over GSUPVadim Yanitskiy1-0/+2
As a rudiment of OsmoNiTB, OsmoMSC is still involved in SMS processing, storage (in SQLite DB), and routing (via SMPP). In real networks this is done by the external entity called SMSC (SMS Centre), while the MSC is doing re-encapsulation of GSM 04.11 SM-TL (Transport Layer) payload (i.e. TPDU) between SM-RL (Relay Layer) and MAP. Since OsmoMSC itself is not a 'Network in The Box' anymore, it makes sense to replicate the 'traditional' behaviour of MSC. The problem is that this behaviour cannot co-exist with the current implementation, so the key idea is to rip out the local SMS storage and routing from OsmoMSC, and (re)implement it in a separate process (OsmoSMSC?). As a temporary solution, this change introduces a 'kill-switch' VTY option that enables routing of SMS messages over GSUP towards ESME (through VLR and HLR), but breaks the local storage and routing. This is why it's disabled by default. As soon as we move the SMS processing and storage away from OsmoMSC, this behaviour would be enabled by default, and the VTY option would be hidden and deprecated. At the moment, this option basically does nothing, and will take an effect in the follow-up changes. Change-Id: Ie57685ed2ce1e4c978e775b68fdffe58de44882b Related: OS#3587
2018-12-20fix test_nodes.vty after libosmo-mgcp-client vty changesNeels Hofmeyr1-2/+0
osmo-mgw I98a9f1f17a1c4ab20cea3b08c7d21663592134d6 broke the build here. Fix that. Change-Id: I20e37c5228928b67e67f16aef0eb2930d21ef60a
2018-12-19Remove redundancy in LAC processingMax2-2/+2
Always use LAC which is part of Cell Global ID otherwise we might end up in a situation where separately stored LAC differs. Both are described in 3GPP TS 23.008 $2.4 as temporary subscriber data to be stored in VLR. Both are defined in 3GPP TS 23.003. The LAC is part of LAI which is part of CGI so there should be no case when those values differ for a given subscriber. Change-Id: I993ebc3e14f25e83124b6d3f8461a4b18f971f8e
2018-12-18VLR tests: avoid leaking LAC access detailsMax4-9/+9
Avoid leaking details on accessing data structure for LAC value into test output: that's irrelevant clutter which forces unnecessary test output modifications. Change-Id: I4a1d7884cf47ad513d7d6fb27c5c6f1b829dff2e
2018-12-18VLR tests: add logging macro with explicit value descriptionMax1-3/+5
To avoid leaking structure details into test we sometimes have to separate value description from actual value. Introduce new macro which makes that possible and convert old one into trivial wrapper around it. Change-Id: Ic462297edac4c55689f93cc45771c8b5e2aed864
2018-12-11make gsup ipa name configurable in osmo-msc.cfgStefan Sperling15-121/+122
Add a 'ipa-name' VTY command which overrides the default IPA name used by the MSC. This is a prerequisite for inter-MSC handover. Related: OS#3355 Change-Id: I317d6c59f77e92fbb2b875a83dc0ec2fa5cb6006
2018-12-11LU: do not always invoke sub_pres_vlr_fsm_start()Neels Hofmeyr11-496/+0
sub_pres_vlr_fsm_start() starts the FSM, invokes the START event, and then this FSM invariably always directly terminates when vsub->ms_not_reachable_flag == false. So if it is false, there is not much use in instantiating a whole FSM instance that just terminates again, we might as well directly issue the parent-term-event and save some logging space. The same condition is already in place in the vlr_proc_acc_fsm.c in _proc_arq_vlr_node2_post_vlr() for CM Service Request and Paging Response. Now also skip this for LU. Change-Id: Id2303a795dfd381f76e94ff8ff2f495926ca8ba0
2018-12-05add VTY commands: mncc internal / external (== -M)Neels Hofmeyr1-0/+25
So far the only way to use external MNCC is to pass the -M cmdline arg: osmo-msc -M /path/to/socket However, the osmo-msc.service file for systemd is installed by 'make install', and hence it is quite impractical to depend on such a config item to be required in the service file: - It defies any scheme an operator may have in place to compose the osmo-msc.cfg file -- this option doesn't go in the .cfg file but needs separate action to add to the installed service file. - After a make install or package upgrades / re-installations, this option will be plain overwritten silently, or lead to the need for resolving file conflicts. The initial spark for this came from configuring the 35c3 GSM from cfg templates. Change-Id: I2ec59d5eba407f83295528b51b93678d446b9cee
2018-12-05vty: mncc cfg: separate the 'mncc' from 'mncc-guard-timeout'Neels Hofmeyr1-2/+2
I want to add 'mncc internal' and 'mncc external' commands, and IMHO makes most sense to have a common 'mncc' keyword to start MNCC config commands with. To put it in terms of VTY online help: OsmoMSC(config-msc)# mncc ? internal Use internal MNCC handler external Use internal MNCC handler guard-timeout Set global guard timeout So far only the 'guard-timeout' exists, I want to add 'internal' and 'external' in a subsequent commit. Keep the old command 'mncc-guard-timeout' as deprecated alias. That means it still works from old config files, but online documentation will omit it. On 'write', write back the new format instead. Rationale: see I2ec59d5eba407f83295528b51b93678d446b9cee Change-Id: I52d69af48e1ddc87b3fb54bf66a01b1b8cbf5abe
2018-12-05add test_nodes.vty transcript testNeels Hofmeyr2-1/+107
It needs to work whether SMPP,Iu are enable or disabled, hence a bit more wildcarding than one might expect. Change-Id: I3a8c50d8d555b6b948d97d6412e17594ee439de0
2018-12-05make: prepare for adding transcript testsNeels Hofmeyr1-6/+41
Separate 'make python-test' into separate make targets, to sensibly add VTY transcript tests in an upcoming commit. Feature: even though ./configure was called without --enable-external-tests, each of the {ctrl,vty}x{python,transcript} tests can be invoked individually by e.g. 'make vty-python-test'. Both 'vty-transcript-test' and 'ctrl-transcript-test' are still empty, a subsequent patch adds a vty-transcript-test. All of this in preparation of tweaking the 'mncc' vty configuration, to be able to track it in a vty transcript test. Change-Id: I688657e56ae469c07b9f25ba37275d38dbd457e2
2018-12-05python tests: use py shebang instead of $(PYTHON)Neels Hofmeyr4-6/+6
I'm going to make the external tests manually launchable. For that I first had an error message if $(PYTHON) was empty. But Pau says I should just use shebang instead and ignore the autoconf python stuff, since that often fails anyway. Change-Id: Ie35dd78c42577109a6a3143221a9769e47d361a5
2018-11-30GSM_EXTENSION_LENGTH -> VLR_MSISDN_LENGTHNeels Hofmeyr1-1/+2
gsm_subscriber.h contains some legacy cruft, part of which is that the VLR's max MSISDN length should rather be defined in vlr.h. Same for GSM_NAME_LENGTH -> VLR_NAME_LENGTH. Adjust some sms_queue stuff that anyway includes vlr.h already. Drop gsm_subscriber.h from vlr.h. Add other (more concise) includes that thus become necessary, since the include chain vlr.h->gsm_subscriber.h->gsm_data.h is no longer in place. Change-Id: Iab5c507ec04fc2884187cf946f6ae2240e4a31f8
2018-11-30move gsm_auth_tuple to vlr.h as vlr_auth_tupleNeels Hofmeyr1-1/+1
Along goes GSM_KEYSEQ_INVAL as VLR_*. It's where it logically belongs, and is almost the only reason why vlr.h includes gsm_data.h. The remaining reason, GSM_EXTENSION_LENGTH, will be moved by upcoming patch. Change-Id: I122feae7ee3cbc59e941daef35a954bce29fec76
2018-11-30combine several small .h in msc_common.hNeels Hofmeyr1-1/+0
For hysterical raisins, there are some header files that contain few declarations, and where the name doesn't reflect the content. Combine them to new msc_common.h: - common.h - common_cs.h - osmo_msc.h Change-Id: I9e3a587342f8d398fb27354a2f2475f8797cdb28
2018-11-30rename some RAN conn related stuff to ran_conn_*Neels Hofmeyr2-6/+6
Following previous rename of gsm_subscriber_connection: Some functions and #defines are still called like "msc_conn" or just "msc_", while they are clearly about a RAN conn. To avoid confusion with the future separate concepts of MSC roles and a RAN connection, rename all those to match the common "ran_conn" prefix. Change-Id: Ia17a0a35f11911e00e19cafb5d7828d729a69640
2018-11-30rename gsm_subscriber_connection to ran_connNeels Hofmeyr18-3277/+3277
In preparation for inter-BSC and inter-MSC handover, we need to separate the subscriber management logic from the actual RAN connections. What better time to finally rename gsm_subscriber_connection. * Name choice: In 2G, this is a connection to the BSS, but even though 3GPP TS commonly talk of "BSS-A" and "BSS-B" when explaining handover, it's not good to call it "bss_conn": in 3G a BSS is called RNS, IIUC. The overall term for 2G (GERAN) and 3G (UTRAN) is RAN: Radio Access Network. * Rationale: A subscriber in the MSC so far has only one RAN connection, but e.g. for inter-BSC handover, a second one needs to be created to handover to. Most of the items in the former gsm_subscriber_connection are actually related to the RAN, with only a few MM and RTP related items. So, as a first step, just rename it to ran_conn, to cosmetically prepare for moving the not strictly RAN related items away later. Also: - Rename some functions from msc_subscr_conn_* to ran_conn_* - Rename "Subscr_Conn" FSM instance name to "RAN_conn" - Rename SUBSCR_CONN_* to RAN_CONN_* Change-Id: Ic595f7a558d3553c067f77dc67543ab59659707a
2018-11-30drop unused tests/db/*Neels Hofmeyr5-337/+0
Another one of those "what is this still doing here". Not mentioned in configure.ac nor Makefile.am SUBDIR... Change-Id: I05880507d9bf029f0ec451efda0ebe54ac09ef12
2018-11-29libmsc/gsm_04_11.c: refactor MT SMS message handlingVadim Yanitskiy7-121/+130
According to GSM TS 04.11, the SMC (Short Message Control) state machine is a part of CM-sublayer of L3, that is responsible for connection management (establisment and releasing), and SM-RP (Relay Protocol) message delivery. For some reason, the connection establisment request from SMC (GSM411_MMSMS_EST_REQ) was not handled properly - it was always assumed that connection is already established. This is why the code initiating a MT (Mobile Terminated) SMS transfer had to establish a radio connection with subscriber manually. Let's benefit from having the SMC state machine, and offload connection establishment to it. This change makes the local implementation closer to GSM TS 04.11, and facilitates the further integration of GSUP transport. NOTE: the expected unit test output is changed, because now we always allocate a transaction first, and then establish a connection, not vice versa. Change-Id: I4a07ece80d8dd40b23da6bb1ffc9d3d745b54092
2018-11-23osmo_msc: remove unused parameter from msc_dtap()Philipp Maier1-1/+1
The parameter link_id in the function msc_dtap() is unused. Lets remove it. Change-Id: I7ba67b0cb514c91bc87a7b396ed3962b7a68e7da
2018-11-22msc_vlr_tests.c: drop duplicating DMM category definitionVadim Yanitskiy1-5/+0
Change-Id: I2bf8150580c318ccaa9c30657582c15020f6b711
2018-11-18msc_vlr_tests: tweak conn_exists()Max2-5/+10
* constify function parameter * internalize parameter check Change-Id: Icf507d094319123c6667ba963db1d385df4d4f92
2018-10-24gsm_04_08_cc: Add global guard timer for MNCCPhilipp Maier1-0/+28
The external MNCC handler may hang indefinitely in cases where the remote end of the MNCC ceases to work properly. Add a global guard timer to make sure the call reaches ACTIVE state. Change-Id: I7375d1e17cd746aac4eadfe1e587e82cf1630d3d Related: OS#3599
2018-09-30GSUP client: send CN domain IE on LU requestNeels Hofmeyr24-175/+175
Give the HLR a chance to send us updated subscriber data by indicating the CN domain to be Circuit Switched, only during a LU Request GSUP message. Adjust msc_vlr_tests to expect the added GSUP CN domain IE to indicate CS, i.e. append '280102'. Related: OS#3601 Change-Id: I0c2d33fbfdb4728e480679120d06b7f3a2ccfd76
2018-09-17A5/n Ciph: request Classmark Update if missingNeels Hofmeyr7-26/+1565
When the VLR requests a Ciphering Mode with vlr_ops.set_ciph_mode(), and if we need a ciph algo flag from a Classmark information that is not yet known (usually CM 2 during LU), send a BSSMAP Classmark Request to get it. To manage the intermission of the Classmark Request, add - msc_classmark_request_then_cipher_mode_cmd(), - state SUBSCR_CONN_S_WAIT_CLASSMARK_UPDATE, - event SUBSCR_CONN_E_CLASSMARK_UPDATE. From state AUTH_CIPH, switch to state WAIT_CLASSMARK_UPDATE. Once the BSSMAP Classmark Response, is received, switch back to SUBSCR_CONN_S_AUTH_CIPH and re-initiate Ciphering Mode. To be able to re-enter the Ciphering Mode algo decision, factor it out into msc_geran_set_cipher_mode(). Rationale: In the following commit, essentially we stopped supporting A5/3 ciphering: commit 71330720b6efdda2fcfd3e9c0cb45f89e32e5670 "MSC: Intersect configured A5 algorithms with MS-supported ones" Change-Id: Id124923ee52a357cb7d3e04d33f585214774f3a3 A5/3 was no longer supported because from that commit on, we strictly checked the MS-supported ciphers, but we did not have Classmark 2 available during Location Updating. This patch changes that: when Classmark 2 is missing, actively request it by a BSSMAP Classmark Request; continue Ciphering only after the Response. Always request missing Classmark, even if a lesser cipher were configured available. If the Classmark Update response fails to come in, cause an attach failure. Instead, we could attempt to use a lesser cipher that is also enabled. That is left as a future feature, should that become relevant. I think it's unlikely. Technically, we could now end up requesting a Classmark Updating both during LU (vlr_lu_fsm) and CM Service/Paging Response (proc_arq_fsm), but in practice the only time we lack a Classmark is: during Location Updating with A5/3 enabled. A5/1 support is indicated in CM1 which is always available, and A5/3 support is indicated in CM2, which is always available during CM Service Request as well as Paging Response. So this patch has practical relevance only for Location Updating. For networks that permit only A5/3, this patch fixes Location Updating. For networks that support A5/3 and A5/1, so far we always used A5/1 during LU, and after this patch we request CM2 and likely use A5/3 instead. In msc_vlr_test_gsm_ciph, verify that requesting Classmark 2 for A5/3 works during LU. Also verify that the lack of a Classmark Response results in attach failure. In msc_vlr_test_gsm_ciph, a hacky unit test fakes a situation where a CM2 is missing during proc_arq_fsm and proves that that code path works, even though the practical relevance is currently zero. It would only become interesting if ciphering algorithms A5/4 and higher became relevant, because support of those would be indicated in Classmark 3, which would always require a Classmark Request. Related: OS#3043 Depends: I4a2e1d3923e33912579c4180aa1ff8e8f5abb7e7 (libosmocore) Change-Id: I73c7cb6a86624695bd9c0f59abb72e2fdc655131
2018-09-17msc_vlr_tests: cosmetically tweak perm algo printingNeels Hofmeyr2-13/+13
In the msc_vlr_tests, instead of printing the algo IDs, rather print the corresponding A5/n name, for clarity. Change-Id: Ic00f1e54490650bcb40170647b8ffd52ede23fd3
2018-09-17store classmark in vlr_subscr, not connNeels Hofmeyr2-8/+1
Store all Classmark information in the VLR. So, we now always know the Classmark 1 (mandatory IE for LU). This is visible in the msc_vlr_tests -- they no longer indicate "assuming A5/1 is supported" because classmark 1 is missing, because we now know the Classmark 1. Rationale: During Location Updating, we receive Classmark 1; during CM Service Request and Paging Response, we receive Classmark 2. So far we stored these only for the duration of the conn, so as soon as a LU is complete, we would forget CM1. In other words, for anything else than a LU Request, we had no Classmark 1 available at all. During Ciphering Mode Command, we rely on Classmark 1 to determine whether A5/1 is supported. That is moot if we don't even have a Classmark 1 for any CM Service Request or Paging Response initiated connections. The only reason that A5/1 worked is that we assume A5/1 to work if Classmark 1 is missing. To add to the confusion, if a phone indicated that it did *not* support A5/1 in the Classmark 1, according to spec we're supposed to not service it at all. A code comment however says that we instead want to heed the flag -- which so far was only present in a Location Updating initiated connection. Now we can make this decision without assuming things. This got my attention while hacking on sending a BSSMAP Classmark Request from the MSC if it finds missing Classmark information, and was surprised to see it it lacking CM1 to decide about A5/1. Change-Id: I27081bf6e9e017923b2d02607f7ea06beddad82a
2018-08-23cosmetic: mute "COMPLETE_LAYER_3 not permitted"Neels Hofmeyr3-12/+0
For networks without Authentication, the conn is already accepted when SUBSCR_CONN_E_COMPLETE_LAYER_3 is emitted. Mute that misleading error message. All is actually fine. Adjust expected test logs. Change-Id: I2d19d0a7cf3226ee1456f75a68e007ba98232402
2018-08-05Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlrHarald Welte3-17/+19
osmo-hlr has recently (as of Change-Id Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474) a working shared library implementation of libosmo-gsup-client. We can remove the local implementation in osmo-msc and use the system-installed shared library instead. Change-Id: I6f542945403cf2e3ddac419186b09ec0e2d43b69
2018-07-31migrate to oap_client in libosmogsmHarald Welte1-2/+2
libosmogsm in libosmocore.git from Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 onwards contains oap_client.c, so we don't need our local copy here in this repo anymore. Change-Id: Ib6496c35d0ce6eb531e97129dc45a9f68e503b34 Requires: libosmocore.git Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950
2018-07-30libmsc/gsm_09_11.c: implement network-initiated sessionsVadim Yanitskiy2-6/+323
This change introduces a possibility to establish network-initiated SS/USSD transactions with a subscriber in either IDLE, or DEDICATED state. In the first case, a new transaction is established using Paging procedure. If a subscriber already has an active connection, a separate new transaction is established. TTCN-3 test case: I073893c6e11be27e9e36f98f11c1491d0c173985 Change-Id: Ief14f8914ef013bd6efd7be842f81fbf053f02e2
2018-07-30libmsc/gsm_09_11.c: forward SS/USSD messages to HLR over GSUPVadim Yanitskiy2-7/+22
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
2018-07-29msc_vlr_tests: don't abuse USSD-request to conclude connectionsVadim Yanitskiy19-659/+488
Previously the '*#100#' USSD-request was abused in order to conclude the current subscriber connection. This makes the unit tests depend on each other, for example, if one break something in the GSM 09.11 implementation, a half of tests would fail. Moreover, the further changes in the GSM 09.11 implementation will make the results less predictable (i.e. session ID, etc.). So let's introduce a separate unit test with simple request- response logic, while more complex tests will be in TTCN. Change-Id: I40b4caac3113263f5a06c861dff5e10d43c319b5
2018-06-10libmsc/ussd.c: use connection ref-counting and transactionsVadim Yanitskiy6-23/+184
A subscriber may have a few active transactions at the same time. For example, one can receive SMS messages during a call, or during an active SS/USSD session. We already have connection ref-counting and transactions for CC and SMS, so let's also use both for SS/USSD. Change-Id: I21c6777cb88f1f4f80f75dcd39734e952bd4e8b0
2018-05-23implement periodic Location Update expiry in the VLRStefan Sperling4-0/+193
Remove subscribers which fail to send periodic Location Updates from the list of subscribers known to the VLR. This complements the IMSI detach procedure: periodic LU expiry triggers an implicit IMSI detach. Expired subscribers are purged from a periodic timer which iterates over all subscribers once per minute. Subscribers with an active connection do not expire. This is controlled by the subscriber conn FSM which sets a subscriber's the LU expiry timeout value to GSM_SUBSCRIBER_NO_EXPIRATION while a connection is active. Add support for fake time with osmo_clock_gettime() to msc_vlr tests. This functionality existed in OpenBSC but was lost during the nitb split. This code took some inspiration from the OpenBSC implementation. Related: OS#1976 Change-Id: Iebdee8b12d22acfcfb265ee41e71cfc8d9eb3ba9
2018-05-16vlr_access_req_fsm: use correct cause codesPhilipp Maier1-3/+3
The FSM that controls the VLR ACCESS uses cause code 9 (GSM48_REJECT_MS_IDENTITY_NOT_DERVIVABLE) to signal that the identity of the MS is currently not known in VLR (MSC-Reboot) However, this cause code is from the GMM domain and is interpreted as GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER by the MS, which cauese the MS not to make a new LOCATION UPDATE on CM SERVICE REQUEST - use GSM48_REJECT_IMSI_UNKNOWN_IN_VLR and GSM48_REJECT_IMSI_UNKNOWN_IN_VLR instead of GSM48_REJECT_IMSI_UNKNOWN_IN_VLR Change-Id: Ic058c93387f9be9af4940f8961839c02b93ee370 Closes: OS#3266
2018-04-17tests/msc_vlr: fix expected SS message namesVadim Yanitskiy6-92/+92
Since the I697639d8469e5dda617b27995c4a92e1f0c0bead, call independent SS messages are also supported by gsm48_pdisc_msgtype_name(). So, instead of 'NCSS:0x3b' it will return 'GSM0480_MTYPE_REGISTER'. Let's correct the expected message names. Change-Id: If9e854ee84882d104cf2ffaceb3862fda6862f19
2018-04-12msc conn ref counts: log human readable list of conn ownersNeels Hofmeyr11-1072/+1072
Change-Id: I2a09efafbdbdde0399238f7d79feea8612605201