aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-01-30Make sending an SMS to an unknown subscriber B work over SMPP.stsp/smpp_store_smsStefan Sperling1-3/+9
Make the submit_to_sms() funcion aware of the message mode. If the message does not require real-time "transactional/forward mode" we can store it in the SMS database even if subscriber B cannot be found in the VLR at this point in time. This should should make the esme_ms_sms_storeforward test in osmo-gsm-tester pass (a tweak to this test's expectations will be needed as well, because the test currently assumes that an invalid phone number for subscriber B will fail immediately, rather than cause the message to eventually expire). Change-Id: Ic3d78919568ad9252b4d19c3ddab5068d1c52db2 Related: OS#2354
2018-01-28Change GSUP re-connect interval to 1sHarald Welte1-1/+4
This leads to faster recovery in case of link loss. It also makes the TTCN-3 test suite run much faster, as each test case will inherently terminate the GSUP connection. Change-Id: I16821a26f2c6ff4d0a76926c9212127ab6f6fedf
2018-01-28MSC: Intersect configured A5 algorithms with MS-supported onesHarald Welte1-1/+65
There's no point of ever asking a MS to perform ciphering using an algorithm it advertises no support for. Let's hence use CLASSMARK information to figure out the intersection between MSC policy (VTY command) and MS-reported CLASSMARK. Change-Id: Id124923ee52a357cb7d3e04d33f585214774f3a3
2018-01-28Permit a set of multiple different A5 ciphersHarald Welte8-30/+49
So far, the administrator had to pick one particular cipher which would then be used throughout all subscribers/phones. This is a bit impractical, as e.g. not all phones support A5/3. Extend the VTY command syntax in a backwards-compatible way to permit for multiple ciphers. NOTE: Like the previous code, OsmoMSC does *not yet check* whether the configured cipher is compatible with the MS capabilities as reported in CLASSMARK! The network hence might choose an algorithm not supported by the phone. Fixing this is subject to another patch. Closes: OS#2460 Change-Id: I79a4e2892eb5fbecc3d84e11dceffb7149db264b
2018-01-28Shift ciphering algorithm selection from VLR to MSCHarald Welte10-73/+47
The VLR code seems to have the assumption that there is one particular algorithm to be used, as opposed to one of a set of algorithms. What's missing is basically to decide when/where to pick the best algorithm within the capabilities of the phone (classmark) and the network configuration (net->a5_encryption_mask). So far, libvlr has no notion of classmark. Rather, libmsc has. Why does the VLR care about the particular algorithm at all? The VLR should probably simply decide if it should use encryption or not, and if so, the MSC will figure which algorithm to use. Change-Id: I5ed80ca2086560a5975a758ec568a034a9a8ab89
2018-01-25Delete expired SMS automatically.Stefan Sperling3-14/+48
Delete expired SMS whenever we are done processing an SMS-related signal. In order to minimize additional latency only one SMS is removed at a time. Change-Id: I56cbe716e52b679c4b94f6cbb4a171306975be2e Related: OS#2354
2018-01-25Accept SMS for any receiverStefan Sperling1-3/+4
Accept any SMS and store it in the database, even if the receiver of the message cannot be determined when the message arrives at the MSC. This fixes https://osmocom.org/issues/2354 ("SMSC: Store&Forward not working for subscribed but unregistered MS"). Change-Id: I833c3abd290d2bc5fceec7457e3933c9600e6c24 Depends: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Depends: I56cbe716e52b679c4b94f6cbb4a171306975be2e Depends: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a Related: OS#2354
2018-01-25Add a VTY command which deletes all expired SMS.Stefan Sperling5-7/+85
We already delete SMS which have been sent successfully. However, there are plans to accept SMS for any subscriber in order to fix the problem described in https://osmocom.org/issues/2354 ("SMSC: Store&Forward not working for subscribed but unregistered MS"). This means we may end up storing SMS which never get sent, e.g. because the B subscriber doesn't actually exist. This could lead to a higher degree of SMS database growth over time, and therefore we need a way to keep database size under control. As a first step, introduce a DB function which removes an expired SMS, and add a VTY command which removes all expired SMS from the DB. Later commits will build upon this to remove expired SMS automatically. The SMS expiry time period is currently hard-coded to 2 weeks. We could make this configurable in the future if desired. Change-Id: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Related: OS#2354
2018-01-25debug: Remove dead log categoriesHarald Welte5-94/+4
Change-Id: Ibdfc39ead4f0c5e3a74321e9d2c9720ae1603541 Related: OS#2528
2018-01-25remove dead ctrl.h header fileHarald Welte3-6/+0
Change-Id: I3ea0d98580085982ec0f20165c0ddcfd439e7419 Related: OS#2528
2018-01-25signal.h: Remove unused/dead signal definitionsHarald Welte1-14/+0
Change-Id: Iba5be82e11fa1d5e5514bc86d8ec23cda24ae4c9 Related: OS#2528
2018-01-25remove dead header files bsc_msc.h, bsc_msc_data.h and bsc_rll.hHarald Welte8-277/+1
Related: OS#2528 Change-Id: I13cc4513689af1d594952dd628738b1240560bb7
2018-01-25remove dead code in auth.h / auth.cHarald Welte5-65/+0
Change-Id: I57e3b79a95a35c4783dc3775a88d15f13cbec13e Related: OS#2528
2018-01-25remove unused ipaccess.hHarald Welte2-53/+0
Change-Id: Ibee159a119a1cce2b3fcbdabf3491673aed4ea95 Related: OS#2528
2018-01-25Massive removal of unused code/structs/headersHarald Welte52-3552/+9
osmo-msc still had large amounts of dead code that came along from openbsc.git. This commit removes a lot of it, mostly stuff relevant only to the BSC side of things (or even GPRS). Change-Id: I247def85da2dc3ec461389fb74414a0d964e7e3c Related: OS#2528
2018-01-25jenkins.sh: Don't depend on osmo-ggsnHarald Welte1-1/+0
There's nothing GPRS related left in osmo-msc, and hence no reason why we should build osmo-ggsn as a build dependency. Change-Id: I096f63e471dc8fdbd42a78f67d433f61b830615b
2018-01-24remove traces of bsc_subscriberHarald Welte14-91/+72
Change-Id: I8672f0a76cb47595444a7ddbc4f34fc4ddaeb375
2018-01-24debug: Remove code for filters that don't exist in OsmoMSCHarald Welte2-18/+0
We don't have BSC or GPRS related logging filters here. This is a leftover from the NITB->MSC split Change-Id: I05f991d1f5b7f89545521a73d79619bee4111094
2018-01-24remove unused paging.h and osmo_bsc_grace.hHarald Welte8-118/+0
Change-Id: I6af40f65f0634e49939906a3e50a41e0be246794
2018-01-24msc_cipher_mode_compl: Handle CIPH MOD COMPL without L3 messageHarald Welte1-26/+26
According to TS 44.008 Section 3.2.1.31, the "Layer 3 Message Contents" IE of the BSSMAP Cipher Mode Complete is optional. The BSC may hence inlcude that IE or not include it. Without this patch, OsmoMSC is crashing if that IE was missing: <000a> a_iface_bssap.c:699 Rx BSC DT: 00 03 55 2c 02 <000a> a_iface_bssap.c:629 Rx MSC DT1 BSSMAP CIPHER MODE COMPLETE <001f> a_iface_bssap.c:91 Found A subscriber for conn_id 1 <000a> a_iface_bssap.c:415 BSC sends cipher mode complete (conn_id=1) ==5611== Invalid read of size 8 ==5611== at 0x128D0F: msc_cipher_mode_compl (osmo_msc.c:159) ==5611== by 0x114F62: bssmap_rx_ciph_compl.isra.8 (a_iface_bssap.c:432) ==5611== by 0x113267: sccp_sap_up (a_iface.c:520) Change-Id: I722f9b468b157b3736918f090daaa9489a6028ee Closes: OS#2871
2018-01-24Properly reject CM Re-Establishment RequestHarald Welte1-1/+22
Even if we're not implementing CM re-establishment, we should give the MS a clear indication that we don't do and follow the related procedures of TS 24.008 by sending CM SERVICE REJECT. Closes: OS#2869 Change-Id: I1c0473647295456fd635b8df6079ee48695dcf2e
2018-01-24Fix msc_vlr test results (.err) for new libosmocore GSM48_PDISC namesHarald Welte8-346/+346
In I8de7c01f9ea1d66c384e57449c4140186f5ce6c5, libosmocore introduced shorter names in gsm48_pdisc_names, which has implications on the expected test output Change-Id: I4421872a0d609dd50a6b911b928aa5e111d1ad24
2018-01-24Remove traces of meas_feedHarald Welte7-276/+0
Measurement reporting (and the relate feed) are functions of the BSC, not the MSC. This code should never have been inherited from OsmoNITB to OsmoMSC in the first place, let's remove it. Change-Id: I0d57ac214e574e267fa9752daf76566197b9aa64
2018-01-24Reject any CM SERVICE we don't supportHarald Welte1-0/+11
When we receive a CM Service Request, OsmoMSC should eventually verify what kind of service it is the phone requests, and whether we support that service. Change-Id: I499730d760dc9ac7f599e09959c6eac4452f2eab Closes: OS#2668
2018-01-24Refuse Emergency Calls by IMEI with proper CM SERVICE REJECT CauseHarald Welte1-9/+15
OsmoMSC rejects an Emergency Call with IMEI as mobile identity with "semantically incorrect message" which is clearly wrong. According to TS 24.008 4.5.1.5 we should reject with cause 5 "IMEI not accepted" Found with TTCN-3 test case MSC_Tests.TC_emerg_call_imei Change-Id: I2f7ab0e32b914a112c0b17c523d149ccd0299099 Closes: #2866
2018-01-24Emergency Call: Set MNCC_F_EMERGENCY flagHarald Welte1-1/+3
MNCC has a MNCC_F_EMERGENCY flag to indicate that the mncc.emergency field is present. However, OsmoMSC never sets this flag. Change-Id: I0ebd8f88e483172988f4a0cb0636b4160688d8ad Closes: OS#2865
2018-01-24Log difference between SETUP and EMERGENCY_SETUPHarald Welte1-2/+2
An emergency call should be logged different from a normal call, and we also increase the log level from INFO to NOTICE in such a situation. Change-Id: I83f3b8bd0aeda70f03aa7b8d264a9008d10d5687
2018-01-24cosmetic: log prim operation as textMax1-1/+2
When logging SCCP error, log failed primitive operation as text. Change-Id: Icda9f8f18aacc7bcc281aad5fbb89208e6dab336 Related: OS#2851
2018-01-24VLR: constify GSUP-related function parametersMax2-6/+6
Change-Id: If3852e096210713cb5297f6b42ed66dbb98c4a50
2018-01-23MNCC: Add input validationHarald Welte3-2/+188
There appears to have been no input validation whatsoever on MNCC messages. Hence it was very easy for an external MNCC handler to crash OsmoMSC, such as in OS#2853 Change-Id: Idaf3b8e409c84564b1eb26d01a19c605f89b14f4 Closes: OS#2853
2018-01-23Fix value of stored SMS validity time.Stefan Sperling1-1/+1
Quote the argument to sqlite's datetime(). Otherwise, the timestamp stored in the database reads back as a negative value for some reason. Before: 1032 validity_timestamp = dbi_result_get_datetime(result, "valid_until"); (gdb) p validity_timestamp $2 = -1516814654 After: 1032 validity_timestamp = dbi_result_get_datetime(result, "valid_until"); (gdb) p validity_timestamp $2 = 1516814654 Change-Id: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a
2018-01-22libmsc: msc_vty: Fix compilation warningPau Espin Pedrol1-1/+1
As the include file gsm_data.h is generic (does not depend on osmo-iuh0s iu_client.h), rab_assign_addr_enc is declared as "int" instead of "enum ranap_nsap_addr_enc". osmo-msc/src/libmsc/msc_vty.c: In function ‘msc_vty_init’: osmo-msc/src/libmsc/msc_vty.c:212:30: warning: passing argument 2 of ‘ranap_iu_vty_init’ from incompatible pointer type [-Wincompatible-pointer-types] ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); ^ Change-Id: I1b63ee350911bdf772a2324fff55035275a455c4
2018-01-20Store/retrieve SMS validity time in the SMS datebaseStefan Sperling1-8/+11
Compute a validity timestamp based on SMS validity time. Store the computed value in the database and recompute the validity time when an SMS is read from the database. Change-Id: Id27c250d3a64cd109416450e8ca155b18a8b9568
2018-01-18Delete SMS from the database once they were sent successfullyStefan Sperling3-0/+18
Currently the SMS database keeps accumulating entries for each SMS. These entries are never deleted automatically. With this change, we start deleting SMS which have successfully been sent to subscriber B. Change-Id: I3749855fe25d9d4e37ec96b0c2bffbc692b66a78
2018-01-16Improve an error message in db_init().Stefan Sperling1-1/+2
If we cannot open a connection to the sqlite3 database, show the name of the database we failed to access, and also hint at the fact that a likely reason for the problem is a missing sqlite3 driver for libdbi. Change-Id: If1c0026e882984b4358ce116ec4a7ad40340517c
2018-01-16fix build: missing LIBOSMORANAP flags in libmscNeels Hofmeyr1-0/+1
Change-Id: I2f498a2d008571d3eb8753bede0847fa7ab704ed
2018-01-10src/libmsc/ussd.c: drop useless forward declarationVadim Yanitskiy1-16/+12
There is no any significant reason to define static function 'send_own_number' after the code that calls it. Change-Id: I7f76f278c09489dccd96921610e8d06efa679ff2
2018-01-10msc/gsm_04_80.h: use '#pragma once' instead of includesVadim Yanitskiy1-4/+1
This is a common include guard way for Osmocom projects. Change-Id: I5a12a742719d4deba0b9dfa8bb330c1986a727f6
2018-01-10msc/gsm_04_80.h: cosmetic: whitespace fixVadim Yanitskiy1-2/+2
Change-Id: Ia3632c75cf2d2ce79b42b3b55ef50a72ab1bb94c
2018-01-10msc/gsm_04_80.h: clean up useless declarationsVadim Yanitskiy1-4/+0
This change removes a few USSD specific declarations, which are not actually used now, and probably accidentally migrated from legacy OpenBSC. Change-Id: Id57a24b92790d3ce0f9c7343d060f511e2b979c7
2018-01-08a_iface_tx_assignment: fix log lvl for "Sending Assignment..."Neels Hofmeyr1-1/+1
Change-Id: I42bd3dc601465a4ac6a6e2bf8c4af736547d4838
2018-01-07smpp_smsc.c: don't talloc_strdup NULL pointersthe 34c3 gsm team1-1/+1
Change-Id: Ie6a83a20464a959cf51f999d6f900fa4516ced1b
2018-01-05Add control command to expire subscriberMax4-10/+56
It's equivalent of existing vty command: common part is extracted into shared helper function. Change-Id: I267886b7c79ed6d9c2f34a2e60d2972b7f4f4036
2017-12-31VLR: log subscriber updateMax15-12/+62
* move log helpers to generic header * log subscriber update It's handy for troubleshooting issues with subscriber update via GSUP from HLR. Change-Id: I1958aeeb3ea99831c7e2c5ee9a6b59834baf4520
2017-12-29VLR: remove unused parameterMax2-8/+0
The expire_lu is never used but is printed for every subscriber. Let's remove it to avoid confusion. Change-Id: I6f7ad1670836384d1e6a58f47a13464fdbbf8509
2017-12-27Migrate from OpenSSL to osmo_get_rand_id()Max13-27/+10
This avoids potential licensing incompatibility and makes integration of Debian packaging patches easier. Related: OS#1694 Change-Id: I71cd631704a4dc155c6c752fee2a42cd6e2fa336
2017-12-21Enable sanitize for CI testsMax1-1/+1
Change-Id: I23da6f9b836595d81b509c8a6fb4e46b5d675103
2017-12-20fix: properly cancel all Paging on IMSI DetachNeels Hofmeyr5-5/+43
It's not clear cut which code is responsible for canceling pending requests, since the requests list is kept in vlr_subscr, but sending out Paging does certainly not belong in the VLR. Place the requests cleanup in gsm_04_08.c. Add to test_ms_timeout_paging() in msc_vlr_test_ms_timeout.c to verify that a pending paging is canceled on IMSI Detach. Change-Id: Ib8874a9d92f02b0826525b55518332f6899688fd
2017-12-20fix paging: add timeout to discard unsuccessful pagingNeels Hofmeyr7-1/+298
Currently, if there is no reply from the BSS / RNC, a subscriber will remain as "already paged" forever, and is never going to be paged again. Even on IMSI Detach, the pending request will keep a ref count on the vlr_subscr. Add a paging timeout, as gsm_network->paging_timeout and in the VTY on the 'msc' node as 'paging timeout (default|<1-65535>'. (There is a 'network' / 'T3113' in OsmoBSC, but to not confuse the two, give this a different name.) Add test_ms_timeout_paging() test to verify the timeout works. I hit this while testing Paging across multiple hNodeB, when a UE lost connection to the hNodeB. I noticed that no matter how long I wait, no Paging is sent out anymore, and found this embarrassing issue. Good grief... The choice of 10 seconds is taken from https://osmocom.org/issues/2756 Change-Id: I2db6f1e2ad341cf9c2cc7a21ec2fca0bae5b2db5
2017-12-20cosmetic: rename sccp_rx_udt and sccp_rx_dt to a_*Neels Hofmeyr3-7/+7
These rx functions are only used for the A interface, hence the names should not suggest general SCCP rx (which Iu also has). Change-Id: I6815c3d4dea4c2abfdff1cf0239ada6a9254f351