aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-12-25change format of 'last LU seen'neels/last_lu_seen_fmtNeels Hofmeyr1-10/+8
So far, the time string format comes from ctime_r, and we manually add "UTC" to it. The ctime_r format is wildly chaotic IMHO, mixing weekday, day-of-month and hour and year in very unsorted ways. Adding "UTC" to it is non-standard. Instead use an ISO-8601 standardized time string via strftime(). Change-Id: I6731968f05050399f4dd43b241290186e0c59e1a
2018-12-20gsupclient: introduce osmo_gsup_client_enc_send()Vadim Yanitskiy2-0/+39
Several parts of OsmoMSC (e.g. GSM 04.11, 09.11, etc.) are dealing with GSUP message encoding and sending towards OsmoHLR. In order to avoid code duplication, let's have a shared function here. Change-Id: I0589ff27933e9bca2bcf93b8259004935778db8f
2018-12-13contrib: fix makedistcheck with disabled systemdOliver Smith1-1/+2
EXTRA_DIST files need to be distributed, no matter if the systemd option is configured or not. Change-Id: Ic164403189510f3b20ff7906df09c78550735591
2018-12-10display last location update timestamp in vtyStefan Sperling3-0/+44
Read the subscriber's last location update timestamp from the database and display it in the output of 'show subscriber'. For example: OsmoHLR> show subscriber id 1 ID: 1 IMSI: 123456789000000 MSISDN: 543210123456789 VLR number: 712 SGSN number: 5952 last LU seen: Fri Dec 7 11:30:51 2018 UTC While the database stores the timestamp as a string, we convert the timestamp into time_t for internal use. This allows for flexible potential use of the timestamp in contexts other than the VTY in the future. The timestamp displayed in the VTY is created with ctime_r(3). It does not match the format of the raw string in the database: sqlite> select id,last_lu_seen from subscriber; 1|2018-12-07 11:30:51 Related: OS#2838 Change-Id: Ie180c434f02ffec0d4b2f651a73258a8126b2e1a
2018-12-07add whitespace around PRId64 constantsStefan Sperling4-17/+17
Avoid string concatenations without interleaving whitespace. Some compilers don't like "foo""bar", they only like "foo" "bar". Requested by: Pau https://gerrit.osmocom.org/c/osmo-hlr/+/12121/5/src/db_hlr.c#637 Change-Id: Ic7a81114f9afbefcbd62d434720854cfdd4a2dd9
2018-12-07store a timestamp of the last location update seen from a subscriberStefan Sperling4-5/+108
Timestamps are stored in the HLR DB in the new 'last_lu_seen' column of the 'subscriber' table, in UTC and in granularity of seconds. At present, osmo-hlr only records these timestamps but otherwise makes no use of them. Because the timestamps are stored in a human-readable form, they may already provide value to external processes which need this information. For example: sqlite> select imsi,last_lu_seen from subscriber; 901990000000001|2018-12-04 14:17:12 I didn't bother adding additional tests because the code added with this commit is already being exercised by several calls to db_subscr_lu() in db_test.c. This change requires a HLR DB schema update. Existing databases won't be upgraded automatically. However, osmo-hlr will refuse to operate with databases which are not upgraded. Change-Id: Ibeb49d45aec18451a260a6654b8c51b8fc3bec50 Related: OS#2838
2018-12-06introduce osmo_gsup_client_create2()Stefan Sperling2-19/+49
Add a new API which allows creating a GSUP client connection with more identification information than just a unit name. Instead of being selective about which idenfifiers callers may use, allow callers to pass a full-blown struct ipaccess_unit. This allows applications to use entirely custom identifiers on GSUP client connections. This change is a prerequisite for inter-MSC handover because MSCs will need to use unique identifiers towards the HLR, which isn't very easy to do with the old osmo_gsup_client_create() API. While it's always been possible to pass a unique unit_name, this is not as flexible as we would like. The old API remains for backwards compatibility. struct osmo_gsup_client grows in size but is allocated internally by the library; old calling code won't notice the difference. Change-Id: Ief09677e07d6e977247185b72c605f109aa091f5 Related: OS#3355
2018-12-05SS/USSD: fix: properly (re)schedule NCSS session timeoutVadim Yanitskiy1-3/+7
It may happen that either the MS or an ESME would become unresponsive, e.g. due to a bug, or a dropped message. This is why we have SS session timeout, that prevents keeping 'stalled' sessions forever. For some reason, it wasn't properly resceduled in case of subsequent SS/USSD activity, so the lifetime of a session was limited. Let's properly (re)schedule it. Change-Id: I11aeacf012b06d3d0b5cc6e64baecf857b645fda Related: OS#3717
2018-12-05SS/USSD: make NCSS session timeout configurableVadim Yanitskiy6-4/+29
It may happen that either the MS or an ESME would become unresponsive, e.g. due to a bug, or a dropped message. This is why we have SS session timeout, that prevents keeping 'stalled' sessions forever. Let's introduce a VTY option, which can be used to configure this timer (by default it's set to 30 seconds): hlr ... ! Use 0 to disable this timer ncss-guard-timeout 30 Change-Id: I971fc2cee6fd46d4d5d6dac6c634e0b22fff183d Related: OS#3717
2018-12-05SS/USSD: release IUSE sessions immediately after responseVadim Yanitskiy1-0/+2
At the moment, all available IUSE handlers do assume a single request-response operation, e.g. MS requests its MSISDN - IUSE responds. No further nor intermediate communications is required. Let's immediately terminate such SS sessions in order to avoid waiting for the session inactivity watchdog (i.e. timeout). Change-Id: Iaefe37512da79e10fbe92378236bfff0eae0f8b9
2018-12-05contrib/jenkins.sh: build and publish manualsOliver Smith1-2/+19
Add new environment variables WITH_MANUALS and PUBLISH to control if the manuals should be built and uploaded. Describe all environment vars on top of the file. When WITH_MANUALS is set, install osmo-gsm-manuals like any other dependency and add --enable-manuals to the configure flags (for "make" and "make distcheck"). Add the bin subdir of the installed files to PATH, so osmo-gsm-manuals-check-depends can be used by ./configure. Related: OS#3385 Change-Id: Ia1a6ab64c7912f30a693ca4f5f474f22d72b8873
2018-12-04Fix DISTCHECK_CONFIGURE_FLAGS overrideOliver Smith1-1/+1
Set AM_DISTCHECK_CONFIGURE_FLAGS in Makefile.am instead of DISTCHECK_CONFIGURE_FLAGS. This is the recommended way from the automake manual, as otherwise the flag can't be changed by the user anymore. Related: OS#3718 Change-Id: I62a0c0e9cb384f8909229e153ade5567328e5c61
2018-12-04Rename db_bootstrap.sed to db_sql2c.sedNeels Hofmeyr2-5/+5
Side effect of the db schema patch, now a mere cosmetic change. Change-Id: I47a101e3b76b2125d786f22bf100604cf5e8eb40
2018-12-04add database schema versioning to the HLR databaseStefan Sperling6-25/+128
Make use of pragma user_version to store our database schema version. The present schema is now identitifed as 'version 0', which is also the default value for databases on which we never ran the statement 'pragma user_version' before. Only bootstrap the database if it hasn't been bootstrapped yet. Previously, bootstrap SQL statements ran every time osmo-hlr opened the database, and any errors were being ignored in SQL. Instead, we now first run a query which checks whether tables already exist, and only create them if necessary. This change will allow future schema updates to work properly. Prepare for future schema upgrades by adding a new command-line option which enables upgrades. This option defaults to 'false' in order to avoid accidental upgrades. Change-Id: I8aeaa9a404b622657cbc7138106f38aa6ad8d01b Related: OS#2838
2018-12-02implement removal of MSISDNNeels Hofmeyr5-21/+57
Add the first "official" way to remove the MSISDN from a subscriber entry, to go back to 'MSISDN: none' like just after 'subscriber create'. Add VTY command 'subscriber <ID> update msisdn none' to drop the MSISDN from the subscriber. (Like 'subscriber <ID> update aud3g none') Add DB_STMT_DELETE_MSISDN_BY_IMSI. In db_subscr_update_msisdn_by_imsi(), allow passing a NULL msisdn, and if NULL, call above delete SQL statement. Change-Id: I15419105ea461137776adb92d384d8985210c90e
2018-12-02add 'show subscriber' command, alias for 'subscriber ... show'Neels Hofmeyr3-2/+16
When I wrote the osmo-hlr subscriber command, I failed to heed the common 'show foo' scheme and instead created a 'subscriber [...] show' command. Relieve that weirdness by creating an alias that has 'show' at the start. Arrange string macros so that the 'show subscriber' cmd doesn't end in a space (the SUBSCR macro ends in a space ' ' to implicitly include the space to commands like 'create', 'show', 'update'). Add the new command to test_nodes.vty and test_subscriber.vty. Change-Id: I01ce9b0868302d40ed05c6a588316a194d6071e4
2018-11-27build manuals moved here from osmo-gsm-manuals.gitOliver Smith7-67/+132
Moved to doc/manuals/, with full commit history, in preceding merge commit. Now incorporate in the build system. Build with: $ autoreconf -fi $ ./configure --enable-manuals $ make Shared files from osmo-gsm-manuals.git are found automatically if - the repository is checked out in ../osmo-gsm-manuals; or - if it osmo-gsm-manuals was installed with "make install"; or - OSMO_GSM_MANUALS_DIR is set. Related: OS#3385 Change-Id: I52b7b06fddd77c6dc272004f434e9e7651f6b349
2018-11-27Merge history from osmo-gsm-manuals.gitNeels Hofmeyr14-0/+1885
Change-Id: I175d694bea8f0be4edb2be75de780dee82469849
2018-11-27hlr: update vty referenceNeels Hofmeyr1-46/+184
Change-Id: I5a2322c0488cb36b089303bbfec5d4db18c41099
2018-11-27OsmoBSC/HLR/MSC: Fix default config file nameDaniel Willmann1-1/+1
Mention that the default is not openbsc.cfg, but osmo-*.cfg Change-Id: I139e6004e28d6f918f31792e634214a6153edd0e
2018-11-27hlr: Add chapter on USSD configurationHarald Welte2-0/+80
Change-Id: Ie5196ece9f340303bcb4868e3333a9698e28c3d0
2018-11-27hlr: clarify that aud_3g also applies to 2GNeels Hofmeyr1-7/+17
(and tweak wording) Related: OS#3091 Change-Id: I2ae03625ccc1364f953db0611e9a29d935dab803
2018-11-27vty-ref: Update URI of docbook 5.0 schemaHarald Welte1-2/+2
... to match the /etc/xml/catalog file on debian (no "www" in hostname) Change-Id: Id9f3579c7f2bc3af13fe30b5268f249b6f59ed0d
2018-11-27OsmoHLR: update vty referenceNeels Hofmeyr1-385/+250
Add new (generic) logging commands, talloc context print commands. Add the jitter buffer logging category. Remove the common commands from the individual sections. Change-Id: I8e92c821b26908d4baa37745c57b9e15bda2a373
2018-11-27share chapters/gsup.adoc from OsmoSGSN to OsmoMSC + OsmoHLRHarald Welte1-0/+2
Since the NITB split, GSUP is used in all three network elements, so make the protocol a shared chapter Change-Id: Id2d7c27ef16eb0ebe5f60d625a1fcf42f1603f4f
2018-11-27OsmoHLR: update section 'Bootstrap the Database'Neels Hofmeyr1-16/+6
Change-Id: I1b7b99cc77d8cd8cce42e7cf93f5e2cd3c2344db
2018-11-27OsmoHLR: update ctrl description and examplesNeels Hofmeyr3-6/+50
The patch to refactor ctrl commands to osmo-hlr, change I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50, was tweaked. Adjust accordingly. Change-Id: Ie4da6115bb2eb005a9f95bf4de1bfe36468fd607
2018-11-27OsmoHLR: add make target to update the example ctrl and vty filesNeels Hofmeyr1-0/+41
Change-Id: I88027396ec15101697a79aa5e964387d47abdae2
2018-11-27refactor Makefile build rules, don't use the FORCENeels Hofmeyr1-38/+6
The initial goal was to make sure we don't have overall FORCE rules causing unnecessary rebuilds -- annoying while writing documentation. As I looked through possible dependencies, I finally understood what's going on here. Remove code dup and nicely sort which belongs where in build/Makefile.*.inc. In each, describe in a top comment how to use it, and also unify how they are used: - Rename Makefile.inc to Makefile.docbook.inc and refactor - Add Makefile.vty-reference.inc - Add Makefile.common.inc Make sure that we accurately pick up all dependencies. Drop use of the macro called 'command', that silenced the actual command lines invoked and replaced them with short strings: it obscures what is actually going on and makes the Makefiles hard to read and understand. Each manual's makefile is greatly reduced to few definitions and a Makefile include, e.g. one for asciidoc, one for VTY reference. Move common/bsc_vty_additions.xml to OsmoBSC/vty/libbsc_vty_additions.xml, link from OsmoNITB. It applies only to OsmoBSC and OsmoNITB. Add a script that combines a VTY reference file with *all* additions files found in a manual's vty/ dir. Call this from Makefile.vty-reference.inc. Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0
2018-11-27add OsmoHLR manual, OsmoHLR VTY referenceNeels Hofmeyr13-0/+1747
Change-Id: Ieb6a362a26a7e65199f68f5cd32d9b6b0e5d0fbf
2018-11-27Importing history from osmo-gsm-manuals.gitNeels Hofmeyr0-0/+0
Change-Id: I2907e34a3bdba41142ffd4be43ce0e3e9a86aa42
2018-10-16fix and re-enable osmo_hlr_subscriber_update_notify()Neels Hofmeyr1-23/+42
Send updated subscriber data out to exactly those GSUP clients that match the last LU operations (depending on each client sending distinct identification). As this adds logging on DLGSUP, also change adjacent GSUP related logging from DMAIN to DLGSUP. Related: OS#2785 Change-Id: I7c317de8329d9a115d072fc61ddb9abc21b7e8d8
2018-10-12hlr_ussd.c: fix: reject 'structured' SS requestsVadim Yanitskiy1-2/+9
As we don't store any SS related information (e.g. call forwarding preferences) in the database, we don't handle 'structured' SS requests at all. Let's reject them by sending error message with FACILITY_NOT_SUPPORTED code. Change-Id: Ia1317c5d372a42473cce65c0c985103e43be77fd Related: OS#3651
2018-10-05store gsup peer upon accepting LUNeels Hofmeyr1-0/+12
Store the GSUP client's IPA_IDTAG_SERNR in vlr_number or sgsn_number (depending on is_ps), just before sending the Insert Subscriber Data message after a successful LU Req. Log about it. Original patch: Ib2611421f3638eadc361787af801fffe9a34bd8a by laforge Related: OS#2796 Change-Id: If438664faa5d68404f465f8b2002c6d03bbf3ceb
2018-10-04more space for vlr_number and sgsn_numberNeels Hofmeyr1-2/+2
To be able to handle our 20 chars long IPA tags, enlarge the vlr_number and sgsn_number storage in struct hlr_subscriber. Technically, osmo-hlr should be able to store any type of Global Title, blob of arbitrary size. For our purposes, 32 is enough for now. Related: OS#2796 Change-Id: I0121f1c4dbda3a076d780a3834281b21dab85493
2018-09-28fix is_ps logic in rx_upd_loc_req(), store CS as is_ps = falseNeels Hofmeyr1-5/+6
A missing 'else' in rx_upd_loc_req() causes *all* clients to be indicated as is_ps=true regardless of the GSUP CN Domain IE that was received. Replace that odd if cascade with a switch() that fixes the flawed logic. Hence osmo-hlr now correctly indicates each client's is_ps, iff the client sends CN Domain IEs in GSUP LU Request messages. Related: OS#2796, OS#3601 Change-Id: I2c5fa9f5cae25cfd66afbf088303edff7d045a00
2018-09-26fix VTY tests to expect well-formed output of logging configurationHarald Welte1-4/+4
In libosmocore Change-Id Ia75c7067284ea225cffe13ca71bad05a7747ae66 we fixed the generation (saving) of logging configuration to use one level of indent, rather than the previous broken implementation with two levels of indent. This means we have to adjust the VTY test expectations here. Change-Id: I9282a59bbfad4cfc86e86c1212c74cccfe187ff8
2018-09-25osmo-hlr.cfg: Ensure well-formed config file exampleHarald Welte1-12/+12
Change-Id: I136fdda6f4088f2e8094eed6fe9481f5d6476d4f
2018-09-18make: always allow running python tests manuallyNeels Hofmeyr1-5/+4
Keep the rules to run the external-tests in tests/Makefile available for invocation, to allow conveniently launching the tests manualy without the need to pass --with-external-tests to ./configure first. Change-Id: Ic28dbeabddee6b41af12b977e3fe59e663ee51a1
2018-09-18tweak example configNeels Hofmeyr2-2/+5
Remove 'logging level all' setting. Tweak some more logging details (to my current favorite). Add USSD example for showing the IMSI. Change-Id: I8296832704d779df5f1b20a595b568c99780e64d
2018-09-13fix build: adjust test_nodes.vty to logging changeNeels Hofmeyr1-12/+1
Since libosmocore commit eb9284ba577d338f74653fcf09ebca0c397823eb Change-Id I36f17c131cc70ce5a1aef62fd9693097de230cd4 "logging vty: deprecate 'all', introduce 'force-all'" , 'logging level all' is replaced by 'force-all'. Adjust the test script to not expect 'logging level all'. While at it, remove some more expectations that aren't important. Change-Id: Ia170f8416ebb60c499d2536078f43f28b61d0554
2018-09-12Install sample cfg file to /etc/osmocompespin/systemdPau Espin Pedrol2-0/+6
Change-Id: I2ac73f426d9489fcd64c2eea547eb1f3ec26ae2c
2018-09-12Move doc/Makefile.am to doc/examples/Makefile.amPau Espin Pedrol3-22/+24
Change-Id: I89ef3abe86e7ceb7b389ac1cb227ea065bfbce37
2018-09-10Install systemd services with autotoolsPau Espin Pedrol7-1/+32
Change-Id: Id81ae8e2d8a2c9456ac0dac2c30c0d24dab3b694
2018-09-03libosmo-gsup-client: License is GPLv2-or-laterHarald Welte1-4/+4
Fix the unintentional AGPLv3-or-later license header in gsup_client.c Change-Id: I6378bd59fdbe8d95cd6132a1cbc40ae29b558c42
2018-08-08USSD: Fix "ussd default-route"Harald Welte1-0/+5
Before this patch, the default route logic was not implemented. The user could specify a default-route, but it wouldn't be used by the actual routing logic. Let's fix that. Change-Id: I0b04a75dc297f088f13da413d08c52e0747e46e6
2018-08-08hlr_ussd.c: avoid using CR and NL in IUSE responsesVadim Yanitskiy1-2/+2
According to GSM TS 03.38, section 6.1.2.1, CR symbol at the end is optional, and moreover libosmogsm encoding API will carry about the bit padding itself. Change-Id: I09e8a67758698f3b7a578eab956311e269d091ee
2018-08-06debian: Make libosmo-gsup-client-dev depend on libosmo-gsup-client0Harald Welte1-0/+1
The -dev package should depend on the binary package. Change-Id: I01e58788e8485cadecad8b8788887743b41b9f1f
2018-08-06gitignore: Add .tarball-versionHarald Welte1-0/+1
Change-Id: I2ed792ef248e2b62f63acc7d83add240df03336f
2018-08-03hlr_ussd.c: fix: properly print a EUSE / IUSE nameVadim Yanitskiy1-2/+4
We need to distinguish between both EUSE and IUSE, and properly print their names. Otherwise, garbage is printed in case of IUSE. Change-Id: I497e7c1fe41279afdb1256ee69e166066a6462bb